Skip to content

Commit 6b802ad

Browse files
committed
fix(ci): correct env var expansion in release workflow matrix
The `archive_command` definitions within the `strategy.matrix` in `release.yml` were attempting to use GitHub Actions expression syntax (`${{ env.VAR }}`) to access environment variables (`ARCHIVE_NAME` and `STAGING_DIR`). This caused errors because: 1. `ARCHIVE_NAME` is set dynamically in a later step using `$GITHUB_ENV` and is not available during the initial matrix evaluation phase. 2. Using `${{ env.STAGING_DIR }}` within the command string itself was also problematic in this context, even though `STAGING_DIR` is defined globally. This commit changes the `archive_command` strings to use standard shell variable expansion syntax (`"$VAR"` for bash, `"$env:VAR"` for pwsh). These variables are correctly resolved within the shell environment when the `Package release artifacts` step executes, after the necessary environment variables have been set.
1 parent 004ae66 commit 6b802ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
bin_suffix: ""
2727
archive_format: tar.gz
2828
archive_command: |
29-
tar czf ${{ env.ARCHIVE_NAME }} -C ${{ env.STAGING_DIR }} .
29+
tar czf "$ARCHIVE_NAME" -C "$STAGING_DIR" .
3030
archive_shell: bash
3131

3232
# macOS (Intel x86_64) - tar.gz archive
@@ -35,7 +35,7 @@ jobs:
3535
bin_suffix: ""
3636
archive_format: tar.gz
3737
archive_command: |
38-
tar czf ${{ env.ARCHIVE_NAME }} -C ${{ env.STAGING_DIR }} .
38+
tar czf "$ARCHIVE_NAME" -C "$STAGING_DIR" .
3939
archive_shell: bash
4040

4141
# macOS (Apple Silicon arm64) - tar.gz archive
@@ -44,7 +44,7 @@ jobs:
4444
bin_suffix: ""
4545
archive_format: tar.gz
4646
archive_command: |
47-
tar czf ${{ env.ARCHIVE_NAME }} -C ${{ env.STAGING_DIR }} .
47+
tar czf "$ARCHIVE_NAME" -C "$STAGING_DIR" .
4848
archive_shell: bash
4949

5050
# Windows (MSVC x86_64) - zip archive
@@ -53,7 +53,7 @@ jobs:
5353
bin_suffix: ".exe"
5454
archive_format: zip
5555
archive_command: |
56-
Compress-Archive -Path ${{ env.STAGING_DIR }}\* -DestinationPath ${{ env.ARCHIVE_NAME }}
56+
Compress-Archive -Path "$($env:STAGING_DIR)\*" -DestinationPath "$env:ARCHIVE_NAME"
5757
archive_shell: pwsh
5858

5959
steps:

0 commit comments

Comments
 (0)