Unverified Commit 4a4b784c authored by per1234's avatar per1234 Committed by GitHub

[skip changelog] Restore globbing of nightly build artifact filename (#1781)

During a refactoring of the "Publish Nightly Build" workflow, globbing of the macOS build artifact filename in the
repackaging step was accidentally lost, causing the glob pattern to be treated instead as a string and the updated
package saved to a file named by that string instead of to the original filename.

This resulted in the workflow failing with errors like:

Artifact path is not valid: /arduino-cli_nightly-*macOS_64bit.tar.gz. Contains the following character: Asterisk *

The previous `basename` command was providing the globbing. After the refactoring, `basename` is no longer needed, so an
alternative way to achieve globbing is needed. It seems the preferred approach is use of an array. Since the globbing
will only expand to a single filename, the array can be referenced as before by the rest of the step, since it will
resolve to the first element in the array (equivalent to `$PACKAGE_FILENAME[0]`).
parent 0de6c37b
...@@ -139,7 +139,8 @@ jobs: ...@@ -139,7 +139,8 @@ jobs:
# GitHub's upload/download-artifact@v2 actions don't preserve file permissions, # GitHub's upload/download-artifact@v2 actions don't preserve file permissions,
# so we need to add execution permission back until the action is made to do this. # so we need to add execution permission back until the action is made to do this.
chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}" chmod +x "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/${{ env.PROJECT_NAME }}"
PACKAGE_FILENAME="${{ env.PROJECT_NAME }}_nightly-*${{ matrix.artifact.path }}" # Use of an array here is required for globbing
PACKAGE_FILENAME=(${{ env.PROJECT_NAME }}_nightly-*${{ matrix.artifact.path }})
tar -czvf "$PACKAGE_FILENAME" \ tar -czvf "$PACKAGE_FILENAME" \
-C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \ -C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \
-C ../../ LICENSE.txt -C ../../ LICENSE.txt
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment