From c5e5747fbbb4330fb38ec8fbf72518fdc78dd578 Mon Sep 17 00:00:00 2001 From: Sergey Astapov Date: Tue, 3 Sep 2024 22:36:58 -0400 Subject: [PATCH] Fix publish workflow --- .github/workflows/publish.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d2fbc16fa..dbd07687f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,13 +1,17 @@ name: CI Publish on: - push: - tags: - - '*' +# push: +# tags: +# - '*' + pull_request: + paths: + - '.github/workflows/publish.yml' jobs: publish: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 @@ -17,15 +21,20 @@ jobs: with: node-version: 18.x cache: pnpm - registry-url: https://registry.npmjs.org/ + # This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable + registry-url: 'https://registry.npmjs.org' - name: Install Dependencies - run: pnpm install + run: pnpm install --frozen-lockfile + + # We need a workspace aware version of npm because our addon is in a subdir but our .npmrc is in the root + - name: npm8 + run: npm install -g npm@8 - name: Copy .md files run: cp CHANGELOG.md LICENSE.md README.md packages/ember-cli-mirage/ - - run: npm publish + - name: npm publish + run: npm publish --tag=latest --verbose --workspace=ember-cli-mirage env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - working-directory: packages/ember-cli-mirage