Created
May 20, 2022 21:25
-
-
Save gaboelnuevo/6f9fcbc7f6a52ba56ca8b5aaaeb8ca53 to your computer and use it in GitHub Desktop.
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: AutoPublish Package - GPR | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Setup .npmrc file to publish to GitHub Packages | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '12.x' | |
registry-url: 'https://npm.pkg.github.com' | |
# Defaults to the user or organization that owns the workflow file | |
scope: '@myorg' | |
- run: npm install | |
- run: git config --global user.name "my ci user" | |
- run: git config --global user.email "[email protected]" | |
- run: npm run release | |
# upgrade npm version in package.json to the tag used in the release. | |
- run: npm version ${{ github.event.release.tag_name }} | |
- run: npm run build | |
- run: git push --follow-tags origin master && npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.MY_TOKEN }} | |
- run: git push | |
env: | |
# The secret is passed automatically. Nothing to configure. | |
github-token: ${{ secrets.MY_TOKEN }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment