Skip to content

Commit

Permalink
Don't create tags when versioning.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwilsonvu committed Sep 1, 2024
1 parent 1542eab commit 8c9a6c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
23 changes: 10 additions & 13 deletions scripts/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
);
});
});

0 comments on commit 8c9a6c1

Please sign in to comment.