Skip to content

Commit

Permalink
Set up a GHA npm publish job
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Mar 21, 2023
1 parent 588dd6b commit 566e8a6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Npm directory update
on:
workflow_dispatch:
jobs:
publish:
name: Build, bump & publish to npm
runs-on: ubuntu-latest
container: httptoolkit/act-build-base:v3.0.0
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- run: npm ci

# Check that the tests and overall build all still pass:
- run: npm test
- run: npm run build

# Create the new release:
- name: Bump version & push
run: |
git config --global user.name 'Automated publish'
git config --global user.email 'pimterry@users.noreply.github.com'
npm version patch
git push && git push --tags
# Publish the release to npm:
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

0 comments on commit 566e8a6

Please sign in to comment.