Skip to content

chore: for testing purposes #1

chore: for testing purposes

chore: for testing purposes #1

Workflow file for this run

# Release a tagged version of the '@elastic/opentelemetry-node' package.
name: release
on:
push:
tags:
- v*.*.*
branches:
- main
- trentm/release-process
# 'id-token' perm needed for npm publishing with provenance (see
# https://docs.npmjs.com/generating-provenance-statements#example-github-actions-workflow)
permissions:
contents: write
pull-requests: read
id-token: write
jobs:
release:
runs-on: ubuntu-latest
env:
DRY_RUN: "${{ startsWith(github.ref, 'refs/tags') }}"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 'v18.20.2'
- run: npm ci --ignore-scripts
- name: GitHub release
run: ./scripts/github-release.sh "packages/opentelemetry-node" "${{ env.GITHUB_REF_NAME }}" "${{ env.DRY_RUN }}"
env:
GH_TOKEN: ${{ github.token }}
- name: Read NPM vault secrets
uses: hashicorp/vault-action@v3.0.0
with:
url: ${{ secrets.VAULT_ADDR }}
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
secret/jenkins-ci/npmjs/elasticmachine token | NPMJS_TOKEN ;
totp/code/npmjs-elasticmachine code | TOTP_CODE
- name: npm publish
run: |
PUBLISH_FLAGS="--dry-run"
[ "${{ env.DRY_RUN }}" == "true" ] && PUBLISH_FLAGS="" || true
echo "npm publish $PUBLISH_FLAGS --otp=${{ env.TOTP_CODE }}"
env:
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
NODE_AUTH_TOKEN: ${{ env.NPMJS_TOKEN }}
# If a release tag then notify
- if: ${{ always() && startsWith(github.ref, 'refs/tags') }}
uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current
with:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
slackChannel: "#apm-agent-node"
message: '[${{ github.repository }}] Release `@elastic/opentelemetry-node` *${{ github.ref_name }}*'