Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gaboelnuevo/6f9fcbc7f6a52ba56ca8b5aaaeb8ca53 to your computer and use it in GitHub Desktop.
Save gaboelnuevo/6f9fcbc7f6a52ba56ca8b5aaaeb8ca53 to your computer and use it in GitHub Desktop.
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