diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 127a235..1588441 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,18 @@ +# Note [environment variables] +# +# It seems absurd, but the syntax for creating environment variables +# differs between Windows and Linux/MacOS. See +# +# https://docs.github.com/en/actions/learn-github-actions/variables +# +# In Linux/MacOS we have to use +# +# run: echo "VARNAME=content" >> "$GITHUB_ENV" +# +# whereas in Windows we have to use +# +# run: echo "VARNAME=content" >> $env:GITHUB_ENV + name: Stan Release on: @@ -84,11 +99,12 @@ jobs: mkdir dist cabal install exe:stan --install-method=copy --overwrite-policy=always --installdir=dist + # See Note [environment variables] - if: matrix.os == 'windows-latest' name: Set binary path name on Windows - # https://stackoverflow.com/a/74547513/997606 run: echo "BINARY_PATH=./dist/stan.exe" >> $env:GITHUB_ENV + # See Note [environment variables] - if: matrix.os != 'windows-latest' name: Set binary path name not on Windows run: echo "BINARY_PATH=./dist/stan" >> "$GITHUB_ENV" @@ -104,12 +120,14 @@ jobs: name: release_url path: release_url + # See Note [environment variables] - if: matrix.os == 'windows-latest' name: Get Release File Name & Upload URL on Widows id: get_release_info run: | echo "upload_url=$(cat release_url/release_url.txt)" >> $env:GITHUB_OUTPUT + # See Note [environment variables] - if: matrix.os != 'windows-latest' name: Get Release File Name & Upload URL not on Widows id: get_release_info