chore(deps): update haya14busa/action-update-semver action to v1.5.0 #116
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*.*.*" | |
pull_request: | |
types: | |
- labeled | |
jobs: | |
release: | |
if: github.event.action != 'labeled' | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # Enable OIDC | |
contents: write # Tag updates | |
pull-requests: write # Post comment | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
# Configure signed tags | |
# https://www.chainguard.dev/unchained/keyless-git-commit-signing-with-gitsign-and-github-actions | |
# https://github.com/chainguard-dev/actions/commits/main/setup-gitsign | |
- uses: chainguard-dev/actions/setup-gitsign@141bf225e9c19c34304ee9d06e9be9c44a6d8765 # main branch as of 2024-12-27 | |
- run: git config --global tag.gpgSign true | |
# Bump version on merging Pull Requests with specific labels. | |
# (bump:major,bump:minor,bump:patch) | |
- id: bumpr | |
if: "!startsWith(github.ref, 'refs/tags/')" | |
uses: haya14busa/action-bumpr@faf6f474bcb6174125cfc569f0b2e24cbf03d496 # v1.11.4 | |
# Update corresponding major and minor tag. | |
# e.g. Update v1 and v1.2 when releasing v1.2.3 | |
- uses: haya14busa/action-update-semver@3f49a54b677d969c819c1c6ebea626a54dafe032 # v1.5.0 | |
if: "!steps.bumpr.outputs.skip" | |
with: | |
tag: ${{ steps.bumpr.outputs.next_version }} | |
# Get tag name. | |
- id: tag | |
uses: haya14busa/action-cond@94f77f7a80cd666cb3155084e428254fea4281fd # v1.2.1 | |
with: | |
cond: "${{ startsWith(github.ref, 'refs/tags/') }}" | |
if_true: ${{ github.ref }} | |
if_false: ${{ steps.bumpr.outputs.next_version }} | |
# Create release | |
- if: "steps.tag.outputs.value != ''" | |
env: | |
TAG_NAME: ${{ steps.tag.outputs.value }} | |
BODY: ${{ steps.bumpr.outputs.message }} | |
# This token is provided by Actions, you do not need to create your own token | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create "${TAG_NAME}" -t "Release ${TAG_NAME}" --notes "${BODY}" | |
release-check: | |
if: github.event.action == 'labeled' | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Post bumpr status comment | |
uses: haya14busa/action-bumpr@faf6f474bcb6174125cfc569f0b2e24cbf03d496 # v1.11.4 |