release instrumentation-openai 0.4.1 (#493) #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Release a tagged version of the '@elastic/opentelemetry-instrumentation-openai' package. | |
name: release-instrumentation-openai | |
on: | |
push: | |
tags: | |
- instrumentation-openai-v*.*.* | |
# '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: | |
PKGDIR: packages/instrumentation-openai | |
PKGNAME: "@elastic/opentelemetry-instrumentation-openai" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 'v18.20.4' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
working-directory: ${{ env.PKGDIR }} | |
- run: npm run compile | |
working-directory: ${{ env.PKGDIR }} | |
- run: npm publish | |
working-directory: ${{ env.PKGDIR }} | |
env: | |
# https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages#publishing-packages-to-the-npm-registry | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: GitHub release | |
run: | | |
npm ci # need top-level devDeps for github-release.sh script | |
./scripts/github-release.sh "$PKGDIR" "${{ github.ref_name }}" | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Notify in Slack | |
# Only notify on failure, because on success the published GitHub | |
# Release will result in a notification from the GitHub Slack app | |
# (assuming '/github subscribe elastic/elastic-otel-node'). | |
if: ${{ failure() }} | |
uses: elastic/oblt-actions/slack/[email protected] | |
with: | |
bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
channel-id: "#apm-agent-node" | |
message: '[${{ github.repository }}] Release `${{ env.PKGNAME }}` *${{ github.ref_name }}*' |