Update build.yml #4
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 Git Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
windows: | |
name: "Build for Windows" | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.2' | |
- name: Get dependencies | |
run: go get . | |
- name: Build | |
run: go build -o 'mobing-windows.exe' -ldflags '-s' . | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: "mobing-windows" | |
path: "mobing-windows.exe" | |
linux: | |
name: "Build for Linux" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.2' | |
- name: Get C dependencies | |
run: sudo apt-get install golang gcc libgl1-mesa-dev xorg-dev | |
- name: Get Go dependencies | |
run: go get . | |
- name: Build | |
run: go build -o 'mobing-linux' -ldflags '-s' . | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: "mobing-linux" | |
path: "mobing-linux" |