Last active
April 5, 2021 19:12
-
-
Save akshay-nm/4ee7f666bd72a4ba37ee87a4523972bd to your computer and use it in GitHub Desktop.
Publish your Node.js package using yarn to npm and gpr with codecoverage to codecov (Github workflow file)
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: Node.js Package | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
registry-url: 'https://registry.npmjs.org' | |
- run: yarn install --frozen-lockfile | |
coverage: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 12 | |
registry-url: https://registry.npmjs.org | |
- run: yarn install --frozen-lockfile | |
- run: yarn publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
publish-gpr: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 12 | |
registry-url: https://npm.pkg.github.com/ | |
- run: yarn install --frozen-lockfile | |
- run: yarn publish | |
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