diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..8b8f54c --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,31 @@ +name: ortlinde Go build + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + - name: Install system build dependencies + run: sudo apt-get install -y binutils-mingw-w64-x86-64 + - name: Generate Windows resource COFF + run: ./buildresource.sh + - name: Install Go dependencies + run: go get . + - name: Build for Windows x64 + run: go build -v -o ortlinde.exe + env: + GOOS: windows + GOARCH: amd64 + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ortlinde.exe + path: ortlinde.exe diff --git a/buildresource.sh b/buildresource.sh index 6322534..2742370 100644 --- a/buildresource.sh +++ b/buildresource.sh @@ -5,4 +5,7 @@ set -xe -windres -i ortlinde.rc -O coff -o ortlinde.syso +WINDRES=windres +# (on linux crosscompile) +command -v x86_64-w64-mingw32-windres >/dev/null && WINDRES=x86_64-w64-mingw32-windres +$WINDRES -i ortlinde.rc -O coff -o ortlinde.syso diff --git a/go.mod b/go.mod index 9caa16b..58cb9d4 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/nicholastay/ortlinde go 1.21.1 -require golang.org/x/sys v0.12.0 // indirect +require golang.org/x/sys v0.12.0