forked from GitTools/GitVersion
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitTools#3727 - Update GitHub workflows and add Winget release
This commit revamps multiple GitHub action workflows to improve the release process. It adds the capability to publish releases to Winget. Also, it enhances workflows' structure for handling releases through repository dispatches. Changes bring a more organized, efficient approach for publishing to different platforms.
- Loading branch information
Showing
6 changed files
with
95 additions
and
18 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
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,17 +1,24 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: [published] | ||
types: [ published ] | ||
|
||
jobs: | ||
release: | ||
name: Trigger Build flow | ||
name: Trigger ci flow | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Get version | ||
id: get-version | ||
shell: pwsh | ||
run: | | ||
# Finding the version from release tag | ||
$VERSION="${{ github.ref }}".Replace("refs/tags/", "") | ||
"version=$VERSION" >> $env:GITHUB_OUTPUT | ||
- uses: peter-evans/repository-dispatch@v2 | ||
with: | ||
token: ${{ secrets.RELEASE_GITHUB_TOKEN }} | ||
repository: ${{ github.repository }} | ||
event-type: release | ||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' | ||
event-type: ci-release | ||
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "tag": "${{ steps.get-version.outputs.version }}"}' |
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,40 @@ | ||
name: Publish to Winget | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag-name: | ||
description: 'The git tag name to bump the formula to' | ||
required: true | ||
repository_dispatch: | ||
types: [ publish-release ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
homebrew: | ||
permissions: | ||
contents: none | ||
name: Bump winget manifest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get version | ||
id: get-version | ||
shell: pwsh | ||
run: | | ||
$version = "${{ github.event.client_payload.tag }}" | ||
if ($version -eq "") { | ||
$version = "${{ github.event.inputs.tag-name }}" | ||
} | ||
$url = "https://github.com/GitTools/GitVersion/releases/download/{0}/gitversion-win-{1}-{0}.zip" | ||
$urls = @(($url -f $version, "x64"), ($url -f $version, "arm64")) -Join "," | ||
$run_args = "update --id GitTools.GitVersion --version $version --urls $urls --token ${{ secrets.RELEASE_GITHUB_TOKEN }} --submit" | ||
"version=$version" >> $env:GITHUB_OUTPUT | ||
"run_args=$run_args" >> $env:GITHUB_OUTPUT | ||
- uses: michidk/run-komac@v1 | ||
with: | ||
args: '${{ steps.get-version.outputs.run_args }}' |
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