From e093609312883c22105989ba3fd39e684511bd94 Mon Sep 17 00:00:00 2001 From: lufia Date: Thu, 29 Feb 2024 18:51:19 +0900 Subject: [PATCH] env --- .github/workflows/go-build.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go-build.yml b/.github/workflows/go-build.yml index 1dadc80e7..68d4c0be3 100644 --- a/.github/workflows/go-build.yml +++ b/.github/workflows/go-build.yml @@ -70,8 +70,10 @@ jobs: GOOS="${INPUT_PLATFORM:-$GOHOSTOS}" echo "GOOS=$GOOS" >>"$GITHUB_ENV" + cmd=bash if [[ $GOHOSTOS = windows && $CGO_ENABLED = 1 ]] then + cmd='msys2 {0}' case "$GOARCH" in *64) echo 'MSYS=MINGW64' >>"$GITHUB_ENV" ;; @@ -79,6 +81,7 @@ jobs: echo 'MSYS=MINGW32' >>"$GITHUB_ENV" ;; esac fi + echo "CMD=$cmd" >>"$GITHUB_ENV" shell: bash - if: env.MSYS != '' uses: msys2/setup-msys2@v2 @@ -86,12 +89,8 @@ jobs: msystem: ${{ env.MSYS }} path-type: inherit install: mingw-w64-i686-gcc - - if: env.MSYS == '' - run: ${{ inputs.run }} - shell: bash - - if: env.MSYS != '' - run: ${{ inputs.run }} - shell: msys2 {0} + - run: ${{ inputs.run }} + shell: ${{ env.CMD }} - if: inputs.upload-artifact-path != '' uses: actions/upload-artifact@v4 with: