- Move version out of cmd/root.go hardcode into an ldflags-injected var. Makefile derives from 'git describe --tags --always --dirty'; plain 'go build' / 'go run' get 'dev'. Release builds will get the tag via goreleaser. - Add .goreleaser.yaml: multi-platform (linux/darwin/windows/freebsd × amd64/arm64/arm) builds with SHA256 checksums, tar.gz/zip archives, forgejo release publishing. No GPG/S3 yet — deferred until a key is provisioned. - Add .gitea/workflows/release.yml to run goreleaser on tag push. Uses built-in GITEA_TOKEN with override via RELEASE_TOKEN secret. - Align CI Go version with go.mod (1.24). Previously CI ran 1.21, which would have silently missed any 1.22+ feature use. - Move itchyny/gojq from indirect to direct (it's used in api.go). Drop stale x/sys v0.33.0 entry from go.sum. - Ignore dist/ and bin/ in .gitignore. - CHANGELOG: document v0.3.1 fix and Unreleased development changes.
83 lines
2.1 KiB
YAML
83 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: codeberg-small
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: https://github.com/actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
cache: true
|
|
|
|
- name: Install golangci-lint
|
|
run: |
|
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.6.2
|
|
|
|
- name: Run golangci-lint
|
|
run: golangci-lint run --timeout 5m
|
|
|
|
build:
|
|
runs-on: codeberg-small
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: https://github.com/actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
cache: true
|
|
|
|
- name: Build application
|
|
run: make build
|
|
|
|
test:
|
|
runs-on: codeberg-small
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: https://github.com/actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
cache: true
|
|
|
|
- name: Run unit tests
|
|
run: go test -v -race ./...
|
|
|
|
functional:
|
|
runs-on: codeberg-small
|
|
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
|
|
needs: [build, test]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://github.com/actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: https://github.com/actions/setup-go@v5
|
|
with:
|
|
go-version: '1.24'
|
|
cache: true
|
|
|
|
- name: Build production binary
|
|
run: |
|
|
make build
|
|
echo "Binary built at: $(pwd)/bin/fgj"
|
|
|
|
- name: Run functional tests
|
|
run: go test -v -race -tags=functional ./tests/functional/...
|
|
env:
|
|
CODEBERG_TEST_TOKEN: ${{ secrets.CODEBERG_TEST_TOKEN }}
|
|
CODEBERG_TEST_OWNER: ${{ vars.CODEBERG_TEST_OWNER }}
|
|
CODEBERG_TEST_REPO: ${{ vars.CODEBERG_TEST_REPO }}
|
|
CODEBERG_TEST_HOSTNAME: ${{ vars.CODEBERG_TEST_HOSTNAME || 'codeberg.org' }}
|