Skip to content

Commit 76e10a3

Browse files
[chore] upgrade actions/upload-artifact and actions/download-artifact to v4 (open-telemetry#31236)
The upgrade of `actions/upload-artifact` and `actions/download-artifact` is a breaking change. 1. Both actions need to be upgraded together, as downloading artifacts uploaded with previous version does not work. 2. A breaking change in `upload-artifact` is that you cannot upload to the same artifact name twice. The second point lead to the changes in this pull request. I have modified the names of artifacts to hopefully prevent conflicts. **Link to tracking Issue:** open-telemetry#30102 **Testing:** The changes to the `build-and-test` and `e2e-test` workflows are tested in this PR's checks. The changes to the `load-test` workflow can only be tested after merging to main, I'm afraid, as this is when this workflow is triggered.
1 parent a8b3a1b commit 76e10a3

File tree

3 files changed

+42
-35
lines changed

3 files changed

+42
-35
lines changed

.github/workflows/build-and-test.yml

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ jobs:
287287
- name: Run Unit Tests With Coverage
288288
if: startsWith( matrix.go-version, '1.21' ) # only run coverage on one version
289289
run: make gotest-with-cover GROUP=${{ matrix.group }}
290-
- uses: actions/upload-artifact@v3
290+
- uses: actions/upload-artifact@v4
291291
if: startsWith( matrix.go-version, '1.21' ) # only upload artifact for one version
292292
with:
293-
name: coverage-artifacts
293+
name: coverage-artifacts-${{ matrix.go-version }}-${{ matrix.group }}
294294
path: ${{ matrix.group }}-coverage.txt
295295
unittest:
296296
if: ${{ github.actor != 'dependabot[bot]' && always() }}
@@ -313,9 +313,10 @@ jobs:
313313
needs: [unittest]
314314
steps:
315315
- uses: actions/checkout@v4
316-
- uses: actions/download-artifact@v3
316+
- uses: actions/download-artifact@v4
317317
with:
318-
name: coverage-artifacts
318+
merge-multiple: true
319+
pattern: coverage-artifacts-*
319320
- name: Upload coverage report
320321
uses: Wandalen/wretry.action@v1.3.0
321322
with:
@@ -502,9 +503,9 @@ jobs:
502503
- name: Build Collector ${{ matrix.binary }}
503504
run: make GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM=${{ matrix.arm }} otelcontribcol
504505
- name: Upload Collector Binaries
505-
uses: actions/upload-artifact@v3
506+
uses: actions/upload-artifact@v4
506507
with:
507-
name: collector-binaries
508+
name: collector-binaries-${{ matrix.os }}-${{ matrix.arch }}
508509
path: ./bin/*
509510

510511
build-package:
@@ -525,10 +526,11 @@ jobs:
525526
- name: Install fpm
526527
run: gem install --no-document fpm -v 1.15.1
527528
- name: Download Collector Binaries
528-
uses: actions/download-artifact@v3
529+
uses: actions/download-artifact@v4
529530
with:
530-
name: collector-binaries
531+
merge-multiple: true
531532
path: bin/
533+
pattern: collector-binaries-*
532534
- run: chmod +x bin/*
533535
- name: Set Release Tag
534536
id: github_tag
@@ -549,9 +551,9 @@ jobs:
549551
./internal/buildscripts/packaging/fpm/test.sh dist/otel-contrib-collector*x86_64.rpm examples/demo/otel-collector-config.yaml
550552
fi
551553
- name: Upload Packages
552-
uses: actions/upload-artifact@v3
554+
uses: actions/upload-artifact@v4
553555
with:
554-
name: collector-packages
556+
name: collector-packages-${{ matrix.package_type }}
555557
path: ./dist/*
556558
windows-msi:
557559
if: false # skip. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/10113
@@ -562,10 +564,11 @@ jobs:
562564
with:
563565
fetch-depth: 0
564566
- name: Download Binaries
565-
uses: actions/download-artifact@v3
567+
uses: actions/download-artifact@v4
566568
with:
567-
name: collector-binaries
569+
merge-multiple: true
568570
path: ./bin/
571+
pattern: collector-binaries-*
569572
- name: Cache Wix
570573
id: wix-cache
571574
uses: actions/cache@v3
@@ -584,9 +587,9 @@ jobs:
584587
- name: Validate MSI
585588
run: .\internal\buildscripts\packaging\msi\make.ps1 Confirm-MSI
586589
- name: Upload MSI
587-
uses: actions/upload-artifact@v3
590+
uses: actions/upload-artifact@v4
588591
with:
589-
name: collector-packages
592+
name: collector-packages-msi
590593
path: ./dist/*.msi
591594

592595
publish-check:
@@ -595,15 +598,17 @@ jobs:
595598
steps:
596599
- uses: actions/checkout@v4
597600
- name: Download Binaries
598-
uses: actions/download-artifact@v3
601+
uses: actions/download-artifact@v4
599602
with:
600-
name: collector-binaries
603+
merge-multiple: true
601604
path: ./bin/
605+
pattern: collector-binaries-*
602606
- name: Download Packages
603-
uses: actions/download-artifact@v3
607+
uses: actions/download-artifact@v4
604608
with:
605-
name: collector-packages
609+
merge-multiple: true
606610
path: ./dist/
611+
pattern: collector-packages-*
607612
- name: Verify Distribution Files Exist
608613
id: check
609614
run: ./.github/workflows/scripts/verify-dist-files-exist.sh
@@ -636,16 +641,18 @@ jobs:
636641
if: steps.go-cache.outputs.cache-hit != 'true'
637642
run: make install-tools
638643
- name: Download Binaries
639-
uses: actions/download-artifact@v3
644+
uses: actions/download-artifact@v4
640645
with:
641-
name: collector-binaries
646+
merge-multiple: true
642647
path: ./bin/
648+
pattern: collector-binaries-*
643649
- run: chmod +x bin/*
644650
- name: Download Packages
645-
uses: actions/download-artifact@v3
651+
uses: actions/download-artifact@v4
646652
with:
647-
name: collector-packages
653+
merge-multiple: true
648654
path: ./dist/
655+
pattern: collector-packages-*
649656
- name: Add Permissions to Tool Binaries
650657
run: chmod -R +x ./dist
651658
- name: Verify Distribution Files Exist

.github/workflows/e2e-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Build Collector
4040
run: make otelcontribcol
4141
- name: Upload Collector Binary
42-
uses: actions/upload-artifact@v3
42+
uses: actions/upload-artifact@v4
4343
with:
4444
name: collector-binary
4545
path: ./bin/*
@@ -66,7 +66,7 @@ jobs:
6666
if: steps.go-cache.outputs.cache-hit != 'true'
6767
run: make -j2 gomoddownload
6868
- name: Download Collector Binary
69-
uses: actions/download-artifact@v3
69+
uses: actions/download-artifact@v4
7070
with:
7171
name: collector-binary
7272
path: bin/
@@ -104,7 +104,7 @@ jobs:
104104
run: |
105105
docker save otelcontribcol:latest > /tmp/otelcontribcol.tar
106106
- name: Upload artifact
107-
uses: actions/upload-artifact@v3
107+
uses: actions/upload-artifact@v4
108108
with:
109109
name: otelcontribcol
110110
path: /tmp/otelcontribcol.tar
@@ -155,7 +155,7 @@ jobs:
155155
run: |
156156
kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve
157157
- name: Download artifact
158-
uses: actions/download-artifact@v3
158+
uses: actions/download-artifact@v4
159159
with:
160160
name: otelcontribcol
161161
path: /tmp

.github/workflows/load-tests.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ jobs:
4545
if: steps.go-cache.outputs.cache-hit != 'true'
4646
run: make install-tools
4747
- run: make oteltestbedcol
48-
- name: Upload Collector Binaries
49-
uses: actions/upload-artifact@v3
48+
- name: Upload Testbed Binaries
49+
uses: actions/upload-artifact@v4
5050
with:
51-
name: collector-binaries
51+
name: testbed-binaries
5252
path: ./bin/*
5353
- name: Split Loadtest Jobs
5454
id: splitloadtest
@@ -83,10 +83,10 @@ jobs:
8383
if: steps.go-cache.outputs.cache-hit != 'true'
8484
run: make install-tools
8585
- run: mkdir -p results && touch results/TESTRESULTS.md
86-
- name: Download Collector Binaries
87-
uses: actions/download-artifact@v3
86+
- name: Download Testbed Binaries
87+
uses: actions/download-artifact@v4
8888
with:
89-
name: collector-binaries
89+
name: testbed-binaries
9090
path: bin/
9191
- run: chmod +x bin/*
9292
- name: Loadtest
@@ -103,12 +103,12 @@ jobs:
103103
- name: Upload Test Results
104104
if: ${{ failure() || success() }}
105105
continue-on-error: true
106-
uses: actions/upload-artifact@v3
106+
uses: actions/upload-artifact@v4
107107
with:
108108
path: ./*.tar
109109
- run: cp testbed/tests/results/benchmarks.json testbed/tests/results/${{steps.filename.outputs.name}}.json
110110
- name: Upload benchmarks.json
111-
uses: actions/upload-artifact@v3
111+
uses: actions/upload-artifact@v4
112112
with:
113113
name: benchmark-results
114114
path: testbed/tests/results/${{steps.filename.outputs.name}}.json
@@ -123,7 +123,7 @@ jobs:
123123
if: github.event_name != 'pull_request'
124124
steps:
125125
- uses: actions/checkout@v4
126-
- uses: actions/download-artifact@v3
126+
- uses: actions/download-artifact@v4
127127
with:
128128
name: benchmark-results
129129
path: results

0 commit comments

Comments
 (0)