-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (51 loc) · 1.96 KB
/
release-instrumentation-openai.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 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-24.04
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 }}*'