build: stop using set-env and set-path in the GitHub actions

A security problem was discovered when using set-env and
set-path. This has been deprecated by GitHub and a new mechanism
introduced.

This patch switches to using the new mechanism which will stop GitHub
warning about the use of the old mechanism.

See: https://github.com/actions/toolkit/security/advisories/GHSA-mfwh-5m23-j46w
This commit is contained in:
Nick Craig-Wood 2020-10-26 11:19:06 +00:00
parent a2fa1370c5
commit a152351a71

View File

@ -107,10 +107,10 @@ jobs:
- name: Set environment variables - name: Set environment variables
shell: bash shell: bash
run: | run: |
echo '::set-env name=GOTAGS::${{ matrix.gotags }}' echo 'GOTAGS=${{ matrix.gotags }}' >> $GITHUB_ENV
echo '::set-env name=BUILD_FLAGS::${{ matrix.build_flags }}' echo 'BUILD_FLAGS=${{ matrix.build_flags }}' >> $GITHUB_ENV
if [[ "${{ matrix.goarch }}" != "" ]]; then echo '::set-env name=GOARCH::${{ matrix.goarch }}' ; fi if [[ "${{ matrix.goarch }}" != "" ]]; then echo 'GOARCH=${{ matrix.goarch }}' >> $GITHUB_ENV ; fi
if [[ "${{ matrix.cgo }}" != "" ]]; then echo '::set-env name=CGO_ENABLED::${{ matrix.cgo }}' ; fi if [[ "${{ matrix.cgo }}" != "" ]]; then echo 'CGO_ENABLED=${{ matrix.cgo }}' >> $GITHUB_ENV ; fi
- name: Install Libraries on Linux - name: Install Libraries on Linux
shell: bash shell: bash
@ -135,10 +135,10 @@ jobs:
run: | run: |
$ProgressPreference = 'SilentlyContinue' $ProgressPreference = 'SilentlyContinue'
choco install -y winfsp zip choco install -y winfsp zip
Write-Host "::set-env name=CPATH::C:\Program Files\WinFsp\inc\fuse;C:\Program Files (x86)\WinFsp\inc\fuse" echo "CPATH=C:\Program Files\WinFsp\inc\fuse;C:\Program Files (x86)\WinFsp\inc\fuse" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
if ($env:GOARCH -eq "386") { if ($env:GOARCH -eq "386") {
choco install -y mingw --forcex86 --force choco install -y mingw --forcex86 --force
Write-Host "::add-path::C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw32\\bin" echo "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw32\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
} }
# Copy mingw32-make.exe to make.exe so the same command line # Copy mingw32-make.exe to make.exe so the same command line
# can be used on Windows as on macOS and Linux # can be used on Windows as on macOS and Linux
@ -225,8 +225,8 @@ jobs:
- name: Set environment variables - name: Set environment variables
shell: bash shell: bash
run: | run: |
echo '::set-env name=GOPATH::${{ runner.workspace }}' echo 'GOPATH=${{ runner.workspace }}' >> $GITHUB_ENV
echo '::add-path::${{ runner.workspace }}/bin' echo '${{ runner.workspace }}/bin' >> $GITHUB_PATH
- name: Cross-compile rclone - name: Cross-compile rclone
run: | run: |