Skip to content
Merged
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
31 changes: 14 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
# 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@v1
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
uses: zckv/action-bumpr@v1

# Update corresponding major and minor tag.
# e.g. Update v1 and v1.2 when releasing v1.2.3
Expand All @@ -32,29 +32,26 @@ jobs:

# Get tag name.
- id: tag
uses: haya14busa/action-cond@v1
with:
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
if_true: ${{ github.ref }}
if_false: ${{ steps.bumpr.outputs.next_version }}
shell: bash
run: |
if [ "${{ startsWith(github.ref, 'refs/tags/') }}" = "true" ]; then
echo "value=${{ github.ref }}" >> "$GITHUB_OUTPUT"
else
echo "value=${{ steps.bumpr.outputs.next_version }}" >> "$GITHUB_OUTPUT"
fi

# Create release.
- uses: shogo82148/actions-create-release@v1
if: "steps.tag.outputs.value != ''"
- name: Release
uses: softprops/action-gh-release@v1
if: steps.tag.outputs.value != ''
with:
# This token is provided by Actions, you do not
# need to create your own token
github_token: ${{ secrets.PAT_TOKEN }}
tag_name: ${{ steps.tag.outputs.value }}
release_name: Release ${{ steps.tag.outputs.value }}
body: ${{ steps.bumpr.outputs.message }}
draft: false
prerelease: false
name: Release ${{ steps.tag.outputs.value }}

release-check:
if: github.event.action == 'labeled'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Post bumpr status comment
uses: haya14busa/action-bumpr@v1
uses: zckv/action-bumpr@v1