-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert to push tag trigger for release creation (#218)
- Loading branch information
1 parent
758efe6
commit 34c1da0
Showing
2 changed files
with
61 additions
and
42 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Create Release Tag | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
git_ref: | ||
description: 'Git ref' | ||
type: string | ||
required: false | ||
default: 'main' | ||
semver: | ||
description: 'Semantic Version (defaults to 0.0.0-commit)' | ||
type: string | ||
required: false | ||
default: '' | ||
|
||
jobs: | ||
create-tag: | ||
name: Create Tag | ||
runs-on: windows-2022 | ||
timeout-minutes: 5 | ||
permissions: | ||
contents: | ||
write # Create tag and release | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.inputs.git_ref }} | ||
|
||
- name: Create Tag | ||
shell: pwsh | ||
run: | | ||
$SemVer = "${{ github.event.inputs.semver }}" | ||
if ($SemVer -eq "") { | ||
$ShortCommit = & git rev-parse --short=8 "${{ github.event.inputs.git_ref }}" | Out-String | ||
$SemVer = "0.0.0-$ShortCommit" | ||
} | ||
if (-not $SemVer -match "^v\d+\.\d+\.\d+(-\w+)?$") { | ||
throw "Unexpected SemVer format: $SemVer" | ||
} | ||
$Tag = "v$SemVer" | ||
& git tag $Tag | ||
& git push origin $Tag |
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