Skip to content

Commit 443fba3

Browse files
committed
chore: enhance publish workflow with version bump and draft release
1 parent 7fc005f commit 443fba3

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525
with:
26-
token: ${{ secrets.GITHUB_TOKEN }}
26+
ssh-key: ${{ secrets.DEPLOY_KEY }}
2727
- name: Check if on main branch
2828
run: |
2929
if [[ $GITHUB_REF != 'refs/heads/main' ]]; then
@@ -42,10 +42,17 @@ jobs:
4242
git config --global user.name 'github-actions[bot]'
4343
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
4444
echo "Bumping version as ${{ github.event.inputs.SEMVER_TYPE }}"
45-
npm version ${{ github.event.inputs.SEMVER_TYPE }}
46-
VERSION=$(node -p "require('./package.json').version")
45+
npm version --no-commit-hooks ${{ github.event.inputs.SEMVER_TYPE }}
4746
git push origin main --follow-tags
48-
- run: npm publish --provenance --access public
47+
- name: Publish to NPM
48+
run: npm publish --provenance --access public
4949
env:
5050
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
- name: Draft release
53+
run: |
54+
VERSION=$(node -p "require('./package.json').version")
55+
gh release create $VERSION --generate-notes --draft
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
VERSION: ${{ inputs.next_version }}

0 commit comments

Comments
 (0)