Skip to content

Commit d88abc2

Browse files
committed
ci: correct the artifact name in the macOS test jobs
upload-artifact gives an artifact uploaded with "archive: false" the name of the file, not the name in the "name" input. Download the tarball by its file name, and find it on disk instead of assuming where it lands.
1 parent 0a95696 commit d88abc2

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/build-macos.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,17 @@ jobs:
118118
- name: Download TinyGo build
119119
uses: actions/download-artifact@v8
120120
with:
121-
name: darwin-${{ matrix.goarch }}-double-zipped-${{ steps.version.outputs.version }}
121+
# An artifact uploaded with "archive: false" takes the name of the
122+
# file, not the name given to upload-artifact. See the comment on
123+
# "Collect the release files" in release.yml.
124+
name: tinygo${{ steps.version.outputs.version }}.darwin-${{ matrix.goarch }}.tar.gz
122125
path: build/
126+
skip-decompress: true
123127
- name: Unpack TinyGo build
124-
run: tar -xzf build/tinygo${{ steps.version.outputs.version }}.darwin-${{ matrix.goarch }}.tar.gz -C build
128+
run: |
129+
tarball=$(find build -type f -name 'tinygo*.darwin-*.tar.gz' | head -1)
130+
test -n "$tarball"
131+
tar -xzf "$tarball" -C build
125132
- name: Test stdlib packages
126133
run: make tinygo-test TINYGO=$(PWD)/build/tinygo/bin/tinygo
127134

@@ -159,10 +166,17 @@ jobs:
159166
- name: Download TinyGo build
160167
uses: actions/download-artifact@v8
161168
with:
162-
name: darwin-${{ matrix.goarch }}-double-zipped-${{ steps.version.outputs.version }}
169+
# An artifact uploaded with "archive: false" takes the name of the
170+
# file, not the name given to upload-artifact. See the comment on
171+
# "Collect the release files" in release.yml.
172+
name: tinygo${{ steps.version.outputs.version }}.darwin-${{ matrix.goarch }}.tar.gz
163173
path: build/
174+
skip-decompress: true
164175
- name: Unpack TinyGo build
165-
run: tar -xzf build/tinygo${{ steps.version.outputs.version }}.darwin-${{ matrix.goarch }}.tar.gz -C build
176+
run: |
177+
tarball=$(find build -type f -name 'tinygo*.darwin-*.tar.gz' | head -1)
178+
test -n "$tarball"
179+
tar -xzf "$tarball" -C build
166180
- name: Smoke tests
167181
run: make ${{ matrix.smoketest }} TINYGO=$(PWD)/build/tinygo/bin/tinygo
168182

0 commit comments

Comments
 (0)