From 0117605483c449bc6703d49156303c43594fbf7a Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 22 Jun 2022 23:09:32 -0700 Subject: [PATCH] [skip changelog] Restore globbing of nightly build artifact filename 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]`). --- .github/workflows/publish-go-nightly-task.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-go-nightly-task.yml b/.github/workflows/publish-go-nightly-task.yml index 619f5ec9be5..897e4e9fea9 100644 --- a/.github/workflows/publish-go-nightly-task.yml +++ b/.github/workflows/publish-go-nightly-task.yml @@ -139,7 +139,8 @@ jobs: # 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. 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" \ -C "${{ env.PROJECT_NAME }}_osx_${{ matrix.artifact.name }}/" "${{ env.PROJECT_NAME }}" \ -C ../../ LICENSE.txt