99 # The project's folder on Arduino's download server for uploading builds
1010 AWS_PLUGIN_TARGET : TODO_AWS_PLUGIN_TARGET
1111 AWS_REGION : " us-east-1"
12- ARTIFACT_NAME : dist
12+ ARTIFACT_PREFIX : dist-
1313
1414# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
1515on :
@@ -28,15 +28,24 @@ jobs:
2828 strategy :
2929 matrix :
3030 os :
31- - Windows_32bit
32- - Windows_64bit
33- - Linux_32bit
34- - Linux_64bit
35- - Linux_ARMv6
36- - Linux_ARMv7
37- - Linux_ARM64
38- - macOS_64bit
39- - macOS_ARM64
31+ - task : Windows_32bit
32+ artifact-suffix : Windows_32bit
33+ - task : Windows_64bit
34+ artifact-suffix : Windows_64bit
35+ - task : Linux_32bit
36+ artifact-suffix : Linux_32bit
37+ - task : Linux_64bit
38+ artifact-suffix : Linux_64bit
39+ - task : Linux_ARMv6
40+ artifact-suffix : Linux_ARMv6
41+ - task : Linux_ARMv7
42+ artifact-suffix : Linux_ARMv7
43+ - task : Linux_ARM64
44+ artifact-suffix : Linux_ARM64
45+ - task : macOS_64bit
46+ artifact-suffix : macOS_64bit
47+ - task : macOS_ARM64
48+ artifact-suffix : macOS_ARM64
4049
4150 steps :
4251 - name : Checkout repository
@@ -51,17 +60,17 @@ jobs:
5160 - name : Build
5261 env :
5362 NIGHTLY : true
54- run : task dist:${{ matrix.os }}
63+ run : task dist:${{ matrix.os.task }}
5564
5665 - name : Upload artifacts
5766 uses : actions/upload-artifact@v4
5867 with :
5968 if-no-files-found : error
60- name : ${{ env.ARTIFACT_NAME }}- ${{ matrix.os }}
69+ name : ${{ env.ARTIFACT_PREFIX }}${{ matrix.os.artifact-suffix }}
6170 path : ${{ env.DIST_DIR }}
6271
6372 notarize-macos :
64- name : Notarize ${{ matrix.artifact.name }}
73+ name : Notarize ${{ matrix.build.folder-suffix }}
6574 runs-on : macos-latest
6675 needs : create-nightly-artifacts
6776
@@ -77,20 +86,25 @@ jobs:
7786
7887 strategy :
7988 matrix :
80- artifact :
81- - name : darwin_amd64
82- path : " macOS_64bit.tar.gz"
83- - name : darwin_arm64
84- path : " macOS_ARM64.tar.gz"
89+ build :
90+ - folder-suffix : darwin_amd64
91+ package-suffix : " macOS_64bit.tar.gz"
92+ - folder-suffix : darwin_arm64
93+ package-suffix : " macOS_ARM64.tar.gz"
8594
8695 steps :
96+ - name : Set environment variables
97+ run : |
98+ # See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable
99+ echo "BUILD_FOLDER=${{ env.PROJECT_NAME }}_osx_${{ matrix.build.folder-suffix }}" >> "$GITHUB_ENV"
100+
87101 - name : Checkout repository
88102 uses : actions/checkout@v4
89103
90104 - name : Download artifacts
91105 uses : actions/download-artifact@v4
92106 with :
93- pattern : ${{ env.ARTIFACT_NAME }}- *
107+ pattern : ${{ env.ARTIFACT_PREFIX }}*
94108 merge-multiple : true
95109 path : ${{ env.DIST_DIR }}
96110
@@ -128,7 +142,7 @@ jobs:
128142 run : |
129143 cat > "${{ env.GON_CONFIG_PATH }}" <<EOF
130144 # See: https://github.com/Bearer/gon#configuration-file
131- source = ["${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"]
145+ source = ["${{ env.DIST_DIR }}/${{ env.BUILD_FOLDER }}/${{ env.PROJECT_NAME }}"]
132146 bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}"
133147
134148 sign {
@@ -157,19 +171,19 @@ jobs:
157171 run : |
158172 # GitHub's upload/download-artifact actions don't preserve file permissions,
159173 # so we need to add execution permission back until the action is made to do this.
160- chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
174+ chmod +x "${{ env.BUILD_FOLDER }}/${{ env.PROJECT_NAME }}"
161175 # Use of an array here is required for globbing
162- PACKAGE_FILENAME=(${{ env.PROJECT_NAME }}_nightly-*${{ matrix.artifact.path }})
176+ PACKAGE_FILENAME=(${{ env.PROJECT_NAME }}_nightly-*${{ matrix.build.package-suffix }})
163177 tar -czvf "$PACKAGE_FILENAME" \
164- -C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
178+ -C "${{ env.BUILD_FOLDER }}/" "${{ env.PROJECT_NAME }}" \
165179 -C ../../ LICENSE.txt
166180 echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV
167181
168182 - name : Upload artifact
169183 uses : actions/upload-artifact@v4
170184 with :
171185 if-no-files-found : error
172- name : ${{ env.ARTIFACT_NAME }}- notarized-${{ matrix.artifact.name }}
186+ name : ${{ env.ARTIFACT_PREFIX }}notarized-${{ matrix.build.folder-suffix }}
173187 path : ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}
174188
175189 publish-nightly :
@@ -183,7 +197,7 @@ jobs:
183197 - name : Download artifact
184198 uses : actions/download-artifact@v4
185199 with :
186- pattern : ${{ env.ARTIFACT_NAME }}- *
200+ pattern : ${{ env.ARTIFACT_PREFIX }}*
187201 merge-multiple : true
188202 path : ${{ env.DIST_DIR }}
189203
0 commit comments