Skip to content

Commit 095b38b

Browse files
committed
chore: update publish and verify workflows to improve npm commands and add release drafting
1 parent 0f1febe commit 095b38b

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

.github/workflows/publish.yml

Lines changed: 13 additions & 6 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
@@ -36,16 +36,23 @@ jobs:
3636
cache: 'npm'
3737
registry-url: 'https://registry.npmjs.org'
3838
scope: '@workfront'
39-
- run: npm ci
39+
- run: npm ci --no-fund --no-audit
4040
- name: Bump package version
4141
run: |
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 }}
51-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
- name: Draft release
53+
run: |
54+
VERSION=$(node -p "require('./package.json').version")
55+
gh release create v$VERSION --generate-notes --draft --verify-tag --fail-on-no-commits
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
VERSION: ${{ inputs.next_version }}

.github/workflows/verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
cache: 'npm'
2121
registry-url: 'https://registry.npmjs.org'
2222
scope: '@workfront'
23-
- run: npm ci
23+
- run: npm ci --no-fund --no-audit
2424
- run: npm run build

0 commit comments

Comments
 (0)