ci: fix workflow #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- '*' | |
env: | |
APP_NAME: godnstray | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: 'go.mod' | |
- name: Install | |
run: | | |
sudo apt-get install -y gcc libgtk-3-dev libayatana-appindicator3-dev | |
go mod tidy | |
go install github.com/tc-hib/go-winres@latest | |
- name: Build for Linux | |
run: go build -o dist/${{ env.APP_NAME }}-linux-amd64 | |
- name: Build for Windows | |
run: | | |
go-winres simply --icon icon/icon.png | |
go build -ldflags "-H=windowsgui" -o dist/${{ env.APP_NAME }}.exe | |
GOARCH=arm go build -ldflags "-H=windowsgui" -o dist/${{ env.APP_NAME }}-arm.exe | |
GOARCH=arm64 go build -ldflags "-H=windowsgui" -o dist/${{ env.APP_NAME }}-arm64.exe | |
env: | |
GOOS: windows | |
GOARCH: amd64 | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
./dist/* |