name: build and test on: push: branches: - "master" - "develop" jobs: build: name: artifact builds on linux and windows env: RUNNER_TOOL_CACHE: /toolcache runs-on: ubuntu-latest steps: - name: checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: setup go uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - name: setup-dependencies run: | apt-get update apt-get install -y gcc-mingw-w64 gcc libgl1-mesa-dev xorg-dev - name: get fyne run: | go get fyne.io/fyne/v2@latest go install fyne.io/fyne/v2/cmd/fyne@latest - name: build linux run: | VERSION=${{github.ref_name}} BUILD=${{github.run_number}} GOOS=windows GOARCH=amd64 GOFLAGS="-ldflags=-s -ldflags=-w" CGO_ENABLED=1 CC=gcc fyne package --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-linux-amd64 main.go - name: build windows run: | VERSION=${{github.ref_name}} BUILD=${{github.run_number}} GOOS=windows GOARCH=amd64 GOFLAGS="-ldflags=-H=windowsgui -ldflags=-s -ldflags=-w" CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc fyne package --appVersion=${VERSION#v} --appBuild=${BUILD} --exe bin/swiped-mod-switcher-$VERSION-windows-amd64.exe main.go - uses: actions/upload-artifact@v3 with: name: swiped-mod-switcher-${{github.ref_name}} path: bin/