Skip to content

Commit d18eddd

Browse files
committed
feat: add dry-run option to release workflow
1 parent 0c04e52 commit d18eddd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
- patch
1313
- minor
1414
- major
15+
dry-run:
16+
description: 'Dry run (test without publishing)'
17+
required: false
18+
type: boolean
19+
default: false
1520

1621
permissions:
1722
contents: write
@@ -75,6 +80,7 @@ jobs:
7580
fi
7681
7782
- name: Commit, tag & push
83+
if: inputs.dry-run == false
7884
run: |
7985
NEW_VERSION=${{ steps.bump.outputs.new_version }}
8086
git add -A
@@ -87,9 +93,15 @@ jobs:
8793
git push origin main --follow-tags
8894
8995
- name: Publish to npm
96+
if: inputs.dry-run == false
9097
run: npm publish --provenance --access public
9198

99+
- name: Publish to npm (dry run)
100+
if: inputs.dry-run == true
101+
run: npm publish --provenance --access public --dry-run
102+
92103
- name: Create GitHub Release
104+
if: inputs.dry-run == false
93105
uses: softprops/action-gh-release@v2
94106
with:
95107
tag_name: v${{ steps.bump.outputs.new_version }}

0 commit comments

Comments
 (0)