Npm directory update #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Npm directory update | |
on: | |
workflow_dispatch: | |
schedule: | |
# Once per month, on an offset date/time because apparently GHA has | |
# problems with spikes of scheduled jobs at midnight etc. | |
- cron: 30 13 15 * * | |
jobs: | |
publish: | |
name: Build, bump & publish to npm | |
runs-on: ubuntu-latest | |
container: httptoolkit/act-build-base:v3.0.0 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
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 '[email protected]' | |
npm version patch | |
git push && git push --tags | |
# Publish the release to npm: | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |