From f54923eba82118e0f52fff307693f7c8f18d4c8a Mon Sep 17 00:00:00 2001 From: Evan Plaice Date: Thu, 26 Mar 2020 17:04:42 -0600 Subject: [PATCH] Update CD --- .github/workflows/release.yml | 50 ++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8409a7b..0af45df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,27 +6,45 @@ on: - 'v*' jobs: - publish: + check: runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + - name: Setup + uses: actions/setup-node@v1 + with: + node-version: 13.2 + - name: Cache + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.OS }}-npm-cache- + - name: Verify + run: | + npm ci + npm run preversion + npm: + runs-on: ubuntu-latest + needs: check steps: - name: Checkout uses: actions/checkout@master - - name: Setup - uses: actions/setup-node@v1 - with: - version: 13.2 - - name: Cache - uses: actions/cache@v1 - with: - path: node_modules - key: ${{ runner.OS }}-npm-cache-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.OS }}-npm-cache- - - name: Verify - run: | - npm ci - npm run preversion - name: Publish run: | echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc npm publish --access public + gh: + runs-on: ubuntu-latest + needs: check + steps: + - name: Checkout + uses: actions/checkout@master + - name: Publish + run: | + echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc + ORG="$(echo '${{ github.repository }}' | cut -d'/' -f1)" + echo "registry=https://npm.pkg.github.com/$ORG" > .npmrc + npm publish \ No newline at end of file