-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (130 loc) · 4.34 KB
/
build.yml
File metadata and controls
149 lines (130 loc) · 4.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Build Desktop Apps
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag to build/upload (e.g. v1.4.8)'
required: true
type: string
publish_release:
description: 'Publish the GitHub Release (default: create a draft so we can validate before shipping)'
required: false
type: boolean
default: false
permissions:
contents: write
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build Windows
run: npm run build:win -- --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: windows-installer
path: |
dist/*.exe
dist/*.exe.blockmap
dist/latest.yml
if-no-files-found: error
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build macOS
run: npm run build:mac -- --publish never
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload macOS artifacts
uses: actions/upload-artifact@v4
with:
name: macos-installer
path: |
dist/*.dmg
dist/*.dmg.blockmap
dist/*-mac.zip
dist/*-mac.zip.blockmap
dist/latest-mac.yml
if-no-files-found: error
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Build Linux
run: npm run build:linux -- --publish never
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: linux-installer
path: |
dist/*.AppImage
dist/*.deb
dist/*.rpm
dist/latest-linux.yml
if-no-files-found: error
create-release:
needs: [build-windows, build-macos, build-linux]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Create / Update GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.ref_name }}
draft: ${{ !(github.event_name == 'workflow_dispatch' && inputs.publish_release == true) }}
fail_on_unmatched_files: true
generate_release_notes: true
files: |
windows-installer/*.exe
windows-installer/*.exe.blockmap
windows-installer/latest.yml
macos-installer/*.dmg
macos-installer/*.dmg.blockmap
macos-installer/*-mac.zip
macos-installer/*-mac.zip.blockmap
macos-installer/latest-mac.yml
linux-installer/*.AppImage
linux-installer/*.deb
linux-installer/*.rpm
linux-installer/latest-linux.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}