npm publish #22
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 publish | |
on: | |
release: | |
types: [created] | |
schedule: | |
- cron: '0 0 * * 0' # weekly, every Sunday at 00:00 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- run: npm ci | |
# - run: npm test | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- run: npm ci | |
- run: KEY=${{secrets.KEY}} npm run build | |
- uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{secrets.NPMJS_TOKEN}} | |
- run: rm .npmrc && npm config set git-tag-version=false && npm version "${{ github.event.release.tag_name }}" && npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPMJS_TOKEN}} |