Skip to content

Commit ac6a9a0

Browse files
authored
Merge pull request #435 from arduino/dependabot/github_actions/workflow-templates/actions/upload-artifact-4
Bump actions/upload-artifact from 3 to 4 in /workflow-templates
2 parents 2621fbb + 6cd34f7 commit ac6a9a0

10 files changed

+183
-133
lines changed

.github/workflows/check-clang-format.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
if: >
131131
always() &&
132132
steps.check.outcome == 'failure'
133-
uses: actions/upload-artifact@v3
133+
uses: actions/upload-artifact@v4
134134
with:
135135
path: ${{ env.WORKING_FOLDER }}/expected/.clang-format
136136
if-no-files-found: error
@@ -190,7 +190,7 @@ jobs:
190190
if: >
191191
always() &&
192192
steps.check.outcome == 'failure'
193-
uses: actions/upload-artifact@v3
193+
uses: actions/upload-artifact@v4
194194
with:
195195
path: ${{ env.WORKING_FOLDER }}/output
196196
if-no-files-found: error
@@ -245,7 +245,7 @@ jobs:
245245
OUTPUT_PATH="${{ env.CONVERSION_OUTPUT_PATH }}"
246246
247247
- name: Save conversion to a workflow artifact
248-
uses: actions/upload-artifact@v3
248+
uses: actions/upload-artifact@v4
249249
with:
250250
path: ${{ env.CONVERSION_OUTPUT_PATH }}
251251
if-no-files-found: error

.github/workflows/sync-labels-npm.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ env:
55
# See: https://github.com/actions/setup-node/#readme
66
NODE_VERSION: 16.x
77
CONFIGURATIONS_FOLDER: .github/label-configuration-files
8-
CONFIGURATIONS_ARTIFACT: label-configuration-files
8+
CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file-
99

1010
# See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
1111
on:
@@ -83,13 +83,13 @@ jobs:
8383
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
8484

8585
- name: Pass configuration files to next job via workflow artifact
86-
uses: actions/upload-artifact@v3
86+
uses: actions/upload-artifact@v4
8787
with:
8888
path: |
8989
*.yaml
9090
*.yml
9191
if-no-files-found: error
92-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
92+
name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }}
9393

9494
sync:
9595
needs: download
@@ -123,16 +123,17 @@ jobs:
123123
- name: Checkout repository
124124
uses: actions/checkout@v4
125125

126-
- name: Download configuration files artifact
127-
uses: actions/download-artifact@v3
126+
- name: Download configuration file artifacts
127+
uses: actions/download-artifact@v4
128128
with:
129-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
129+
merge-multiple: true
130+
pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}*
130131
path: ${{ env.CONFIGURATIONS_FOLDER }}
131132

132-
- name: Remove unneeded artifact
133-
uses: geekyeggo/delete-artifact@v2
133+
- name: Remove unneeded artifacts
134+
uses: geekyeggo/delete-artifact@v5
134135
with:
135-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
136+
name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}*
136137

137138
- name: Setup Node.js
138139
uses: actions/setup-node@v4

.github/workflows/test-install-script.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
"${{ env.SCRIPT_FOLDER }}/${{ env.SCRIPT_NAME }}"
5454
5555
- name: Save configured script as workflow artifact
56-
uses: actions/upload-artifact@v3
56+
uses: actions/upload-artifact@v4
5757
with:
5858
if-no-files-found: error
5959
path: ${{ env.SCRIPT_FOLDER }}/${{ env.SCRIPT_NAME }}
@@ -75,7 +75,7 @@ jobs:
7575

7676
steps:
7777
- name: Download script artifact
78-
uses: actions/download-artifact@v3
78+
uses: actions/download-artifact@v4
7979
with:
8080
name: ${{ env.SCRIPT_ARTIFACT_NAME }}
8181

@@ -114,7 +114,7 @@ jobs:
114114
echo "BINDIR=${{ runner.temp }}/custom-installation-folder" >> "$GITHUB_ENV"
115115
116116
- name: Download script artifact
117-
uses: actions/download-artifact@v3
117+
uses: actions/download-artifact@v4
118118
with:
119119
name: ${{ env.SCRIPT_ARTIFACT_NAME }}
120120

@@ -151,7 +151,7 @@ jobs:
151151

152152
steps:
153153
- name: Download script artifact
154-
uses: actions/download-artifact@v3
154+
uses: actions/download-artifact@v4
155155
with:
156156
name: ${{ env.SCRIPT_ARTIFACT_NAME }}
157157

@@ -184,7 +184,7 @@ jobs:
184184

185185
steps:
186186
- name: Download script artifact
187-
uses: actions/download-artifact@v3
187+
uses: actions/download-artifact@v4
188188
with:
189189
name: ${{ env.SCRIPT_ARTIFACT_NAME }}
190190

@@ -228,7 +228,7 @@ jobs:
228228
echo "SECOND_BINDIR=${{ runner.temp }}/${SECOND_INSTALLATION_FOLDER}" >> "$GITHUB_ENV"
229229
230230
- name: Download script artifact
231-
uses: actions/download-artifact@v3
231+
uses: actions/download-artifact@v4
232232
with:
233233
name: ${{ env.SCRIPT_ARTIFACT_NAME }}
234234

workflow-templates/check-npm-dependencies-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
# Some might find it convenient to have CI generate the cache rather than setting up for it locally
112112
- name: Upload cache to workflow artifact
113113
if: failure() && steps.diff.outcome == 'failure'
114-
uses: actions/upload-artifact@v3
114+
uses: actions/upload-artifact@v4
115115
with:
116116
if-no-files-found: error
117117
include-hidden-files: true

workflow-templates/publish-go-nightly-task.yml

+39-25
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
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
1515
on:
@@ -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

workflow-templates/publish-go-tester-task.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
7878
build:
7979
needs: package-name-prefix
80-
name: Build ${{ matrix.os.name }}
80+
name: Build ${{ matrix.os.artifact-name }}
8181
runs-on: ubuntu-latest
8282
permissions:
8383
contents: read
@@ -87,31 +87,31 @@ jobs:
8787
os:
8888
- task: Windows_32bit
8989
path: "*Windows_32bit.zip"
90-
name: Windows_X86-32
90+
artifact-name: Windows_X86-32
9191
- task: Windows_64bit
9292
path: "*Windows_64bit.zip"
93-
name: Windows_X86-64
93+
artifact-name: Windows_X86-64
9494
- task: Linux_32bit
9595
path: "*Linux_32bit.tar.gz"
96-
name: Linux_X86-32
96+
artifact-name: Linux_X86-32
9797
- task: Linux_64bit
9898
path: "*Linux_64bit.tar.gz"
99-
name: Linux_X86-64
99+
artifact-name: Linux_X86-64
100100
- task: Linux_ARMv6
101101
path: "*Linux_ARMv6.tar.gz"
102-
name: Linux_ARMv6
102+
artifact-name: Linux_ARMv6
103103
- task: Linux_ARMv7
104104
path: "*Linux_ARMv7.tar.gz"
105-
name: Linux_ARMv7
105+
artifact-name: Linux_ARMv7
106106
- task: Linux_ARM64
107107
path: "*Linux_ARM64.tar.gz"
108-
name: Linux_ARM64
108+
artifact-name: Linux_ARM64
109109
- task: macOS_64bit
110110
path: "*macOS_64bit.tar.gz"
111-
name: macOS_64
111+
artifact-name: macOS_64
112112
- task: macOS_ARM64
113113
path: "*macOS_ARM64.tar.gz"
114-
name: macOS_ARM64
114+
artifact-name: macOS_ARM64
115115

116116
steps:
117117
- name: Checkout repository
@@ -134,7 +134,7 @@ jobs:
134134
uses: actions/upload-artifact@v4
135135
with:
136136
path: ${{ env.DIST_DIR }}/${{ matrix.os.path }}
137-
name: ${{ matrix.os.name }}
137+
name: ${{ matrix.os.artifact-name }}
138138

139139
checksums:
140140
needs:

0 commit comments

Comments
 (0)