diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index c31f52f..a402046 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -23,20 +23,34 @@ jobs: - name: Install go-winres run: go install github.com/tc-hib/go-winres@latest - - name: Set up build directory - run: mkdir -p ./bin + - name: Set up build directories + run: | + mkdir -p ./bin/386 + mkdir -p ./bin/amd64 + mkdir -p ./bin/arm64 - name: Build + shell: bash run: | - go build -v -o ./bin ./... - go test -c -o ./bin ./... + for d in $(ls -d ./bin/*/); do + local arch=$(basename ${d}) + GOARCH=${arch} go build -v -o ${d} ./... + GOARCH=${arch} go test -c -o ${d} ./... + done - name: Bind resources to all binaries shell: bash run: | - for f in ./bin/*.exe; do - go-winres patch $f + for d in $(ls -d ./bin/*/); do + for f in $(ls ${d}*.exe); do + go-winres patch ${f} + done done - name: Test - run: go test -o ./bin -v ./... + shell: bash + run: | + for d in $(ls -d ./bin/*/); do + local arch=$(basename ${d}) + GOARCH=${arch} go test -o ${d} -v ./... + done