File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ push :
5+ branches : [main]
6+
7+ permissions :
8+ contents : write
9+
10+ jobs :
11+ publish :
12+ runs-on : ubuntu-latest
13+ # Skip automated version bump commits (pushed by GITHUB_TOKEN, which
14+ # doesn't trigger workflows anyway — this is defense-in-depth)
15+ if : " !contains(github.event.head_commit.message, '[release]')"
16+
17+ steps :
18+ - uses : actions/checkout@v4
19+
20+ - uses : oven-sh/setup-bun@v2
21+
22+ - name : Install dependencies
23+ run : |
24+ bun install
25+ cd src/client && bun install
26+
27+ - name : Build client
28+ run : cd src/client && bun run build
29+
30+ - name : Bump version
31+ id : version
32+ run : |
33+ npm version patch --no-git-tag-version
34+ echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"
35+
36+ - name : Publish to npm
37+ run : |
38+ echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
39+ bun publish --access public
40+ env :
41+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
42+
43+ - name : Commit version bump
44+ run : |
45+ git config user.name "github-actions[bot]"
46+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
47+ git add package.json
48+ git commit -m "v${{ steps.version.outputs.version }} [release]"
49+ git tag "v${{ steps.version.outputs.version }}"
50+ git push
51+ git push --tags
You can’t perform that action at this time.
0 commit comments