-
Notifications
You must be signed in to change notification settings - Fork 0
195 lines (158 loc) · 5.08 KB
/
publish.yml
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Publish
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
env:
ARTIFACT_NAME_PREFIX: "fossity-probe" ##This is the build.artifactName on package.json prefix
jobs:
build_w:
name: "Build for Windows"
runs-on: windows-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Install Node and NPM
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install dependencies
run: |
npm install --legacy-peer-deps
npm run postinstall
npm run build
- name: Build binaries for Windows
run:
npm exec -- electron-builder build --win --publish never
- uses: actions/upload-artifact@v3
with:
name: artifact_w_unsigned
path: |
release/build/${{ env.ARTIFACT_NAME_PREFIX }}*.exe
release/build/latest.yml
release/build/*exe.blockmap
build_w_sign:
name: "Sign with CodeSignTool"
needs: [build_w]
runs-on: ubuntu-latest
steps:
- name: Download artifact W unsigned
uses: actions/download-artifact@v2
with:
name: artifact_w_unsigned
- name: Find Windows Artifact Path
id: win-path-artifact
run: |
export WIN_BINARY_FILEPATH=$(ls ${{ env.ARTIFACT_NAME_PREFIX }}*.exe)
mkdir win_unsigned
mv "$WIN_BINARY_FILEPATH" win_unsigned/
echo "ARTIFACT_WIN_PATH=win_unsigned/$WIN_BINARY_FILEPATH" >> "$GITHUB_OUTPUT"
- name: Sign Windows Artifact with CodeSignTool
uses: sslcom/actions-codesigner@develop
env:
ARTIFACT_WIN_PATH: ${{ steps.win-path-artifact.outputs.ARTIFACT_WIN_PATH }}
with:
command: sign
username: ${{secrets.ES_USERNAME}}
password: ${{secrets.ES_PASSWORD}}
credential_id: ${{secrets.CREDENTIAL_ID}}
totp_secret: ${{secrets.ES_TOTP_SECRET}}
file_path: ${GITHUB_WORKSPACE}/${{ env.ARTIFACT_WIN_PATH }}
output_path: ${GITHUB_WORKSPACE}
- uses: actions/upload-artifact@v3
with:
name: artifact_w
path: |
${{ env.ARTIFACT_NAME_PREFIX }}*.exe
latest.yml
*exe.blockmap
build_m:
name: "Build for MacOS"
runs-on: macos-13
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8.0'
architecture: 'x64'
- name: Install Node and NPM
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install dependencies
run: |
npm install --legacy-peer-deps
npm run postinstall
npm run build
- name: Build Binaries for MacOs & Windows
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
run: |
npm exec -- electron-builder build --mac --publish never
- uses: actions/upload-artifact@v3
with:
name: artifact_m
path: |
release/build/${{ env.ARTIFACT_NAME_PREFIX }}*.dmg
release/build/latest-mac.yml
release/build/*dmg.blockmap
build_l:
name: "Build for Linux"
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: Install Node and NPM
uses: actions/setup-node@v3
with:
node-version: 16
cache: npm
- name: Install and build
run: |
npm install --legacy-peer-deps
npm run postinstall
npm run build
- name: Build binaries for linux
run: |
npm exec -- electron-builder build --linux --publish never
- uses: actions/upload-artifact@v3
with:
name: artifact_l
path: |
release/build/${{ env.ARTIFACT_NAME_PREFIX }}*.AppImage
release/build/latest-linux.yml
create_release:
needs: [build_w_sign, build_l, build_m]
runs-on: ubuntu-latest
steps:
- name: Download artifact W
uses: actions/download-artifact@v2
with:
name: artifact_w
- name: Download artifact M
uses: actions/download-artifact@v2
with:
name: artifact_m
- name: Download artifact L
uses: actions/download-artifact@v2
with:
name: artifact_l
- name: Publish release draft
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PROMPT_DISABLED: "disable"
run: |
gh release create ${{github.ref_name}} \
--repo ${{ github.server_url }}/${{ github.repository }} \
--generate-notes \
--draft \
$(ls *.AppImage *.exe *.dmg *.yml *.blockmap)