-
Notifications
You must be signed in to change notification settings - Fork 279
251 lines (217 loc) · 8.21 KB
/
Copy pathrelease-stable.yml
File metadata and controls
251 lines (217 loc) · 8.21 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
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# Release a stable version of icestudio
# 1. The binaries are generated for all the platforms
# 2. A new release is created
# 3. The binaries are uploaded to the Release page
name: Stable Release
# Manual activation
on: [workflow_dispatch]
jobs:
#-- Build for Linux and windows
build-LinWin:
runs-on: ubuntu-22.04
outputs:
#-- URL to upload the binaries for
#-- the jobs executed after build-LinWin
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
# Debug: It is for testing if the `certificate has expired`
# Error is solved
- name: 'Debug: No SSL verification'
run: |
git config --global http.sslVerify false
# Checkout the master repo branch
- name: Checkout!
uses: actions/checkout@v5
with:
ref: master
# jq is bash command for reading properties from a json file
- name: Install jq package
run: sudo apt install jq
# Read the icestudio version from package.json (version property)
- name: Read the package.json file
id: icestudio_json
run: |
version=$(jq -r '.version' package.json)
echo "icestudio_version=${version}" >> $GITHUB_OUTPUT
echo $version
# -- Debug: Print the icestudio version
- name: Get the Icestudio version
env:
VERSION: '${{steps.icestudio_json.outputs.icestudio_version}}'
run: |
echo "VERSION: ${{ env.VERSION }}"
# Install Node
- name: Setup Nodejs version
uses: actions/setup-node@v5
with:
node-version: '22.7.0'
- name: Install npm dependencies
run: |
npm install --legacy-peer-deps
# NSIS (makensis) builds the Windows installer. wine/wine-mono are no
# longer needed: nw-builder sets the .exe icon via resedit (pure JS) and
# makensis runs natively on Linux.
- name: Install NSIS
run: |
sudo add-apt-repository -y universe
sudo apt-get update
sudo apt-get install -y nsis
# -- Build For windows!!
- name: Build Microsoft Windows package
run: |
export DISPLAY=:0.0
npm run buildWindows
echo "====> DEBUG: Contents of the dist folder..."
ls -l dist
#-- Create the Release (draft) and Upload Window binaries
- name: Create the Stable Release
id: create_release
uses: softprops/action-gh-release@v3
env:
VERSION: '${{steps.icestudio_json.outputs.icestudio_version}}'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
tag_name: v${{ env.VERSION }}
files: |
dist/icestudio-${{env.VERSION}}-win64.exe
dist/icestudio-${{env.VERSION}}-win64.zip
body: A new release (Draft)
#-- Build for linux
- name: Build Linux
run: |
sudo apt install -y libfuse2
export DISPLAY=:0.0
npm run buildLinux64
echo "====> DEBUG: Contents of the dist folder..."
ls -l dist
# ---------------------------------------
# -- Upload the Linux binaries to the release
# ---------------------------------------
- name: Upload Linux64 binaries
uses: softprops/action-gh-release@v3
env:
VERSION: '${{steps.icestudio_json.outputs.icestudio_version}}'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
tag_name: v${{ env.VERSION }}
files: |
dist/icestudio-${{env.VERSION}}-linux64.AppImage
dist/icestudio-${{env.VERSION}}-linux64.zip
# Build for macos
build-macos:
# -- It is only run if the build for linux/win is ok, and
# -- the release was already created
needs: build-LinWin
runs-on: macos-15
steps:
- name: Checkout the master repo branch
uses: actions/checkout@v5
with:
ref: master
- name: Setup Nodejs version
uses: actions/setup-node@v5
with:
node-version: '21.1.0'
- name: Install npm dependencies
run: |
# Merge macOS-only deps (grunt-appdmg, fs-xattr) into "dependencies"
# so npm installs them. A plain rename would create a duplicate
# "dependencies" key (package.json already has an empty one) and npm
# keeps the last, empty one -> grunt-appdmg was never installed.
node -e "const fs=require('fs');const p=JSON.parse(fs.readFileSync('package.json'));p.dependencies=Object.assign({},p.dependencies,p.darwinDependencies);delete p.darwinDependencies;fs.writeFileSync('package.json',JSON.stringify(p,null,2))"
npm install --legacy-peer-deps
# Ad-hoc code signing (no Apple Developer certificate / secrets).
- name: Build OSX ARM64 packages (ad-hoc signed)
env:
CODESIGN_ID: '-'
run: |
npm run buildOSXARM64
ls dist/
# Loading vars from icestudio package.json
- id: icestudio_json
run: |
content=`tr '\n' ' ' < package.json`
echo "packageJson=${content}" >> $GITHUB_OUTPUT
# Read the icestudio version from package.json (version property)
- id: icestudio_version_json
run: |
version=$(jq -r '.version' package.json)
echo "icestudio_version=${version}" >> $GITHUB_OUTPUT
# NOTE: no separate "Sign DMG" step — the build already ad-hoc signs the
# .dmg (repairOSXarm64dmg.sh, CODESIGN_ID=-) and sets its Finder icon.
# ---------------------------------------
# -- Upload Mac binaries to the release
# ---------------------------------------
- name: 'Upload DMG/OSX64'
uses: softprops/action-gh-release@v3
env:
# VERSION: "${{fromJson(steps.icestudio_json.outputs.packageJson).version}}"
VERSION: '${{steps.icestudio_version_json.outputs.icestudio_version}}'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
tag_name: v${{ env.VERSION }}
files: |
dist/icestudio-${{env.VERSION}}-osxarm64.dmg
# Build for ARM 64
build-arm:
# -- It is only run if the build for linux/win is ok, and
# -- the release already created
needs: build-LinWin
# The type of runner that the job will run on
runs-on: ubuntu-24.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checkout the develop branch
- uses: actions/checkout@v5
with:
ref: master
- name: Setup Nodejs version
uses: actions/setup-node@v5
with:
node-version: '23.3.0'
- name: Install npm dependencies
run: npm install --legacy-peer-deps
- name: Build ARM
env:
NW_FLAVOR: normal
run: |
sudo apt install -y libfuse2
export DISPLAY=:0.0
npm run buildAarch64
echo "====> DEBUG: Contents of the dist folder..."
ls -l dist
# jq is bash command for reading properties from a json file
- name: Install jq package
run: sudo apt install jq
# Read the icestudio version from package.json (version property)
- id: icestudio_json
run: |
version=$(jq -r '.version' package.json)
echo "icestudio_version=${version}" >> $GITHUB_OUTPUT
# -- Debug: Print the icestudio version
# -- It is read from the package.json
- name: Get the Icestudio version
env:
VERSION: '${{steps.icestudio_json.outputs.icestudio_version}}'
run: |
echo "VERSION: ${{ env.VERSION }}"
# ---------------------------------------
# -- Upload ARM binaries to the release
# ---------------------------------------
- name: 'Upload ZIP/Aarch64'
uses: softprops/action-gh-release@v3
env:
VERSION: '${{steps.icestudio_json.outputs.icestudio_version}}'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
tag_name: v${{ env.VERSION }}
files: |
dist/icestudio-${{env.VERSION}}-aarch64.zip