Skip to content

Commit

Permalink
CI: test, build & publish npm package πŸ’š
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Jan 17, 2024
1 parent 416a270 commit 1fb1961
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build & publish to npm

on:
push:
branches:
- debug-ci # todo: remove
schedule:
# on day-of-month 17 at 20:00
- cron: '0 20 17 * *'

jobs:
test-build-publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16']

steps:
- name: checkout
uses: actions/checkout@v4
- name: setup Node v${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install

- run: npm run build
- run: npm test

- name: npm login
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: npm set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
- name: bump version
run: |
set -x
npm version --no-git-tag-version --force "$(npm exec -- semver@7 -i minor "$(npm info "$(jq -r .name package.json)" version)")"
- name: publish
run: npm publish

0 comments on commit 1fb1961

Please sign in to comment.