Skip to content

Commit cc3d818

Browse files
ci: tag-only prerelease to avoid protected branch push (#545)
1 parent 42982ba commit cc3d818

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

.github/workflows/release-please-prerelease.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ jobs:
3636
echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
3737
echo "skipped=false" >> "$GITHUB_OUTPUT"
3838
39-
- name: Commit and tag
39+
- name: Tag
4040
if: steps.bump.outputs.skipped != 'true'
4141
run: |
4242
git config user.name "github-actions[bot]"
4343
git config user.email "github-actions[bot]@users.noreply.github.com"
44-
git add VERSION.txt
45-
git commit -m "chore: release ${{ steps.bump.outputs.new_version }}"
4644
git tag "v${{ steps.bump.outputs.new_version }}"
47-
git push origin develop --follow-tags
45+
git push origin "v${{ steps.bump.outputs.new_version }}"
4846
4947
publish-windows:
5048
needs: bump-version

Scripts/bump-prerelease.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
2-
# Computes the next rc version from conventional commits since the last tag,
3-
# writes VERSION.txt, and prints the new version to stdout.
2+
# Computes the next rc version from conventional commits since the last tag
3+
# and prints it to stdout. Does not modify any files.
44
#
55
# Usage: bump-prerelease.sh
66
# Output: the new version string, e.g. 0.3.0-rc.2
@@ -68,5 +68,4 @@ fi
6868
ALPHA_N=$((ALPHA_N + 1))
6969
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}-rc.${ALPHA_N}"
7070

71-
printf '%s\n' "$NEW_VERSION" > "$VERSION_FILE"
7271
echo "$NEW_VERSION"

0 commit comments

Comments
 (0)