Skip to content

Commit 489b127

Browse files
committed
temp
1 parent 52d7bdd commit 489b127

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

.github/workflows/build-linux.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ on:
44
push:
55
branches:
66
- master
7+
- refactor-b # temp
78
tags:
89
- v*
910
pull_request:
1011

11-
1212
jobs:
1313
build-linux:
1414
name: Build (Unix-like OSes)
15-
env:
16-
DEBIAN_FRONTEND: noninteractive
1715
uses: ./.github/workflows/go-build.yml
1816
with:
1917
os-version: ubuntu-latest
@@ -75,5 +73,5 @@ jobs:
7573
go build -o ../build/wrapper.exe wrapper/wrapper_windows.go wrapper/install.go
7674
go build -o ../build/replace.exe replace/replace_windows.go replace/shell_windows.go
7775
go build -o ../build/generate_wxs.exe generate_wxs/generate_wxs.go
78-
upload-artifact-name: windows-build-artifacts-x64
76+
upload-artifact-name: windows-build-artifacts-x86
7977
upload-artifact-path: build/

.github/workflows/go-build.yml

+24-12
Original file line numberDiff line numberDiff line change
@@ -46,40 +46,52 @@ on:
4646
required: false
4747
type: string
4848

49+
env:
50+
DEBIAN_FRONTEND: noninteractive
4951
jobs:
5052
run:
5153
runs-on: ${{ inputs.os-version }}
5254
env:
53-
CGO_ENABLED: ${{ inputs.with-cgo - 0 }} # {false|true} -> {0|1}
55+
CGO_ENABLED: ${{ inputs.with-cgo && 1 || 0 }}
5456
steps:
57+
- uses: actions/checkout@v4
5558
- uses: actions/setup-go@v5
5659
with:
5760
go-version: ${{ inputs.go-version }}
5861
cache: true
5962
- name: Setup environment variables
63+
id: spec
6064
run: |
6165
GOHOSTARCH="$(go env GOHOSTARCH)"
62-
echo "GOARCH=${INPUT_ARCHITECTURE:-$GOHOSTARCH}" >>"$GITHUB_ENV"
66+
GOARCH="${INPUT_ARCHITECTURE:-$GOHOSTARCH}"
67+
echo "GOARCH=$GOARCH" >>"$GITHUB_ENV"
6368
6469
GOHOSTOS="$(go env GOHOSTOS)"
65-
echo "GOOS=${INPUT_PLATFORM:-$GOHOSTOS}" >>"$GITHUB_ENV"
70+
GOOS="${INPUT_PLATFORM:-$GOHOSTOS}"
71+
echo "GOOS=$GOOS" >>"$GITHUB_ENV"
6672
67-
shell=bash
6873
if [[ $GOHOSTOS = windows && $CGO_ENABLED = 1 ]]
6974
then
70-
shell='msys2 {0}'
71-
case $GOARCH in
75+
case "$GOARCH" in
7276
*64)
73-
echo 'MSYS=MINGW64' >>"$GITHUB_ENV"
77+
echo 'MSYS=MINGW64' >>"$GITHUB_ENV" ;;
7478
*)
75-
echo 'MSYS=MINGW32' >>"$GITHUB_ENV"
79+
echo 'MSYS=MINGW32' >>"$GITHUB_ENV" ;;
7680
esac
7781
fi
78-
echo "shell=$shell" >>"$GITHUB_STATE"
7982
shell: bash
80-
- uses: actions/checkout@v4
81-
- run: ${{ inputs.run }}
82-
shell: ${{ state.shell }}
83+
- if: env.MSYS != ''
84+
uses: msys2/setup-msys2@v2
85+
with:
86+
msystem: ${{ env.MSYS }}
87+
path-type: inherit
88+
install: mingw-w64-i686-gcc
89+
- if: env.MSYS == ''
90+
run: ${{ inputs.run }}
91+
shell: bash
92+
- if: env.MSYS != ''
93+
run: ${{ inputs.run }}
94+
shell: msys2 {0}
8395
- if: inputs.upload-artifact-path != ''
8496
uses: actions/upload-artifact@v4
8597
with:

0 commit comments

Comments
 (0)