Files
waste-go/.gitea/workflows/build.yml
Fredrik Johansson 15306dc0c2
All checks were successful
Build / Build & release (push) Successful in 13m34s
ci: use npm install instead of npm ci to avoid lockfile sync issues
The CI runner resolves @emnapi deps differently than local npm, causing
npm ci to fail regardless of Node version. npm install is more forgiving.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 23:08:49 +02:00

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: '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 -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, '-') }}