-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
g1ibby
committed
Dec 16, 2024
1 parent
5e56a4b
commit a925517
Showing
3 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
name: Create Release | ||
on: | ||
# Manual trigger with version choice | ||
workflow_dispatch: | ||
inputs: | ||
version_type: | ||
description: 'Version type (major/minor/patch)' | ||
required: true | ||
default: 'patch' | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
# Automatic trigger on push to main | ||
push: | ||
branches: [ "main" ] | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
- '.gitignore' | ||
|
@@ -23,14 +38,20 @@ jobs: | |
id: previoustag | ||
uses: "WyriHaximus/github-action-get-previous-tag@v1" | ||
continue-on-error: true | ||
|
||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
default_bump: patch | ||
release_branches: main | ||
# Use manual input if workflow_dispatch, otherwise determine from commit messages | ||
default_bump: ${{ github.event.inputs.version_type || 'patch' }} | ||
# Configure commit messages that trigger version bumps | ||
major_string: "BREAKING CHANGE:" | ||
minor_string: "feat:" | ||
patch_string: "fix:" | ||
# Optional: prefix for tag | ||
tag_prefix: "v" | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
|