Skip to content

Commit 0ad220a

Browse files
Update actions file (again)
1 parent 85a57cc commit 0ad220a

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ on:
77
pull_request:
88
branches: [ main ]
99
workflow_dispatch:
10+
inputs:
11+
release_tag:
12+
description: 'Tag to use for the release (e.g. v1.0.0)'
13+
required: false
14+
release_name:
15+
description: 'Release title (optional)'
16+
required: false
17+
release_body:
18+
description: 'Release notes (optional)'
19+
required: false
20+
draft:
21+
description: 'Create release as draft (true/false)'
22+
required: false
23+
default: 'false'
24+
prerelease:
25+
description: 'Mark as prerelease (true/false)'
26+
required: false
27+
default: 'false'
1028

1129
jobs:
1230
build:
@@ -67,7 +85,7 @@ jobs:
6785
permissions:
6886
contents: write
6987
needs: build
70-
if: startsWith(github.ref, 'refs/tags/')
88+
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '')
7189
steps:
7290
- name: Download Windows artifact
7391
uses: actions/download-artifact@v4
@@ -87,7 +105,11 @@ jobs:
87105
- name: Create GitHub Release and upload assets
88106
uses: ncipollo/release-action@v1
89107
with:
90-
tag: ${{ github.ref_name }}
108+
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag || github.ref_name }}
109+
name: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_name || github.ref_name }}
110+
body: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_body || 'Release created by CI' }}
111+
draft: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.draft || 'false' }}
112+
prerelease: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.prerelease || 'false' }}
91113
files: |
92114
artifacts/windows/*.exe
93115
artifacts/macos/*.dmg

0 commit comments

Comments
 (0)