21
21
22
22
strategy :
23
23
matrix :
24
- os :
24
+ task :
25
25
- Windows_32bit
26
26
- Windows_64bit
27
27
- Linux_32bit
40
40
41
41
- name : Create changelog
42
42
# Avoid creating the same changelog for each os
43
- if : matrix.os == 'Windows_32bit'
43
+ if : matrix.task == 'Windows_32bit'
44
44
uses : arduino/create-changelog@v1
45
45
with :
46
46
tag-regex : ' ^[0-9]+\.[0-9]+\.[0-9]+.*$'
55
55
version : 3.x
56
56
57
57
- name : Build
58
- run : task dist:${{ matrix.os }}
58
+ run : task dist:${{ matrix.task }}
59
59
60
60
- name : Upload artifacts
61
61
uses : actions/upload-artifact@v3
65
65
path : ${{ env.DIST_DIR }}
66
66
67
67
notarize-macos :
68
- name : Notarize ${{ matrix.artifact.name }}
68
+ name : Notarize ${{ matrix.build.folder-suffix }}
69
69
runs-on : macos-latest
70
70
needs : create-release-artifacts
71
71
outputs :
@@ -77,13 +77,20 @@ jobs:
77
77
78
78
strategy :
79
79
matrix :
80
- artifact :
81
- - name : darwin_amd64
82
- path : " macOS_64bit.tar.gz"
83
- - name : darwin_arm64
84
- path : " macOS_ARM64.tar.gz"
80
+ build :
81
+ - folder-suffix : darwin_amd64
82
+ package-suffix : " macOS_64bit.tar.gz"
83
+ - folder-suffix : darwin_arm64
84
+ package-suffix : " macOS_ARM64.tar.gz"
85
85
86
86
steps :
87
+ - name : Set environment variables
88
+ run : |
89
+ # See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable
90
+ echo "BUILD_FOLDER=${{ env.PROJECT_NAME }}_osx_${{ matrix.build.folder-suffix }}" >> "$GITHUB_ENV"
91
+ TAG="${GITHUB_REF/refs\/tags\//}"
92
+ echo "PACKAGE_FILENAME=${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.build.package-suffix }}" >> $GITHUB_ENV
93
+
87
94
- name : Checkout repository
88
95
uses : actions/checkout@v4
89
96
@@ -127,7 +134,7 @@ jobs:
127
134
run : |
128
135
cat > "${{ env.GON_CONFIG_PATH }}" <<EOF
129
136
# See: https://github.com/Bearer/gon#configuration-file
130
- source = ["${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"]
137
+ source = ["${{ env.DIST_DIR }}/${{ env.BUILD_FOLDER }}/${{ env.PROJECT_NAME }}"]
131
138
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}"
132
139
133
140
sign {
@@ -156,13 +163,10 @@ jobs:
156
163
run : |
157
164
# GitHub's upload/download-artifact actions don't preserve file permissions,
158
165
# so we need to add execution permission back until the action is made to do this.
159
- chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
160
- TAG="${GITHUB_REF/refs\/tags\//}"
161
- PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.artifact.path }}"
162
- tar -czvf "$PACKAGE_FILENAME" \
163
- -C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
166
+ chmod +x "${{ env.BUILD_FOLDER }}/${{ env.PROJECT_NAME }}"
167
+ tar -czvf "${{ env.PACKAGE_FILENAME }}" \
168
+ -C "${{ env.BUILD_FOLDER }}/" "${{ env.PROJECT_NAME }}" \
164
169
-C ../../ LICENSE.txt
165
- echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV
166
170
167
171
- name : Upload artifact
168
172
uses : actions/upload-artifact@v3
0 commit comments