# Tests the proxy, builds t5de-proxy.exe for Windows, and publishes it: pushes to main replace the nightly # pre-release, vX.Y.Z tags make release X.Y.Z (.gitea/scripts/release.py). T5DE pins a release in its t5de.toml. 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 with: fetch-depth: 0 # versions count commits since the last release tag - uses: actions/setup-python@v5 with: python-version: "3.12" - 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 ./... GOOS=windows go vet ./... go test ./... - name: Version id: version run: python .gitea/scripts/release.py version | tee -a "$GITHUB_OUTPUT" # A GUI-subsystem program, so the client starting it opens no console window. Reproducible: no paths, no # build ID. - name: Build t5de-proxy.exe env: VERSION: ${{ steps.version.outputs.version }} run: | GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -buildvcs=false \ -ldflags "-H=windowsgui -s -w -buildid= -X git.t5de.dev/t5de/t5de-proxy/internal/buildinfo.Version=$VERSION" \ -o dist/t5de-proxy.exe ./cmd/t5de-proxy sha256sum dist/t5de-proxy.exe - name: Publish the release if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) env: GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Optional: a Discord webhook URL that nightlies are announced on. DISCORD_NIGHTLY_WEBHOOK: ${{ secrets.DISCORD_NIGHTLY_WEBHOOK }} run: python .gitea/scripts/release.py publish dist