ci: rewrite workflow as single job to avoid upload-artifact
Some checks failed
Build / Build & release (push) Failing after 5m15s
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>
This commit is contained in:
@@ -7,55 +7,8 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ── Server binaries (no CGo, cross-compile freely) ───────────────────────────
|
build:
|
||||||
|
name: Build & release
|
||||||
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)
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -80,6 +33,31 @@ jobs:
|
|||||||
libwebkit2gtk-4.0-dev \
|
libwebkit2gtk-4.0-dev \
|
||||||
libayatana-appindicator3-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
|
- name: Build frontend
|
||||||
run: |
|
run: |
|
||||||
cd web
|
cd web
|
||||||
@@ -89,31 +67,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Build desktop app
|
- name: Build desktop app
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
|
||||||
cd cmd/app
|
cd cmd/app
|
||||||
wails build -trimpath -ldflags="-s -w" -o ../../dist/waste-linux-amd64
|
wails build -trimpath -ldflags="-s -w" -o ../../dist/waste-linux-amd64
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
# ── Publish release (tags only) ─────────────────────────────────────────
|
||||||
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/
|
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
uses: https://gitea.com/actions/gitea-release-action@main
|
uses: https://gitea.com/actions/gitea-release-action@main
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
token: ${{ secrets.RELEASE_TOKEN }}
|
||||||
files: artifacts/*/*
|
files: dist/*
|
||||||
prerelease: ${{ contains(github.ref_name, '-') }}
|
prerelease: ${{ contains(github.ref_name, '-') }}
|
||||||
|
|||||||
Reference in New Issue
Block a user