@@ -2,58 +2,58 @@ name: Canary Release
22
33on :
44 push :
5- branches : [ main ]
5+ branches : [main]
66
77jobs :
88 canary-release :
99 runs-on : ubuntu-latest
1010 if : ${{ !contains(github.event.head_commit.message, '[skip release]') }}
11-
11+
1212 steps :
13- - name : Checkout code
14- uses : actions/checkout@v4
15- with :
16- fetch-depth : 0
17-
18- - name : Setup Bun
19- uses : oven-sh/setup-bun@v2
20- with :
21- bun-version : latest
22-
23- - name : Install dependencies
24- run : bun install --frozen-lockfile
25-
26- - name : Run tests
27- run : bun run test:ci
28-
29- - name : Run linting
30- run : bun run lint
31-
32- - name : Build project
33- run : bun run build
34-
35- - name : Generate canary version
36- id : version
37- run : |
38- COMMIT_SHA=$(git rev-parse --short HEAD)
39- TIMESTAMP=$(date +%Y%m%d%H%M%S)
40- CANARY_VERSION="0.0.1-canary.${TIMESTAMP}.${COMMIT_SHA}"
41- echo "canary_version=${CANARY_VERSION}" >> $GITHUB_OUTPUT
42- echo "Generated canary version: ${CANARY_VERSION}"
43-
44- - name : Update package.json version
45- run : |
46- bun --bun -e "
47- const pkg = require('./package.json');
48- pkg.version = '${{ steps.version.outputs.canary_version }}';
49- require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));
50- "
51-
52- - name : Setup NPM authentication
53- run : echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
54-
55- - name : Publish canary release
56- run : |
57- npm publish --tag canary --access public
58- env :
59- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
13+ - name : Checkout code
14+ uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0
17+
18+ - name : Setup Bun
19+ uses : oven-sh/setup-bun@v2
20+ with :
21+ bun-version : latest
22+
23+ - name : Install dependencies
24+ run : bun install --frozen-lockfile
25+
26+ - name : Run tests
27+ run : bun run test:ci
28+
29+ - name : Run linting
30+ run : bun run lint
31+
32+ - name : Build project
33+ run : bun run build
34+
35+ - name : Generate canary version
36+ id : version
37+ run : |
38+ COMMIT_SHA=$(git rev-parse --short HEAD)
39+ TIMESTAMP=$(date +%Y%m%d%H%M%S)
40+ CANARY_VERSION="0.0.1-canary.${TIMESTAMP}.${COMMIT_SHA}"
41+ echo "canary_version=${CANARY_VERSION}" >> $GITHUB_OUTPUT
42+ echo "Generated canary version: ${CANARY_VERSION}"
43+
44+ - name : Update package.json version
45+ run : |
46+ bun --bun -e "
47+ const pkg = require('./package.json');
48+ pkg.version = '${{ steps.version.outputs.canary_version }}';
49+ require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));
50+ "
51+
52+ - name : Setup NPM authentication
53+ run : echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
54+
55+ - name : Publish canary release
56+ run : |
57+ npm publish --tag canary --access public
58+ env :
59+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments