From fac98948a98dc04b3cbaae74b8a6e5bf56ebe0c1 Mon Sep 17 00:00:00 2001 From: ZuperZee Date: Fri, 6 Nov 2020 12:53:20 +0100 Subject: [PATCH] ci(publish): separate npm and gpr into two jobs Makes it easier to rerun one job instead of npm and gpr together. Also doesn't stop if one fails. --- .github/workflows/publish.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 588cdb1..2e06dd1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,39 +1,37 @@ -# This workflow will do a clean install of node dependencies and publishes the package -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages -name: Publish package +name: Node.js Package on: release: types: [created] jobs: - build: + publish-npm: runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - # Setup .npmrc file to publish to npm + - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 14.x - registry-url: "https://registry.npmjs.org" + registry-url: https://registry.npmjs.org/ scope: "@gapit" - run: npm ci - run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - # Setup .npmrc file to publish to GitHub Packages + publish-gpr: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - registry-url: "https://npm.pkg.github.com" + registry-url: https://npm.pkg.github.com/ scope: "@gapitio" - # Publish to GitHub Packages + - run: npm ci - run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}