CI / build (push) Successful in 54s
A Go server that takes product uploads with hub upload tokens, checks them by t5de-api's pack rules, stores files by sha256, registers revisions with the hub (POST /api/v1/catalog/revisions), and serves files with immutable caching; files used only by adult revisions need an adult access token. Contract: t5de-hub's docs/products.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
38 lines
1.1 KiB
YAML
38 lines
1.1 KiB
YAML
# Tests the catalog and builds t5de-catalog for Linux (static) and its Docker image.
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
# T5DE's modules (t5de-api) come straight from its Gitea, not through Go's public module proxy.
|
|
GOPRIVATE: git.t5de.dev
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Test
|
|
run: |
|
|
unformatted=$(gofmt -l .)
|
|
if [ -n "$unformatted" ]; then echo "Not gofmt-formatted: $unformatted"; exit 1; fi
|
|
go vet ./...
|
|
go test ./...
|
|
|
|
# Static and reproducible: no cgo (the SQLite driver is pure Go), no paths, no build ID.
|
|
- name: Build t5de-catalog
|
|
run: |
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -buildvcs=false \
|
|
-ldflags "-s -w -buildid= -X git.t5de.dev/t5de/t5de-catalog/internal/buildinfo.Version=${GITHUB_SHA::12}" \
|
|
-o dist/t5de-catalog ./cmd/t5de-catalog
|
|
sha256sum dist/t5de-catalog
|