From b6ff30de788dfe620d9a526a5e08dac2196448d0 Mon Sep 17 00:00:00 2001 From: Fredrik Johansson Date: Sun, 28 Jun 2026 22:02:43 +0200 Subject: [PATCH] ci: rewrite workflow as single job to avoid upload-artifact MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .gitea/workflows/build.yml | 98 ++++++++++++-------------------------- 1 file changed, 30 insertions(+), 68 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 919fe81..3a94fe4 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -7,55 +7,8 @@ on: 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@v3 - 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) + build: + name: Build & release runs-on: ubuntu-latest steps: @@ -80,6 +33,31 @@ jobs: 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 @@ -89,31 +67,15 @@ jobs: - 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@v3 - 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@v3 - with: - path: artifacts/ + # ── 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: artifacts/*/* + files: dist/* prerelease: ${{ contains(github.ref_name, '-') }}