Skip to content

Commit

Permalink
ci(publish): automatically increase package version and create releas…
Browse files Browse the repository at this point in the history
…e notes + publish in npm with provenance (#13)
  • Loading branch information
JavierCane authored Jan 15, 2025
1 parent adc20fc commit 17b1a98
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,31 @@ on:
push:
branches:
- 'main'

permissions:
# Needed by googleapis/release-please-action@v4
contents: write
pull-requests: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: 🍄 Bump package version, create GitHub release and changelog
uses: googleapis/release-please-action@v4
id: release
with:
node-version: 12
- run: npm install
- run: npm test
- uses: JS-DevTools/npm-publish@v1
release-type: node
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v4
if: ${{ steps.release.outputs.release_created }}
with:
token: ${{ secrets.NPM_TOKEN }}
node-version: lts/*
registry-url: https://registry.npmjs.org
- name: 🚀 Publish to npm
if: ${{ steps.release.outputs.release_created }}
run: |
npm install
npm run build --if-present
npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 17b1a98

Please sign in to comment.