Skip to content

SkyeCraft

SkyeCraft #1

Workflow file for this run

name: Go Cross-Platform Build
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go-version: ['1.20']
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Install dependencies
run: go mod download
- name: Build for ${{ matrix.os }}
run: |
if [[ "$RUNNER_OS" == "Linux" ]]; then
GOOS=linux GOARCH=amd64 go build -o builds/SkyeCraft-linux
elif [[ "$RUNNER_OS" == "macOS" ]]; then
go build -o builds/SkyeCraft-macOS
elif [[ "$RUNNER_OS" == "Windows" ]]; then
GOOS=windows GOARCH=amd64 go build -ldflags="-H windowsgui" -o builds/SkyeCraft.exe
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: SkyeCraft
path: builds/