From 8c9a6c1651269cf93d95c215b891ec996936a5b5 Mon Sep 17 00:00:00 2001 From: Josh Wilson Date: Sat, 31 Aug 2024 21:24:56 -0400 Subject: [PATCH] Don't create tags when versioning. --- .github/workflows/version.yml | 3 +-- scripts/version.js | 23 ++++++++++------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index 1fa4382..8bcd1e0 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -11,7 +11,7 @@ jobs: version: name: Version runs-on: ubuntu-latest - if: github.ref_name == 'main' + if: github.ref == 'refs/heads/main' steps: - name: Checkout uses: actions/checkout@v4 @@ -35,7 +35,6 @@ jobs: git config user.name github-actions[bot] git config user.email github-actions[bot]@users.noreply.github.com pnpm run version ${{ inputs.version }} - git push origin --tags --force - name: Create PR with new versions uses: peter-evans/create-pull-request@v6 diff --git a/scripts/version.js b/scripts/version.js index 2a9af5f..4be984f 100644 --- a/scripts/version.js +++ b/scripts/version.js @@ -34,18 +34,15 @@ await Promise.all([ ), ]); await new Promise((resolve, reject) => { - // it's not ideal to create and push a tag at the time the PR is created, but once the PR is - // merged main should contain the tag as if it were created there. - exec( - `git commit --all --message="v${newVersion}" && git tag "v${newVersion}"`, - (error, stdout, stderr) => { - if (error) { - reject(error); - } else { - console.log(stdout); - console.log(stderr); - resolve(stdout); - } + // Don't create a tag. It's better to wait until this PR is merged, and a tag can be created from + // the GitHub UI (the whole point of versioning + publishing from GitHub). + exec(`git commit --all --message="v${newVersion}"`, (error, stdout, stderr) => { + if (error) { + reject(error); + } else { + console.log(stdout); + console.log(stderr); + resolve(stdout); } - ); + }); });