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