From 4bb377a7540f4774edb75643d9694c21338de3a2 Mon Sep 17 00:00:00 2001 From: Keiichiro Amemiya Date: Fri, 3 Jan 2025 21:08:19 +0100 Subject: [PATCH] fix: release CI bug --- .github/workflows/ci.yml | 19 ------------------- .github/workflows/release.yml | 11 +++++++++-- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9e80c1..5b221d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,22 +30,3 @@ jobs: - uses: codecov/codecov-action@v3 if: matrix.node-version == '22' - run: npm run build - - canary-publish: - runs-on: ubuntu-latest - needs: test - if: github.event_name == 'push' && github.ref_name == 'main' - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: "22" - registry-url: "https://registry.npmjs.org" - cache: npm - - run: npm ci - - run: npm run build - - run: | - npm version 0.0.0-canary.${{ github.sha }} --no-git-tag-version - npm publish --tag canary - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d60aa2..2ac9c74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,6 @@ jobs: publish: runs-on: ubuntu-latest needs: release-please - if: ${{ needs.release-please.outputs.release_created }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -35,7 +34,15 @@ jobs: cache: npm - run: npm ci - run: npm run build - - name: Publish to npm + + - if: ${{ needs.release-please.outputs.release_created }} run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - if: ${{ !needs.release-please.outputs.release_created }} + run: | + npm version 0.0.0-canary.${{ github.sha }} --no-git-tag-version + npm publish --tag canary + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}