Update release.yml

This commit is contained in:
Alvin-Zilverstand committed 2026-09-10 15:22:11 +02:00
1 parent 532ab0234f
commit b47e6b9a03
1 file changed
+37 -2
+37 -2
View File
@@ -6,12 +6,23 @@ on:
- master
- main
tags:
- "v*"
- "*"
pull_request:
branches:
- master
- main
workflow_dispatch:
inputs:
publish_release:
description: "Publish the installers to a GitHub Release"
required: true
default: true
type: boolean
release_tag:
description: "Release tag to create or update when publishing manually, for example v0.1.0"
required: false
default: "v0.1.0"
type: string
permissions:
contents: write
@@ -76,6 +87,29 @@ jobs:
- name: Build Windows desktop installers
run: pnpm run desktop:build
- name: Resolve release publishing
id: release
env:
DISPATCH_PUBLISH_RELEASE: ${{ inputs.publish_release }}
DISPATCH_RELEASE_TAG: ${{ inputs.release_tag }}
run: |
$publish = "false"
$tag = ""
if ($env:GITHUB_REF -like "refs/tags/*") {
$publish = "true"
$tag = $env:GITHUB_REF_NAME
} elseif ($env:GITHUB_EVENT_NAME -eq "workflow_dispatch" -and $env:DISPATCH_PUBLISH_RELEASE -eq "true") {
$publish = "true"
$tag = $env:DISPATCH_RELEASE_TAG.Trim()
if ([string]::IsNullOrWhiteSpace($tag)) {
throw "release_tag is required when publish_release is true."
}
}
"publish=$publish" >> $env:GITHUB_OUTPUT
"tag=$tag" >> $env:GITHUB_OUTPUT
- name: Upload installer artifacts
uses: actions/upload-artifact@v4
with:
@@ -86,9 +120,10 @@ jobs:
src-tauri/target/release/bundle/nsis/*.exe
- name: Publish GitHub release assets
if: startsWith(github.ref, 'refs/tags/v')
if: steps.release.outputs.publish == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.release.outputs.tag }}
files: |
src-tauri/target/release/bundle/msi/*.msi
src-tauri/target/release/bundle/nsis/*.exe