From 4c87dd49c445327ffa8b7d04155489058fe8f596 Mon Sep 17 00:00:00 2001 From: Puria Nafisi Azizi Date: Tue, 3 Dec 2024 06:31:47 +0100 Subject: [PATCH] feat: calculate the version prior build with exec --- .github/workflows/deploy.yml | 9 ++++----- .releaserc | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 768d4d2..665c364 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,11 +37,10 @@ jobs: node-version: latest - run: bun install - run: bun add -g semantic-release - - run: bun add -D @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/git @semantic-release/github - - name: Calculate release version - run: | - VERSION=$(npx semantic-release --dry-run | grep -Po '(?<=The next release version is ).*') - echo "$VERSION" > VERSION + - run: bun add -D @semantic-release/exec @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/git @semantic-release/github + - run: npx semantic-release --no-ci --dry-run + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: bun run build - run: cp dist/index.html pqspread.html - uses: actions/upload-pages-artifact@v3 diff --git a/.releaserc b/.releaserc index eceab80..efbde01 100644 --- a/.releaserc +++ b/.releaserc @@ -7,6 +7,12 @@ "repositoryUrl": "git@github.com:forkbombeu/pqspread.git", "plugins": [ "@semantic-release/commit-analyzer", + [ + "@semantic-release/exec", + { + "verifyReleaseCmd": "echo ${nextRelease.version} > VERSION" + } + ], "@semantic-release/release-notes-generator", "@semantic-release/changelog", [