Skip to content

Commit 9aa92dc

Browse files
committed
Refactor passing vars between steps
refactor to use more recommended way to handle passing vars between steps
1 parent c871d09 commit 9aa92dc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ jobs:
4646
shell: bash
4747
run: |
4848
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
49-
echo "ARCHIVE_NAME=${{ env.BINARY_NAME }}-v${{ github.ref_name }}-${{ matrix.binary_target }}.zip" >> $GITHUB_ENV
49+
echo "archive_name=${{ env.BINARY_NAME }}-v${{ github.ref_name }}-${{ matrix.binary_target }}.zip" >> $GITHUB_OUTPUT
5050
else
51-
echo "ARCHIVE_NAME=${{ env.BINARY_NAME }}-v${{ github.ref_name }}-${{ matrix.binary_target }}.tar.gz" >> $GITHUB_ENV
51+
echo "archive_name=${{ env.BINARY_NAME }}-v${{ github.ref_name }}-${{ matrix.binary_target }}.tar.gz" >> $GITHUB_OUTPUT
5252
fi
5353
5454
- name: Prepare binary (Unix)
5555
if: matrix.os != 'windows-latest'
5656
run: |
5757
cd target/${{ matrix.binary_target }}/release
58-
tar -czf ../../../${{ env.ARCHIVE_NAME }} ${{ env.BINARY_NAME }}
58+
tar -czf ../../../${{ steps.archive.outputs.archive_name }} ${{ env.BINARY_NAME }}
5959
cd -
6060
6161
- name: Prepare binary (Windows)
@@ -64,14 +64,14 @@ jobs:
6464
run: |
6565
cd target/${{ matrix.binary_target }}/release
6666
$BINARY_NAME = "${{ env.BINARY_NAME }}.exe"
67-
Compress-Archive -Path $BINARY_NAME -DestinationPath ../../../${{ env.ARCHIVE_NAME }}
67+
Compress-Archive -Path $BINARY_NAME -DestinationPath ../../../${{ steps.archive.outputs.archive_name }}
6868
cd -
6969
7070
- name: Upload Release Asset
7171
uses: svenstaro/upload-release-action@v2
7272
with:
7373
repo_token: ${{ secrets.GITHUB_TOKEN }}
74-
file: ${{ env.ARCHIVE_NAME }}
75-
asset_name: ${{ env.ARCHIVE_NAME }}
74+
file: ${{ steps.archive.outputs.archive_name }}
75+
asset_name: ${{ steps.archive.outputs.archive_name }}
7676
tag: ${{ github.ref }}
7777
overwrite: true

0 commit comments

Comments
 (0)