-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (45 loc) · 1.72 KB
/
release-mockotlpserver.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
# Release a tagged version of the '@elastic/mockotlpserver' package.
name: release-mockotlpserver
on:
push:
tags:
- mockotlpserver-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
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'
- name: npm publish
working-directory: ./packages/mockotlpserver
run: npm publish
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 "packages/mockotlpserver" "${{ 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 `@elastic/mockotlpserver` *${{ github.ref_name }}*'