Skip to content

Commit faa4053

Browse files
committed
chore: add canary release workflow
1 parent 3c0ae45 commit faa4053

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- next
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
publish:
14+
name: Publish to npm
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 30
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21+
with:
22+
persist-credentials: false
23+
24+
- name: Set up pnpm
25+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
26+
27+
- name: Set up Node.js
28+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
29+
with:
30+
node-version: 24
31+
registry-url: https://registry.npmjs.org
32+
package-manager-cache: false
33+
34+
- name: Install dependencies
35+
run: pnpm install --frozen-lockfile
36+
37+
- name: Build and test
38+
run: pnpm run release
39+
40+
- name: Set canary version
41+
id: version
42+
shell: bash
43+
run: |
44+
base_version="$(node -p "require('./package.json').version.split('-')[0]")"
45+
canary_version="${base_version}-canary.${GITHUB_RUN_NUMBER}.${GITHUB_RUN_ATTEMPT}.g${GITHUB_SHA::7}"
46+
npm version "${canary_version}" --no-git-tag-version
47+
echo "version=${canary_version}" >> "${GITHUB_OUTPUT}"
48+
49+
- name: Publish canary
50+
run: npm publish --tag canary --access public
51+
52+
- name: Add release summary
53+
run: echo "Published maath@${{ steps.version.outputs.version }} with the canary tag." >> "${GITHUB_STEP_SUMMARY}"

0 commit comments

Comments
 (0)