Skip to content

Commit b16011b

Browse files
authored
Merge pull request #2 from hey-api/fix/semantic-release
fix: add semantic release
2 parents e11c554 + e8986b2 commit b16011b

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,54 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- uses: actions/checkout@v5
19+
1920
- run: npm i -fg corepack && corepack enable
21+
2022
- uses: actions/setup-node@v4
2123
with:
2224
node-version: 20
2325
cache: "pnpm"
24-
- run: pnpm install
26+
27+
- name: Install dependencies
28+
run: pnpm install
29+
2530
- run: pnpm lint
2631
if: ${{ matrix.os != 'windows-latest' }}
27-
- run: pnpm build
32+
33+
- name: Prepare Package
34+
run: pnpm build
2835
if: ${{ matrix.os != 'windows-latest' }}
36+
2937
- run: pnpm test:types
3038
if: ${{ matrix.os != 'windows-latest' }}
39+
3140
- run: pnpm vitest --coverage
41+
3242
- uses: codecov/codecov-action@v5
43+
44+
release:
45+
name: Release
46+
if: github.ref == 'refs/heads/main'
47+
runs-on: ubuntu-latest
48+
timeout-minutes: 10
49+
needs:
50+
- ci
51+
steps:
52+
- uses: actions/checkout@v5
53+
54+
- uses: actions/setup-node@v4
55+
with:
56+
node-version: 20
57+
cache: "pnpm"
58+
59+
- name: Install dependencies
60+
run: pnpm install
61+
62+
- name: Prepare Package
63+
run: pnpm build
64+
65+
- name: Publish to NPM
66+
run: npx semantic-release
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,16 @@
7070
"optional": true
7171
}
7272
},
73+
"release": {
74+
"branches": [
75+
"main"
76+
],
77+
"plugins": [
78+
"@semantic-release/commit-analyzer",
79+
"@semantic-release/release-notes-generator",
80+
"@semantic-release/npm",
81+
"@semantic-release/github"
82+
]
83+
},
7384
"packageManager": "[email protected]"
7485
}

pnpm-workspace.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
onlyBuiltDependencies:
2+
- '@parcel/watcher'
3+
- esbuild

0 commit comments

Comments
 (0)