Skip to content

Commit

Permalink
publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bmschmidt committed Jul 5, 2024
1 parent 492f4c6 commit 16cf8a4
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,34 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Configure Git
run: |
git config user.name github-actions
git config user.email [email protected]
- run: npm ci
- name: Set version to release tag
run: npm version ${{ github.event.release.tag_name }} --no-git-tag-version
- name: Update version and commit
run: |
npm version ${{ github.event.release.tag_name }} --no-git-tag-version
git add package.json package-lock.json
git commit -m "Bump version to ${{ github.event.release.tag_name }}"
git push
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Update release notes
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: context.payload.release.id,
body: context.payload.release.body + '\n\nThis release has been published to npm.'
})

0 comments on commit 16cf8a4

Please sign in to comment.