Skip to content

Commit 299847d

Browse files
committed
ci: split release-please into independent release and PR creation steps
1 parent 64dd44d commit 299847d

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

.github/workflows/release-please.yml

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

2150
release-sdk:
2251
needs: ['release-please']

0 commit comments

Comments
 (0)