-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.26 KB
/
release.yml
File metadata and controls
47 lines (45 loc) · 1.26 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
45
46
47
name: Release
on:
push:
tags: ["sdk-v*"]
permissions:
contents: write
id-token: write # required for npm provenance
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: "20"
cache: "npm"
registry-url: "https://registry.npmjs.org"
scope: "@cryptohopper"
always-auth: true
- name: Install
run: npm ci
- name: Typecheck
run: npm run typecheck
- name: Test
run: npm test
- name: Build
run: npm run build
- name: Verify package version matches tag
run: |
TAG="${GITHUB_REF_NAME#sdk-v}"
PKG=$(node -p "require('./package.json').version")
if [ "$TAG" != "$PKG" ]; then
echo "Tag $GITHUB_REF_NAME (→ $TAG) does not match package.json $PKG"
exit 1
fi
- name: Publish to npm with provenance
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
prerelease: true