Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cross_compile.yml #24

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 1 addition & 51 deletions .github/workflows/cross_compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,56 +62,6 @@ jobs:
else
upx --best --lzma "$FILENAME"
fi
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: gensokyo-hunyuan-${{ matrix.os }}-${{ matrix.goarch }}
path: output/gensokyo-hunyuan-${{ matrix.os }}-${{ matrix.goarch }}${{ endsWith(matrix.os, 'windows') && '.exe' || '' }}
build-win:
name: Build on ${{ matrix.os }} for ${{ matrix.goarch }}
runs-on: windows-latest
strategy:
matrix:
include:
- os: windows
goarch: amd64

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.21.1' # Set to specific Go version.

- name: Install build dependencies (Windows)
if: matrix.os == 'windows'
run: |
choco install msys2 --params "/NoUpdate /InstallDir:C:\msys64" --no-progress -y
C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm"
C:\msys64\usr\bin\bash -lc "pacman -S --noconfirm mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-pkg-config mingw-w64-x86_64-cmake mingw-w64-x86_64-extra-cmake-modules mingw-w64-x86_64-toolchain"
echo "CGO_ENABLED=1" >> $GITHUB_ENV
echo "CC=x86_64-w64-mingw32-gcc" >> $GITHUB_ENV
echo "CXX=x86_64-w64-mingw32-g++" >> $GITHUB_ENV

- name: Create output directory
run: mkdir -p output

- name: Compile Go for target
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 1
run: |
if [ "$GOOS" = "windows" ]; then
go build -o output/gensokyo-hunyuan-${{ matrix.os }}-${{ matrix.goarch }}.exe
else
go build -o output/gensokyo-hunyuan-${{ matrix.os }}-${{ matrix.goarch }}
fi
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -237,4 +187,4 @@ jobs:
else
echo "Expected ${dir} to be a directory."
fi
done
done
Loading