Skip to content

Commit 6aafffb

Browse files
authored
CI: upload build artifacts to GitHub Releases
Add workflow_dispatch tag input and upload built installers + updater metadata (.yml/.blockmap) directly to the matching GitHub Release.
1 parent db2936a commit 6aafffb

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
tags:
66
- 'v*'
77
workflow_dispatch:
8+
inputs:
9+
release_tag:
10+
description: 'Release tag to build/upload (e.g. v1.4.8)'
11+
required: true
12+
type: string
813

914
permissions:
1015
contents: write
@@ -14,6 +19,8 @@ jobs:
1419
runs-on: windows-latest
1520
steps:
1621
- uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref }}
1724

1825
- name: Setup Node.js
1926
uses: actions/setup-node@v4
@@ -28,6 +35,18 @@ jobs:
2835
run: npm run build:win
2936
env:
3037
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Upload Windows assets to GitHub Release
40+
uses: softprops/action-gh-release@v2
41+
with:
42+
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name }}
43+
files: |
44+
dist/**/*.exe
45+
dist/**/*.msi
46+
dist/**/*.zip
47+
dist/**/*.yml
48+
dist/**/*.blockmap
49+
fail_on_unmatched_files: false
3150

3251
- name: Upload Windows artifacts
3352
uses: actions/upload-artifact@v4
@@ -37,11 +56,15 @@ jobs:
3756
dist/**/*.exe
3857
dist/**/*.msi
3958
dist/**/*.zip
59+
dist/**/*.yml
60+
dist/**/*.blockmap
4061
4162
build-macos:
4263
runs-on: macos-latest
4364
steps:
4465
- uses: actions/checkout@v4
66+
with:
67+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref }}
4568

4669
- name: Setup Node.js
4770
uses: actions/setup-node@v4
@@ -57,6 +80,17 @@ jobs:
5780
env:
5881
CSC_IDENTITY_AUTO_DISCOVERY: false
5982
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
84+
- name: Upload macOS assets to GitHub Release
85+
uses: softprops/action-gh-release@v2
86+
with:
87+
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name }}
88+
files: |
89+
dist/**/*.dmg
90+
dist/**/*.zip
91+
dist/**/*.yml
92+
dist/**/*.blockmap
93+
fail_on_unmatched_files: false
6094

6195
- name: Upload macOS artifacts
6296
uses: actions/upload-artifact@v4
@@ -65,11 +99,15 @@ jobs:
6599
path: |
66100
dist/**/*.dmg
67101
dist/**/*.zip
102+
dist/**/*.yml
103+
dist/**/*.blockmap
68104
69105
build-linux:
70106
runs-on: ubuntu-latest
71107
steps:
72108
- uses: actions/checkout@v4
109+
with:
110+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref }}
73111

74112
- name: Setup Node.js
75113
uses: actions/setup-node@v4
@@ -84,6 +122,19 @@ jobs:
84122
run: npm run build:linux
85123
env:
86124
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125+
126+
- name: Upload Linux assets to GitHub Release
127+
uses: softprops/action-gh-release@v2
128+
with:
129+
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name }}
130+
files: |
131+
dist/**/*.AppImage
132+
dist/**/*.deb
133+
dist/**/*.rpm
134+
dist/**/*.zip
135+
dist/**/*.yml
136+
dist/**/*.blockmap
137+
fail_on_unmatched_files: false
87138

88139
- name: Upload Linux artifacts
89140
uses: actions/upload-artifact@v4
@@ -93,3 +144,6 @@ jobs:
93144
dist/**/*.AppImage
94145
dist/**/*.deb
95146
dist/**/*.rpm
147+
dist/**/*.zip
148+
dist/**/*.yml
149+
dist/**/*.blockmap

0 commit comments

Comments
 (0)