Skip to content

Commit 935dde8

Browse files
committed
ci: Update release workflow to handle push and pull request events, add dry run step
1 parent 0ec8131 commit 935dde8

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

.github/workflows/release.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ on:
55
branches:
66
- main
77
- beta
8-
9-
permissions:
10-
contents: write # to be able to publish a GitHub release
11-
issues: write # to be able to comment on released issues
12-
pull-requests: write # to be able to comment on released pull requests
13-
id-token: write # to enable use of OIDC for npm provenance
8+
pull_request:
9+
branches:
10+
- main
11+
- beta
1412

1513
jobs:
1614
release:
1715
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write # to be able to publish a GitHub release
18+
issues: write # to be able to comment on released issues
19+
pull-requests: write # to be able to comment on released pull requests
20+
id-token: write # to enable use of OIDC for npm provenance
1821
steps:
1922
- name: Checkout code
2023
uses: actions/checkout@v4
@@ -26,7 +29,14 @@ jobs:
2629
run: npm run build
2730

2831
- name: Create Release
32+
if: github.event_name == 'push'
2933
env:
3034
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3135
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3236
run: npx semantic-release
37+
38+
- name: Dry Run Release
39+
if: github.event_name == 'pull_request'
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: npx semantic-release --dry-run

.releaserc

Whitespace-only changes.

package-lock.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release.config.cjs

+1-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@ module.exports = {
33
plugins: [
44
"@semantic-release/commit-analyzer",
55
"@semantic-release/release-notes-generator",
6-
[
7-
"@semantic-release/npm",
8-
{
9-
npmPublish: true,
10-
pkgRoot: "dist",
11-
},
12-
],
6+
"@semantic-release/npm",
137
[
148
"@semantic-release/git",
159
{

0 commit comments

Comments
 (0)