Last active
May 14, 2021 10:04
-
-
Save TomK/13bec181a7a4011bac868491fe546ab1 to your computer and use it in GitHub Desktop.
This workflow will tag a release on github when the package.json version changes on master, and publish package to npm and github
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
# This workflow will tag a release on github when the package.json version changes on master, and publish package to npm and github | |
name: Tag Release | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Release | |
id: release | |
uses: justincy/[email protected] | |
- uses: actions/setup-node@v2 | |
if: steps.release.outputs.released == 'true' | |
with: | |
registry-url: https://registry.npmjs.org/ | |
- run: npm publish | |
if: steps.release.outputs.released == 'true' | |
continue-on-error: true | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- uses: actions/setup-node@v2 | |
if: steps.release.outputs.released == 'true' | |
with: | |
registry-url: https://npm.pkg.github.com/ | |
- run: npm publish | |
if: steps.release.outputs.released == 'true' | |
continue-on-error: true | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment