Skip to content

Commit f0cf956

Browse files
committed
chore: use semantic release
1 parent 4ac7fe6 commit f0cf956

File tree

5 files changed

+9193
-3395
lines changed

5 files changed

+9193
-3395
lines changed

.github/workflows/build.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
name: Build
22
on: [push]
33

4+
env:
5+
CI_BUILD_NUM: ${{ github.run_id }}
6+
CI_BRANCH: ${{ github.ref_name }}
7+
8+
permissions:
9+
issues: read # needed by semantic-release
10+
pull-requests: write # needed by semantic-release
11+
412
jobs:
513
test:
614
name: Test
@@ -30,6 +38,10 @@ jobs:
3038
with:
3139
token: ${{ secrets.CODECOV_TOKEN }}
3240
files: coverage/lcov.info
41+
- name: Semantic Release (Dry Run)
42+
run: npm run semantic-release-dry
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3345

3446
release:
3547
name: Deploy
@@ -38,8 +50,10 @@ jobs:
3850
if: github.ref == 'refs/heads/main'
3951
steps:
4052
- uses: actions/checkout@v5
41-
- name: Deploy
42-
uses: cloudflare/wrangler-action@v3
43-
with:
53+
- run: npm install
54+
- name: Semantic Release
55+
run: npm run semantic-release
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4458
apiToken: ${{secrets.CLOUDFLARE_API_TOKEN}}
4559
accountId: ${{secrets.CLOUDFLARE_ACCOUNT_ID}}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
on:
2+
push:
3+
branches-ignore:
4+
- 'main'
5+
6+
jobs:
7+
ci_trigger:
8+
runs-on: ubuntu-latest
9+
name: Comment Semantic Release Status
10+
steps:
11+
- name: Comment
12+
id: comment
13+
uses: adobe-rnd/github-semantic-release-comment-action@main
14+
with:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.releaserc.cjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = {
2+
plugins: [
3+
'@semantic-release/commit-analyzer',
4+
'@semantic-release/release-notes-generator',
5+
['@semantic-release/changelog', {
6+
changelogFile: 'CHANGELOG.md',
7+
}],
8+
["@semantic-release/npm", {
9+
npmPublish: false,
10+
}],
11+
['@semantic-release/exec', {
12+
prepareCmd: 'npm run deploy:ci && npm run test-postdeploy',
13+
publishCmd: 'npm run deploy:prod',
14+
successCmd: 'echo "${nextRelease.version}" > released.txt',
15+
}],
16+
['@semantic-release/git', {
17+
assets: ['package.json', 'package-lock.json', 'CHANGELOG.md'],
18+
message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
19+
}],
20+
'@semantic-release/github'
21+
],
22+
branches: ['main'],
23+
};

0 commit comments

Comments
 (0)