summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2023-07-07 06:38:03 -0400
committerNat Goodspeed <nat@lindenlab.com>2023-07-07 06:38:03 -0400
commit2b1a3cf9cdb4cde92d14217b743545eccdcb2991 (patch)
tree21eecb68b0b8885a840466c31a5537b8f76ba8f8 /.github/workflows
parent07b47160f1d93c1ed0ee5e61c0c8330f66e20857 (diff)
SL-18837: Use multi-line GitHub outputs to upload artifacts.
Having observed installer upload failures, I discovered the warning in actions/upload-artifact/README.md about multiple concurrent jobs trying to post the same pathname to the same artifact name. Try to disambiguate artifacts not only for different platforms, but for different jobs running on the same platform. This change also reflects my understanding that an artifact is (effectively) a distinct zip file that can contain multiple uploaded files. Because we'll want to download metadata without having to download enormous installers, create a separate metadata artifact per platform. Similarly, symbol files can get large: use a third distinct artifact for symbol files. But with those artifacts defined, leverage actions/upload-artifact's ability to upload multiple paths to the same artifact. In build.sh, define bash arrays installer, metadata, symbolfile and set up so that, on exit, each is written to a GITHUB_OUTPUT variable with the corresponding name. This involves a little magic to get macOS bash 3 to indirectly access an array. These multi-line output variables are then used to drive the upload-artifact step for each of the defined artifacts.
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yaml80
1 files changed, 35 insertions, 45 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index e55a799825..574a83246c 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -186,58 +186,48 @@ jobs:
./build.sh
- # Find artifacts
- if [[ "$RUNNER_OS" == "Windows" ]]; then
- installer_path=$(find ./build-*/newview/ | grep '_Setup\.exe')
- installer_name="$(basename $installer_path)"
- elif [[ "$RUNNER_OS" == "macOS" ]]; then
- installer_path=$(find ./build-*/newview/ | grep '\.dmg')
- installer_name="$(basename $installer_path)"
- fi
-
- echo "installer_path=$installer_path" >> $GITHUB_OUTPUT
- echo "installer_name=$installer_name" >> $GITHUB_OUTPUT
+ # Each artifact is downloaded as a distinct .zip file. Multiple jobs
+ # (per the matrix above) writing the same filepath to the same
+ # artifact name will *overwrite* that file. Moreover, they can
+ # interfere with each other, causing the upload to fail.
+ # https://github.com/actions/upload-artifact#uploading-to-the-same-artifact
+ # Given the size of our installers, and the fact that we typically
+ # only want to download just one instead of a single zip containing
+ # several, generate a distinct artifact name for each installer.
+ # Since the matrix above can run multiple builds on the same
+ # platform, we must disambiguate on more than the platform name.
+ # If we were still running Windows 32-bit builds, we'd need to
+ # qualify the artifact with bit width.
+ # DEVELOPER_DIR="/Applications/Xcode_14.0.1.app/Contents/Developer"
+ # or the empty string, so this produces dev="Xcode_14.0.1" or ".".
+ dev="$(basename "$(dirname "$(dirname "$DEVELOPER_DIR")")" .app)"
+ artifact="$RUNNER_OS $dev"
+ # For empty DEVELOPER_DIR, dev is ".", so artifact can end up with
+ # appended " ." -- ditch that if present.
+ artifact="${artifact% .}"
+ echo "artifact=$artifact" >> $GITHUB_OUTPUT
- name: Upload installer
uses: actions/upload-artifact@v3
with:
- name: ${{ steps.build.outputs.installer_name }}
- path: ${{ steps.build.outputs.installer_path }}
-
- - name: Upload metadata
- uses: actions/upload-artifact@v3
- with:
- name: ${{ steps.build.outputs.autobuild_package_name }}
- path: ${{ steps.build.outputs.autobuild_package_path }}
-
- - name: Upload version
- uses: actions/upload-artifact@v3
- with:
- name: viewer_version.txt
- path: ${{ steps.build.outputs.viewer_version_name }}
+ name: "${{ steps.build.outputs.artifact }} installer"
+ # emitted by build.sh, possibly multiple lines
+ path: |
+ ${{ steps.build.outputs.installer }}
- - name: Upload Doxygen Log
- if: steps.build.outputs.doxygen_log_path
- uses: actions/upload-artifact@v3
- with:
- name: ${{ steps.build.outputs.doxygen_log_name }}
- path: ${{ steps.build.outputs.doxygen_log_path }}
-
- - name: Upload Doxygen Tarball
- if: steps.build.outputs.doxygen_tarball_path
- uses: actions/upload-artifact@v3
- with:
- name: ${{ steps.build.outputs.doxygen_tarball_name }}
- path: ${{ steps.build.outputs.doxygen_tarball_path }}
-
- - name: Upload viewer package installers
+ # The other upload of nontrivial size is the symbol file. Use a distinct
+ # artifact for that too.
+ - name: Upload symbol file
uses: actions/upload-artifact@v3
with:
- name: ${{ steps.build.outputs.installer_name }}
- path: ${{ steps.build.outputs.packages }}
+ name: "${{ steps.build.outputs.artifact }} symbols"
+ path: |
+ ${{ steps.build.outputs.symbolfile }}
- - name: Upload symbol file
+ - name: Upload metadata
uses: actions/upload-artifact@v3
with:
- name: ${{ steps.build.outputs.symbolfile_name }}
- path: ${{ steps.build.outputs.symbolfile_path }}
+ name: "${{ steps.build.outputs.artifact }} metadata"
+ # emitted by build.sh, possibly multiple lines
+ path: |
+ ${{ steps.build.outputs.metadata }}