-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.6.0: Add
workflow_dispatch
to release action (#1436)
* Add `workflow_dispatch` to release action * Update release.yml * Update .github/workflows/release.yml Co-authored-by: chrysle <[email protected]> --------- Co-authored-by: chrysle <[email protected]>
- Loading branch information
Showing
1 changed file
with
13 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Version to release" | ||
required: true | ||
type: string | ||
pull_request_target: | ||
types: | ||
- closed | ||
|
@@ -15,6 +21,7 @@ jobs: | |
create-tag: | ||
name: Create the Git tag | ||
if: >- | ||
github.event_name == 'workflow_dispatch' || | ||
github.event.pull_request.merged == true | ||
&& contains(github.event.pull_request.labels.*.name, 'release-version') | ||
runs-on: ubuntu-latest | ||
|
@@ -26,10 +33,13 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- name: Extract version to be released | ||
id: get-version | ||
env: | ||
TITLE: ${{ github.event.pull_request.title }} | ||
run: | | ||
echo "version=${TITLE/: [[:alnum:]]*}" >> "$GITHUB_OUTPUT" | ||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | ||
echo "version=${{ github.event.inputs.version }}" >> "$GITHUB_OUTPUT" | ||
else | ||
TITLE=${{ github.event.pull_request.title }} | ||
echo "version=${TITLE/: [[:alnum:]]*}" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Bump version and push tag | ||
uses: mathieudutour/[email protected] | ||
with: | ||
|