when: - event: tag ref: refs/tags/v* steps: - name: test image: golang:1.25 commands: - go test -race ./... backend_options: kubernetes: serviceAccountName: default resources: requests: memory: 512Mi cpu: 1 limits: memory: 2Gi cpu: 2 # Build the static linux/amd64 binary and its checksum, both attached to the # Gitea release. The binary is what the puppet compilers pull at pod start. - name: build image: golang:1.25 commands: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X main.version=${CI_COMMIT_TAG}" -o encapic_linux_amd64 . - sha256sum encapic_linux_amd64 > encapic_linux_amd64.sha256 depends_on: [test] backend_options: kubernetes: serviceAccountName: default resources: requests: memory: 512Mi cpu: 1 limits: memory: 2Gi cpu: 2 # Cut a Gitea release with the binary + checksum attached. - name: release image: git.unkin.net/unkin/almalinux9-base:20260606 environment: RELEASER_TOKEN: from_secret: RELEASER_TOKEN commands: - | curl --output /usr/local/bin/tea https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/gitea-dl/tea/0.12.0/tea-0.12.0-linux-amd64 && chmod +x /usr/local/bin/tea tea logins add --name gitea --url https://git.unkin.net --token "$${RELEASER_TOKEN}" --no-version-check PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") if [ -n "$PREV_TAG" ]; then NOTES=$(git log "${PREV_TAG}..${CI_COMMIT_TAG}" --pretty=format:"- %s") else NOTES=$(git log --pretty=format:"- %s") fi tea releases create --tag "${CI_COMMIT_TAG}" --title "${CI_COMMIT_TAG}" --note "${NOTES}" --login gitea --repo "${CI_REPO}" tea releases assets create "${CI_COMMIT_TAG}" \ encapic_linux_amd64 \ encapic_linux_amd64.sha256 \ --login gitea --repo "${CI_REPO}" depends_on: [build] backend_options: kubernetes: serviceAccountName: default resources: requests: memory: 128Mi cpu: 100m limits: memory: 512Mi cpu: 500m