Skip to content

Commit 3c2364f

Browse files
authored
Merge pull request #76 from arduino/dependabot/github_actions/actions/upload-artifact-4
Bump actions/upload-artifact from 3 to 4
2 parents a8c5479 + 2c465d7 commit 3c2364f

File tree

3 files changed

+65
-43
lines changed

3 files changed

+65
-43
lines changed

.github/workflows/check-go-dependencies-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
# Some might find it convenient to have CI generate the cache rather than setting up for it locally
103103
- name: Upload cache to workflow artifact
104104
if: failure() && steps.diff.outcome == 'failure'
105-
uses: actions/upload-artifact@v3
105+
uses: actions/upload-artifact@v4
106106
with:
107107
if-no-files-found: error
108108
include-hidden-files: true

.github/workflows/release-go-crosscompile-task.yml

+54-33
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ env:
88
DIST_DIR: dist
99
# The project's folder on Arduino's download server for uploading builds
1010
AWS_PLUGIN_TARGET: /arduinoOTA/
11-
ARTIFACT_NAME: dist
11+
ARTIFACT_PREFIX: dist-
1212
# See: https://github.com/actions/setup-go/tree/main#supported-version-syntax
1313
GO_VERSION: "1.17"
1414

@@ -24,15 +24,24 @@ jobs:
2424
strategy:
2525
matrix:
2626
os:
27-
- Windows_32bit
28-
- Windows_64bit
29-
- Linux_32bit
30-
- Linux_64bit
31-
- Linux_ARMv6
32-
- Linux_ARMv7
33-
- Linux_ARM64
34-
- macOS_64bit
35-
- macOS_ARM64
27+
- task: Windows_32bit
28+
artifact-suffix: Windows_32bit
29+
- task: Windows_64bit
30+
artifact-suffix: Windows_64bit
31+
- task: Linux_32bit
32+
artifact-suffix: Linux_32bit
33+
- task: Linux_64bit
34+
artifact-suffix: Linux_64bit
35+
- task: Linux_ARMv6
36+
artifact-suffix: Linux_ARMv6
37+
- task: Linux_ARMv7
38+
artifact-suffix: Linux_ARMv7
39+
- task: Linux_ARM64
40+
artifact-suffix: Linux_ARM64
41+
- task: macOS_64bit
42+
artifact-suffix: macOS_64bit
43+
- task: macOS_ARM64
44+
artifact-suffix: macOS_ARM64
3645

3746
steps:
3847
- name: Checkout repository
@@ -42,7 +51,7 @@ jobs:
4251

4352
- name: Create changelog
4453
# Avoid creating the same changelog for each os
45-
if: matrix.os == 'Windows_32bit'
54+
if: matrix.os.task == 'Windows_32bit'
4655
uses: arduino/create-changelog@v1
4756
with:
4857
tag-regex: '^[0-9]+\.[0-9]+\.[0-9]+.*$'
@@ -62,17 +71,17 @@ jobs:
6271
version: 3.x
6372

6473
- name: Build
65-
run: task dist:${{ matrix.os }}
74+
run: task dist:${{ matrix.os.task }}
6675

6776
- name: Upload artifacts
68-
uses: actions/upload-artifact@v3
77+
uses: actions/upload-artifact@v4
6978
with:
7079
if-no-files-found: error
71-
name: ${{ env.ARTIFACT_NAME }}
80+
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.os.artifact-suffix }}
7281
path: ${{ env.DIST_DIR }}
7382

7483
notarize-macos:
75-
name: Notarize ${{ matrix.artifact.name }}
84+
name: Notarize ${{ matrix.build.artifact-suffix }}
7685
runs-on: macos-latest
7786
needs: create-release-artifacts
7887
outputs:
@@ -84,22 +93,36 @@ jobs:
8493

8594
strategy:
8695
matrix:
87-
artifact:
88-
- name: darwin_amd64
89-
path: "macOS_64bit.tar.gz"
90-
- name: darwin_arm64
91-
path: "macOS_ARM64.tar.gz"
96+
build:
97+
- artifact-suffix: macOS_64bit
98+
folder-suffix: darwin_amd64
99+
package-suffix: "macOS_64bit.tar.gz"
100+
- artifact-suffix: macOS_ARM64
101+
folder-suffix: darwin_arm64
102+
package-suffix: "macOS_ARM64.tar.gz"
92103

93104
steps:
105+
- name: Set environment variables
106+
run: |
107+
# See: https://docs.github.com/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-environment-variable
108+
echo "BUILD_FOLDER=${{ env.PROJECT_NAME }}_osx_${{ matrix.build.folder-suffix }}" >> "$GITHUB_ENV"
109+
TAG="${GITHUB_REF/refs\/tags\//}"
110+
echo "PACKAGE_FILENAME=${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.build.package-suffix }}" >> $GITHUB_ENV
111+
94112
- name: Checkout repository
95113
uses: actions/checkout@v4
96114

97115
- name: Download artifacts
98-
uses: actions/download-artifact@v3
116+
uses: actions/download-artifact@v4
99117
with:
100-
name: ${{ env.ARTIFACT_NAME }}
118+
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }}
101119
path: ${{ env.DIST_DIR }}
102120

121+
- name: Remove non-notarized artifact
122+
uses: geekyeggo/delete-artifact@v5
123+
with:
124+
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }}
125+
103126
- name: Import Code-Signing Certificates
104127
env:
105128
KEYCHAIN: "sign.keychain"
@@ -133,7 +156,7 @@ jobs:
133156
run: |
134157
cat > "${{ env.GON_CONFIG_PATH }}" <<EOF
135158
# See: https://github.com/Bearer/gon#configuration-file
136-
source = ["${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"]
159+
source = ["${{ env.DIST_DIR }}/${{ env.BUILD_FOLDER }}/${{ env.PROJECT_NAME }}"]
137160
bundle_id = "cc.arduino.${{ env.PROJECT_NAME }}"
138161
139162
sign {
@@ -162,17 +185,14 @@ jobs:
162185
run: |
163186
# GitHub's upload/download-artifact actions don't preserve file permissions,
164187
# so we need to add execution permission back until the action is made to do this.
165-
chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
166-
TAG="${GITHUB_REF/refs\/tags\//}"
167-
PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_${TAG}_${{ matrix.artifact.path }}"
168-
tar -czvf "$PACKAGE_FILENAME" "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}"
169-
echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV
188+
chmod +x "${{ env.BUILD_FOLDER }}/${{ env.PROJECT_NAME }}"
189+
tar -czvf "${{ env.PACKAGE_FILENAME }}" "${{ env.BUILD_FOLDER }}/"
170190
171-
- name: Upload artifact
172-
uses: actions/upload-artifact@v3
191+
- name: Upload notarized artifact
192+
uses: actions/upload-artifact@v4
173193
with:
174194
if-no-files-found: error
175-
name: ${{ env.ARTIFACT_NAME }}
195+
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.build.artifact-suffix }}
176196
path: ${{ env.DIST_DIR }}/${{ env.PACKAGE_FILENAME }}
177197

178198
create-release:
@@ -181,10 +201,11 @@ jobs:
181201

182202
steps:
183203
- name: Download artifact
184-
uses: actions/download-artifact@v3
204+
uses: actions/download-artifact@v4
185205
with:
186-
name: ${{ env.ARTIFACT_NAME }}
206+
merge-multiple: true
187207
path: ${{ env.DIST_DIR }}
208+
pattern: ${{ env.ARTIFACT_PREFIX }}*
188209

189210
- name: Create checksum file
190211
working-directory: ${{ env.DIST_DIR}}

.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:
@@ -81,13 +81,13 @@ jobs:
8181
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
8282

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

9292
sync:
9393
needs: download
@@ -118,16 +118,17 @@ jobs:
118118
- name: Checkout repository
119119
uses: actions/checkout@v4
120120

121-
- name: Download configuration files artifact
122-
uses: actions/download-artifact@v3
121+
- name: Download configuration file artifacts
122+
uses: actions/download-artifact@v4
123123
with:
124-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
124+
merge-multiple: true
125+
pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}*
125126
path: ${{ env.CONFIGURATIONS_FOLDER }}
126127

127-
- name: Remove unneeded artifact
128-
uses: geekyeggo/delete-artifact@v2
128+
- name: Remove unneeded artifacts
129+
uses: geekyeggo/delete-artifact@v5
129130
with:
130-
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
131+
name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}*
131132

132133
- name: Setup Node.js
133134
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)