@@ -19,13 +19,28 @@ jobs:
19
19
create-release-artifacts :
20
20
runs-on : ubuntu-latest
21
21
22
+ strategy :
23
+ matrix :
24
+ os :
25
+ - Windows_32bit
26
+ - Windows_64bit
27
+ - Linux_32bit
28
+ - Linux_64bit
29
+ - Linux_ARMv6
30
+ - Linux_ARMv7
31
+ - Linux_ARM64
32
+ - macOS_64bit
33
+ - macOS_ARM64
34
+
22
35
steps :
23
36
- name : Checkout repository
24
37
uses : actions/checkout@v3
25
38
with :
26
39
fetch-depth : 0
27
40
28
41
- name : Create changelog
42
+ # Avoid creating the same changelog for each os
43
+ if : matrix.os == 'Windows_32bit'
29
44
uses : arduino/create-changelog@v1
30
45
with :
31
46
tag-regex : ' ^[0-9]+\.[0-9]+\.[0-9]+.*$'
@@ -40,15 +55,15 @@ jobs:
40
55
version : 3.x
41
56
42
57
- name : Build
43
- run : task dist:all
58
+ run : task dist:${{ matrix.os }}
44
59
45
60
- name : Upload artifacts
46
61
uses : actions/upload-artifact@v3
47
62
with :
48
63
if-no-files-found : error
49
64
name : ${{ env.ARTIFACT_NAME }}
50
65
path : ${{ env.DIST_DIR }}
51
-
66
+
52
67
notarize-macos :
53
68
name : Notarize ${{ matrix.artifact.name }}
54
69
runs-on : macos-latest
82
97
env :
83
98
KEYCHAIN : " sign.keychain"
84
99
INSTALLER_CERT_MAC_PATH : " /tmp/ArduinoCerts2020.p12"
85
- KEYCHAIN_PASSWORD : keychainpassword # Arbitrary password for a keychain that exists only for the duration of the job, so not secret
100
+ # Arbitrary password for a keychain that exists only for the duration of the job, so not secret
101
+ KEYCHAIN_PASSWORD : keychainpassword
86
102
run : |
87
103
echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode > "${{ env.INSTALLER_CERT_MAC_PATH }}"
88
104
security create-keychain -p "${{ env.KEYCHAIN_PASSWORD }}" "${{ env.KEYCHAIN }}"
@@ -132,14 +148,10 @@ jobs:
132
148
run : |
133
149
gon "${{ env.GON_CONFIG_PATH }}"
134
150
135
- - name : Re-package binary and output checksum
151
+ - name : Re-package binary
136
152
id : re-package
137
153
working-directory : ${{ env.DIST_DIR }}
138
- # This step performs the following:
139
- # 1. Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
140
- # 2. Recalculate package checksum
141
- # 3. Output the new checksum to include in the nnnnnn-checksums.txt file
142
- # (it cannot be done there because of workflow job parallelization)
154
+ # Repackage the signed binary replaced in place by Gon (ignoring the output zip file)
143
155
run : |
144
156
# GitHub's upload/download-artifact actions don't preserve file permissions,
145
157
# so we need to add execution permission back until the action is made to do this.
@@ -149,11 +161,9 @@ jobs:
149
161
tar -czvf "$PACKAGE_FILENAME" \
150
162
-C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
151
163
-C ../../ LICENSE.txt
152
- CHECKSUM_LINE="$(shasum -a 256 $PACKAGE_FILENAME)"
153
164
echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV
154
- echo "::set-output name=checksum-${{ matrix.artifact.name }}::$CHECKSUM_LINE"
155
165
156
- - name : Upload artifacts
166
+ - name : Upload artifact
157
167
uses : actions/upload-artifact@v3
158
168
with :
159
169
if-no-files-found : error
@@ -170,25 +180,29 @@ jobs:
170
180
with :
171
181
name : ${{ env.ARTIFACT_NAME }}
172
182
path : ${{ env.DIST_DIR }}
173
-
174
- - name : Update checksum
183
+
184
+ - name : Create checksum file
185
+ working-directory : ${{ env.DIST_DIR}}
175
186
run : |
176
- declare -a checksum_lines=("${{ needs.notarize-macos.outputs.checksum-darwin_amd64 }}" "${{ needs.notarize-macos.outputs.checksum-darwin_arm64 }}")
177
- for checksum_line in "${checksum_lines[@]}"
178
- do
179
- CHECKSUM=$(echo ${checksum_line} | cut -d " " -f 1)
180
- PACKAGE_FILENAME=$(echo ${checksum_line} | cut -d " " -f 2)
181
- perl -pi -w -e "s/.*${PACKAGE_FILENAME}/${CHECKSUM} ${PACKAGE_FILENAME}/g;" ${{ env.DIST_DIR }}/*-checksums.txt
182
- done
187
+ TAG="${GITHUB_REF/refs\/tags\//}"
188
+ sha256sum ${{ env.PROJECT_NAME }}_${TAG}* > ${TAG}-checksums.txt
183
189
184
190
- name : Identify Prerelease
185
191
# This is a workaround while waiting for create-release action
186
192
# to implement auto pre-release based on tag
187
193
id : prerelease
188
194
run : |
189
- wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.0.0.zip
190
- unzip -p /tmp/3.0.0.zip semver-tool-3.0.0/src/semver >/tmp/semver && chmod +x /tmp/semver
191
- if [[ "$(/tmp/semver get prerel "${GITHUB_REF/refs\/tags\//}")" ]]; then echo "::set-output name=IS_PRE::true"; fi
195
+ wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.2.0.zip
196
+ unzip -p /tmp/3.2.0.zip semver-tool-3.2.0/src/semver >/tmp/semver && chmod +x /tmp/semver
197
+ if [[ \
198
+ "$(
199
+ /tmp/semver get prerel \
200
+ "${GITHUB_REF/refs\/tags\//}"
201
+ )" != \
202
+ "" \
203
+ ]]; then
204
+ echo "IS_PRE=true" >> $GITHUB_OUTPUT
205
+ fi
192
206
193
207
- name : Create Github Release and upload artifacts
194
208
uses : ncipollo/release-action@v1
0 commit comments