-
Notifications
You must be signed in to change notification settings - Fork 247
277 lines (230 loc) · 8.84 KB
/
release-stable.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
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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# 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@v4
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@v4
with:
node-version: '21.1.0'
- name: Install npm dependencies
run: |
npm install --legacy-peer-deps
# It is necesarry to install wine for building the package for
# windows. Also it is necesary to download the wine-mono windows
# installer and install it with wine
- name: Install dependencies
run: |
sudo add-apt-repository universe
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine nsis
wget https://dl.winehq.org/wine/wine-mono/5.0.0/wine-mono-5.0.0-x86.msi
export DISPLAY=:0.0
wine msiexec /i wine-mono-5.0.0-x86.msi
# -- 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@v2
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@v2
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-latest
steps:
- name: Checkout the master repo branch
uses: actions/checkout@v4
with:
ref: master
- name: Setup Nodejs version
uses: actions/setup-node@v4
with:
node-version: '21.1.0'
- name: Install npm dependencies
run: |
sed -i '' 's/darwinDependencies/dependencies/g' package.json
npm install --legacy-peer-deps
- name: Build OSX ARM64 packages
env:
MACOS_CERTIFICATE: ${{ secrets.APPLE_CERT_DATA }}
MACOS_CERTIFICATE_PWD: ${{ secrets.APPLE_CERT_PASSWORD }}
CODESIGN_ID: ${{ secrets.APPLE_TEAM_ID }}
MACOS_KEYCHAIN_PASS: ${{ secrets.LOCAL_KEYCHAIN_PASS }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
security create-keychain -p $MACOS_KEYCHAIN_PASS build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $MACOS_KEYCHAIN_PASS build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PASS build.keychain
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
- name: Sign DMG
env:
ICESTUDIO_VERSION: "${{fromJson(steps.icestudio_json.outputs.packageJson).version}}"
MACOS_APPLE_UID: ${{ secrets.APPLE_TEAM_ID }}
run: |
codesign --force --deep --sign ${MACOS_APPLE_UID} dist/icestudio-${ICESTUDIO_VERSION}-osxarm64.dmg -v
# ---------------------------------------
# -- Upload Mac binaries to the release
# ---------------------------------------
- name: 'Upload DMG/OSX64'
uses: softprops/action-gh-release@v2
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-22.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checkout the develop branch
- uses: actions/checkout@v4
with:
ref: master
#-- PATCH! For ARM use NWjs 0.60
- name: Setup por arm64
run: ./scripts/preInstallArm64.sh
- name: Setup Nodejs version
uses: actions/setup-node@v4
with:
node-version: '19.3.0'
- name: Install npm dependencies
run: npm install --legacy-peer-deps
- name: Build ARM
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@v2
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