Some checks failed
Build / Build & release (push) Failing after 5m15s
Gitea act_runner intercepts actions/upload-artifact regardless of version tag and uses an incompatible built-in. Restructured as one job that builds all server binaries (cross-compiled) and the Linux desktop app, then publishes directly to the release — no artifact handoff needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
82 lines
2.4 KiB
YAML
82 lines
2.4 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build & release
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install Wails CLI
|
|
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
|
|
|
|
- name: Install platform dependencies
|
|
run: |
|
|
sudo apt-get update -q
|
|
sudo apt-get install -y \
|
|
libgtk-3-dev \
|
|
libwebkit2gtk-4.0-dev \
|
|
libayatana-appindicator3-dev
|
|
|
|
# ── Server binaries (CGO_ENABLED=0, cross-compile freely) ──────────────
|
|
|
|
- name: Build server binaries
|
|
run: |
|
|
mkdir -p dist
|
|
build() {
|
|
local GOOS=$1 GOARCH=$2
|
|
local SUFFIX="${GOOS}-${GOARCH}"
|
|
local EXT=""
|
|
[ "$GOOS" = "windows" ] && EXT=".exe"
|
|
CGO_ENABLED=0 GOOS=$GOOS GOARCH=$GOARCH \
|
|
go build -trimpath -ldflags="-s -w" \
|
|
-o "dist/waste-daemon-${SUFFIX}${EXT}" ./cmd/daemon
|
|
CGO_ENABLED=0 GOOS=$GOOS GOARCH=$GOARCH \
|
|
go build -trimpath -ldflags="-s -w" \
|
|
-o "dist/waste-anchor-${SUFFIX}${EXT}" ./cmd/anchor
|
|
}
|
|
build linux amd64
|
|
build linux arm64
|
|
build darwin amd64
|
|
build darwin arm64
|
|
build windows amd64
|
|
|
|
# ── Desktop app (Linux amd64, CGo + Wails) ─────────────────────────────
|
|
|
|
- name: Build frontend
|
|
run: |
|
|
cd web
|
|
npm ci
|
|
npm run build
|
|
cp -r dist ../cmd/app/frontend/dist
|
|
|
|
- name: Build desktop app
|
|
run: |
|
|
cd cmd/app
|
|
wails build -trimpath -ldflags="-s -w" -o ../../dist/waste-linux-amd64
|
|
|
|
# ── Publish release (tags only) ─────────────────────────────────────────
|
|
|
|
- name: Create release
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: https://gitea.com/actions/gitea-release-action@main
|
|
with:
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
|
files: dist/*
|
|
prerelease: ${{ contains(github.ref_name, '-') }}
|