From fba9d022057623ad91c9e4ed32ccf47755301a03 Mon Sep 17 00:00:00 2001 From: lufia Date: Wed, 28 Feb 2024 20:25:48 +0900 Subject: [PATCH] temp --- .github/workflows/build-linux.yml | 4 +--- .github/workflows/go-build.yml | 28 +++++++++++++++++----------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index f5bc547ea..7c258a0e9 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -4,16 +4,14 @@ on: push: branches: - master + - refactor-b # temp tags: - v* pull_request: - jobs: build-linux: name: Build (Unix-like OSes) - env: - DEBIAN_FRONTEND: noninteractive uses: ./.github/workflows/go-build.yml with: os-version: ubuntu-latest diff --git a/.github/workflows/go-build.yml b/.github/workflows/go-build.yml index f38252aca..56b5f2d8f 100644 --- a/.github/workflows/go-build.yml +++ b/.github/workflows/go-build.yml @@ -46,40 +46,46 @@ on: required: false type: string +env: + DEBIAN_FRONTEND: noninteractive jobs: run: runs-on: ${{ inputs.os-version }} env: - CGO_ENABLED: ${{ inputs.with-cgo - 0 }} # {false|true} -> {0|1} + CGO_ENABLED: ${{ inputs.with-cgo && 1 || 0 }} steps: - uses: actions/setup-go@v5 with: go-version: ${{ inputs.go-version }} cache: true - name: Setup environment variables + id: spec run: | GOHOSTARCH="$(go env GOHOSTARCH)" - echo "GOARCH=${INPUT_ARCHITECTURE:-$GOHOSTARCH}" >>"$GITHUB_ENV" + GOARCH="${INPUT_ARCHITECTURE:-$GOHOSTARCH}" + echo "GOARCH=$GOARCH" >>"$GITHUB_ENV" GOHOSTOS="$(go env GOHOSTOS)" - echo "GOOS=${INPUT_PLATFORM:-$GOHOSTOS}" >>"$GITHUB_ENV" + GOOS="${INPUT_PLATFORM:-$GOHOSTOS}" + echo "GOOS=$GOOS" >>"$GITHUB_ENV" - shell=bash if [[ $GOHOSTOS = windows && $CGO_ENABLED = 1 ]] then - shell='msys2 {0}' - case $GOARCH in + case "$GOARCH" in *64) - echo 'MSYS=MINGW64' >>"$GITHUB_ENV" + echo 'MSYS=MINGW64' >>"$GITHUB_ENV" ;; *) - echo 'MSYS=MINGW32' >>"$GITHUB_ENV" + echo 'MSYS=MINGW32' >>"$GITHUB_ENV" ;; esac fi - echo "shell=$shell" >>"$GITHUB_STATE" shell: bash - uses: actions/checkout@v4 - - run: ${{ inputs.run }} - shell: ${{ state.shell }} + - if: env.MSYS == '' + run: ${{ inputs.run }} + shell: bash + - if: env.MSYS != '' + run: ${{ inputs.run }} + shell: msys2 {0} - if: inputs.upload-artifact-path != '' uses: actions/upload-artifact@v4 with: