name: ci # Gitea Actions (repo has Actions enabled; needs one Linux runner whose # `ubuntu-latest` label maps to a Debian/Ubuntu-based image, e.g. the default # catthehacker/ubuntu:act-latest). Everything runs on that single runner: # tefterd is CGO-free and cross-compiles to all four platforms from Linux. # The macOS/Windows *desktop* shells can't be built on a Linux runner — build # those manually with `make desktop` on such a machine (see README). on: push: branches: ['**'] tags: ['v*'] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: { go-version: 'stable' } - uses: actions/setup-node@v4 with: { node-version: '22' } - name: Build frontend run: make frontend - name: Embed bundle run: rm -rf server/webdist/dist && cp -r frontend/dist server/webdist/dist - name: Vet + tests run: cd server && go vet ./... && go test ./... - name: Type-check frontend run: cd frontend && npx svelte-check --tsconfig ./tsconfig.json release: needs: test if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: { go-version: 'stable' } - uses: actions/setup-node@v4 with: { node-version: '22' } - name: Desktop build deps (GTK/WebKit) run: | if command -v sudo >/dev/null; then SUDO=sudo; else SUDO=; fi $SUDO apt-get update $SUDO apt-get install -y --no-install-recommends \ build-essential pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev libx11-dev - name: Install Wails CLI run: go install github.com/wailsapp/wails/v2/cmd/wails@latest - name: Build tefterd for all platforms run: make server-all VERSION=${{ github.ref_name }} - name: Build desktop (linux/amd64) run: | rm -rf desktop/frontend/dist cp -r frontend/dist desktop/frontend/dist cd desktop && PATH="$PATH:$(go env GOPATH)/bin" \ wails build -tags webkit2_41 -ldflags "-X main.Version=${{ github.ref_name }}" - name: Package artifacts run: | mkdir -p out pkg cp build/tefterd-* out/ cp desktop/build/bin/tefter-desktop pkg/ cp desktop/tefter.desktop pkg/ cp frontend/public/icon-512.png pkg/tefter.png tar -C pkg -czf out/tefter-desktop-linux-amd64.tar.gz . ls -la out/ - name: Create Gitea release uses: https://gitea.com/actions/release-action@main with: files: out/** api_key: '${{ secrets.GITHUB_TOKEN }}'