Skip to content

Commit a8167cd

Browse files
authored
ci: use github secrets (#940)
1 parent 41588ed commit a8167cd

File tree

4 files changed

+10
-61
lines changed

4 files changed

+10
-61
lines changed

.github/actions/setup-totp/action.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/dist-tag.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,6 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@v4
2626

27-
- uses: elastic/apm-pipeline-library/.github/actions/setup-npmrc@current
28-
with:
29-
secret: secret/jenkins-ci/npmjs/elasticmachine
30-
vault-url: ${{ secrets.VAULT_ADDR }}
31-
vault-role-id: ${{ secrets.VAULT_ROLE_ID }}
32-
vault-secret-id: ${{ secrets.VAULT_SECRET_ID }}
33-
34-
- uses: ./.github/actions/setup-totp
35-
with:
36-
vault-url: ${{ secrets.VAULT_ADDR }}
37-
vault-role-id: ${{ secrets.VAULT_ROLE_ID }}
38-
vault-secret-id: ${{ secrets.VAULT_SECRET_ID }}
39-
4027
- name: Validate version input is a valid semver
4128
run: |
4229
if ! [[ "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-z0-9.]+)?(\+[a-z0-9.]+)?$ ]]; then
@@ -54,6 +41,9 @@ jobs:
5441
exit 1 ;;
5542
esac
5643
44+
- name: configure NPMJS token
45+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
46+
5747
- name: NPM dist-tag
5848
run: |
59-
npm dist-tag --otp=${TOTP_CODE} add "@elastic/synthetics@${VERSION}" "${DIST_TAG}"
49+
npm dist-tag add "@elastic/synthetics@${VERSION}" "${DIST_TAG}"

.github/workflows/release.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,11 @@ jobs:
2828
with:
2929
fetch-depth: 0
3030
- uses: elastic/apm-pipeline-library/.github/actions/setup-git@current
31-
- uses: elastic/apm-pipeline-library/.github/actions/setup-npmrc@current
32-
with:
33-
secret: secret/jenkins-ci/npmjs/elasticmachine
34-
vault-url: ${{ secrets.VAULT_ADDR }}
35-
vault-role-id: ${{ secrets.VAULT_ROLE_ID }}
36-
vault-secret-id: ${{ secrets.VAULT_SECRET_ID }}
3731
- run: npm ci # runs npm prepublish
38-
- uses: ./.github/actions/setup-totp
39-
with:
40-
vault-url: ${{ secrets.VAULT_ADDR }}
41-
vault-role-id: ${{ secrets.VAULT_ROLE_ID }}
42-
vault-secret-id: ${{ secrets.VAULT_SECRET_ID }}
32+
33+
- name: configure NPMJS token
34+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
35+
4336
- run: npx semantic-release --dry-run="${DRY_RUN}"
4437
env:
4538
DRY_RUN: ${{ github.event.inputs.dry-run }}
@@ -52,7 +45,7 @@ jobs:
5245
5346
- name: Create 'stack_release' dist-tag
5447
if: ${{ github.event.inputs.dry-run == 'false' && github.event.inputs.is-stack-release == 'true' }}
55-
run: npm dist-tag --otp=${TOTP_CODE} add "${NPM_PACKAGE}@${VERSION}" stack_release
48+
run: npm dist-tag add "${NPM_PACKAGE}@${VERSION}" stack_release
5649

5750
- if: ${{ always() && github.event.inputs.dry-run == 'false' }}
5851
uses: elastic/oblt-actions/slack/notify-result@v1

.releaserc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
[
1313
"@semantic-release/exec",
1414
{
15-
"publishCmd": "npm publish --otp=${process.env.TOTP_CODE}"
15+
"publishCmd": "npm publish"
1616
}
1717
],
1818
"@semantic-release/github"

0 commit comments

Comments
 (0)