Skip to content

Commit 05369cc

Browse files
committed
ci: split release-please into independent release and PR creation steps
1 parent 013f4d0 commit 05369cc

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

.github/workflows/release-please.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,37 @@ jobs:
1717
release-created: ${{ steps.release.outputs.release_created }}
1818

1919
steps:
20+
# Create any releases first, then create tags, and then optionally create any new PRs.
2021
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
2122
id: release
23+
with:
24+
skip-github-pull-request: true
25+
26+
# Need the repository content to be able to create and push a tag.
27+
- uses: actions/checkout@v4
28+
if: ${{ steps.release.outputs.release_created == 'true' }}
29+
30+
- name: Create release tag
31+
if: ${{ steps.release.outputs.release_created == 'true' }}
32+
env:
33+
TAG_NAME: ${{ steps.release.outputs.tag_name }}
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
run: |
36+
if gh api "repos/${{ github.repository }}/git/ref/tags/${TAG_NAME}" >/dev/null 2>&1; then
37+
echo "Tag ${TAG_NAME} already exists, skipping creation."
38+
else
39+
echo "Creating tag ${TAG_NAME}."
40+
git config user.name "github-actions[bot]"
41+
git config user.email "github-actions[bot]@users.noreply.github.com"
42+
git tag "${TAG_NAME}"
43+
git push origin "${TAG_NAME}"
44+
fi
45+
46+
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
47+
if: ${{ steps.release.outputs.release_created != 'true' }}
48+
id: release-prs
49+
with:
50+
skip-github-release: true
2251

2352
build-ruby-gem:
2453
needs: ["release-package"]

0 commit comments

Comments
 (0)