name: Build on: push: tags: - 'v*' workflow_dispatch: jobs: # ── Server binaries (no CGo, cross-compile freely) ─────────────────────────── server: name: Server binaries runs-on: ubuntu-latest strategy: matrix: include: - goos: linux goarch: amd64 - goos: linux goarch: arm64 - goos: darwin goarch: amd64 - goos: darwin goarch: arm64 - goos: windows goarch: amd64 steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version-file: go.mod - name: Build daemon + anchor env: GOOS: ${{ matrix.goos }} GOARCH: ${{ matrix.goarch }} CGO_ENABLED: "0" run: | SUFFIX="${{ matrix.goos }}-${{ matrix.goarch }}" [ "${{ matrix.goos }}" = "windows" ] && EXT=".exe" || EXT="" go build -trimpath -ldflags="-s -w" -o "dist/waste-daemon-${SUFFIX}${EXT}" ./cmd/daemon go build -trimpath -ldflags="-s -w" -o "dist/waste-anchor-${SUFFIX}${EXT}" ./cmd/anchor - uses: actions/upload-artifact@v4 with: name: server-${{ matrix.goos }}-${{ matrix.goarch }} path: dist/ # ── Desktop app (Wails, requires CGo + webview libs) ───────────────────────── # Runs only on Linux amd64 with the default runner. # For macOS/Windows desktop builds, add self-hosted runners with those platforms # and duplicate this job (adjusting the runs-on and platform deps). desktop-linux: name: Desktop app (Linux amd64) 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 - name: Build frontend run: | cd web npm ci npm run build cp -r dist ../cmd/app/frontend/dist - name: Build desktop app run: | mkdir -p dist cd cmd/app wails build -trimpath -ldflags="-s -w" -o ../../dist/waste-linux-amd64 - uses: actions/upload-artifact@v4 with: name: desktop-linux-amd64 path: dist/waste-linux-amd64 # ── Release: collect all artifacts and publish ──────────────────────────────── release: name: Publish release needs: [server, desktop-linux] runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/download-artifact@v4 with: path: artifacts/ merge-multiple: true - name: Create release uses: https://gitea.com/actions/gitea-release-action@main with: token: ${{ secrets.RELEASE_TOKEN }} files: artifacts/* prerelease: ${{ contains(github.ref_name, '-') }}