-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.21 KB
/
release-javascript-sdk.yml
File metadata and controls
44 lines (41 loc) · 1.21 KB
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
name: Release JavaScript SDK
on:
push:
tags:
- "sdk-js-v*.*.*"
permissions:
contents: write
id-token: write
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdk/javascript
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
cache: npm
cache-dependency-path: sdk/javascript/package-lock.json
- run: npm install -g npm@latest
- name: Verify tag matches package version
run: |
TAG_VERSION="${GITHUB_REF_NAME#sdk-js-v}"
PACKAGE_VERSION="$(node -p "require('./package.json').version")"
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "tag version $TAG_VERSION does not match package.json version $PACKAGE_VERSION" >&2
exit 1
fi
- run: npm ci
- run: npm test
- run: npm run build
- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Delete tag on failure
if: failure()
run: git push --delete origin "${{ github.ref_name }}"