Skip to content

Commit

Permalink
replace deprecated set-output in GitHub action with use of GITHUB_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Jun 14, 2024
1 parent d587b5d commit 3714e0d
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,40 +149,30 @@ jobs:
pytest
if: matrix.platform == 'windows-latest'

- name: Upload wheels as build artifacts (non-windows)
- name: set wheel_file and artifact_name environment vars (non-windows)
if: matrix.platform != 'windows-latest'
run: |
for wheel_file in dist/*.whl; do
echo "Uploading $wheel_file"
echo "::set-output name=wheel_file::$wheel_file"
echo "::set-output name=artifact_name::$(basename $wheel_file)"
echo "wheel_file=$wheel_file" >> $GITHUB_ENV
echo "artifact_name=$(basename $wheel_file)" >> $GITHUB_ENV
done
id: get_wheel_files_nonwindows
- name: Upload wheels as build artifacts (windows)
- name: set wheel_file and artifact_name environment vars (windows)
if: matrix.platform == 'windows-latest'
shell: pwsh
run: |
foreach ($wheel_file in Get-ChildItem -Path dist -Filter *.whl) {
Write-Output "Uploading $wheel_file"
echo "::set-output name=wheel_file::$wheel_file"
echo "::set-output name=artifact_name::$(Split-Path $wheel_file -Leaf)"
echo "wheel_file=$wheel_file" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "artifact_name=$(Split-Path $wheel_file -Leaf)" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
}
id: get_wheel_files_windows
- name: Upload wheel file (non-windows)
if: matrix.platform != 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.get_wheel_files_nonwindows.outputs.artifact_name }}
path: ${{ steps.get_wheel_files_nonwindows.outputs.wheel_file }}

- name: Upload wheel file (windows)
if: matrix.platform == 'windows-latest'
- name: Upload wheel file
uses: actions/upload-artifact@v4
with:
name: ${{ steps.get_wheel_files_windows.outputs.artifact_name }}
path: ${{ steps.get_wheel_files_windows.outputs.wheel_file }}
name: ${{ env.artifact_name }}
path: ${{ env.wheel_file }}

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down

0 comments on commit 3714e0d

Please sign in to comment.