From 4ca06a921852e7d0bf15254cf1dc7ab4c59a200d Mon Sep 17 00:00:00 2001 From: venashial Date: Tue, 21 Jun 2022 21:25:22 -0700 Subject: [PATCH] Fix workflow NPM `publish` auth secret --- .github/workflows/ci.yml | 46 +++++++++++++++++++++++----------------- .npmrc | 5 ++++- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83691e31e..1f713b5e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,16 +6,18 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 with: submodules: recursive - - uses: pnpm/action-setup@v2.2.2 - with: - version: 7 - - uses: actions/setup-node@v3 + - name: Install Node.js + uses: actions/setup-node@v3 with: node-version: 16 cache: pnpm + - uses: pnpm/action-setup@v2.2.2 + with: + version: 7 - name: Install dependencies run: pnpm install --frozen-lockfile - name: Run build @@ -30,25 +32,29 @@ jobs: runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2.2.2 - with: - version: 7 - - uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Install Node.js + uses: actions/setup-node@v3 with: node-version: 16 cache: pnpm - - name: Install dependencies - run: pnpm install --frozen-lockfile - - name: Package - run: | - pnpm version patch --commit-hooks false --git-tag-version false - pnpm package - - name: Publish - run: pnpm publish --no-git-checks --tag alpha - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - uses: pnpm/action-setup@v2.2.2 + with: + version: 7 + - name: Bump version + run: pnpm version patch --commit-hooks false --git-tag-version false - uses: EndBug/add-and-commit@v9 with: message: 'Bump package version [skip ci]' default_author: github_actions + - name: Remove svelte.config.js # prevents `svelte-kit sync` from running + run: rm svelte.config.js + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Package + run: pnpm package + - name: Publish + run: pnpm publish --no-git-checks --tag alpha + env: + NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.npmrc b/.npmrc index b6f27f135..6d3823c8b 100644 --- a/.npmrc +++ b/.npmrc @@ -1 +1,4 @@ -engine-strict=true +engine-strict = true + +# For GitHub workflow +//registry.npmjs.org/:_authToken = ${NPM_AUTH_TOKEN}