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: '24' - 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.1-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 install npm run build cp -r dist ../cmd/app/frontend/dist - name: Build desktop app run: | cd cmd/app wails build -trimpath -ldflags="-s -w" -tags webkit2_41 cp build/bin/waste ../../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, '-') }}