Skip to content

Commit dc2c153

Browse files
committed
chore(release): Enable semantic-release for non-canary releases
Signed-off-by: Steve Dodier-Lazaro <sidnioulz@gmail.com>
1 parent 950ebfc commit dc2c153

4 files changed

Lines changed: 1439 additions & 167 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
name: Release
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
pull-requests: write
13+
id-token: write
414

515
jobs:
616
release:
717
runs-on: ubuntu-latest
8-
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
18+
if: |
19+
(github.event_name == 'push' && !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')) ||
20+
(github.event_name == 'pull_request')
921
strategy:
1022
matrix:
1123
node-version: [22]
@@ -31,9 +43,16 @@ jobs:
3143
- name: Audit dependencies
3244
run: pnpm audit
3345

34-
- name: Create Release
46+
- name: Create production release
47+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
3548
env:
3649
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3750
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38-
run: |
39-
pnpm release
51+
run: pnpm release
52+
53+
- name: Create canary release
54+
if: github.event_name == 'pull_request'
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
58+
run: pnpm release:canary

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
"prebuild": "pnpm clean",
8787
"prepack:local": "pnpm build",
8888
"prepare": "husky",
89-
"release": "npm run build && auto shipit",
89+
"release": "pnpm build && pnpm semantic-release",
90+
"release:canary": "pnpm build && auto canary",
9091
"start": "run-p build:watch 'storybook'",
9192
"storybook": "storybook dev -p 6006",
9293
"test": "echo \"Error: no test specified\" && exit 1"
@@ -124,6 +125,7 @@
124125
"prompts": "^2.4.2",
125126
"prop-types": "^15.8.1",
126127
"rimraf": "^6.0.1",
128+
"semantic-release": "^24.2.5",
127129
"storybook": "next",
128130
"tsup": "^8.5.0",
129131
"typescript": "^5.8.3",
@@ -142,10 +144,10 @@
142144
"vue": "^3.4.31"
143145
},
144146
"resolutions": {
145-
"@octokit/core": "^5.0.0",
146-
"@octokit/request-error": "^5.1.1",
147-
"@octokit/request": "^8.4.1",
148-
"@octokit/plugin-paginate-rest": "^9.2.2"
147+
"@octokit/core": "^7",
148+
"@octokit/request-error": "^7",
149+
"@octokit/request": "^10",
150+
"@octokit/plugin-paginate-rest": "^13"
149151
},
150152
"publishConfig": {
151153
"access": "public"

0 commit comments

Comments
 (0)