Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,58 @@ on:
jobs:
release-please:
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
release_created: ${{ steps.release.outputs.release_created }}
runs-on: ubuntu-latest
permissions:
id-token: write # Needed if using OIDC to get release secrets.
contents: write # Contents and pull-requests are for release-please to make releases.
pull-requests: write

steps:
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4
# Create any releases first, then create tags, and then optionally create any new PRs.
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
id: release
with:
token: ${{secrets.GITHUB_TOKEN}}
target-branch: main
skip-github-pull-request: true

# Need the repository content to be able to create and push a tag.
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.release_created == 'true' }}

- name: Create release tag
if: ${{ steps.release.outputs.release_created == 'true' }}
env:
TAG_NAME: ${{ steps.release.outputs.tag_name }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if gh api "repos/${{ github.repository }}/git/ref/tags/${TAG_NAME}" >/dev/null 2>&1; then
echo "Tag ${TAG_NAME} already exists, skipping creation."
else
echo "Creating tag ${TAG_NAME}."
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "${TAG_NAME}"
git push origin "${TAG_NAME}"
fi

- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
if: ${{ steps.release.outputs.release_created != 'true' }}
id: release-prs
with:
token: ${{secrets.GITHUB_TOKEN}}
target-branch: main
skip-github-release: true

ci:
needs: ['release-please']
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
if: ${{ needs.release-please.outputs.release_created == 'true' }}
uses: ./.github/workflows/ci.yml

publish:
needs: ['release-please', 'ci']
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
if: ${{ needs.release-please.outputs.release_created == 'true' }}
uses: ./.github/workflows/publish.yml
with:
dry_run: false
Loading