add CI
Some checks failed
release / build (amd64) (push) Failing after 20s

This commit is contained in:
peio
2026-01-18 17:23:51 +00:00
parent 166db6cbf9
commit 285db32542

View File

@@ -0,0 +1,55 @@
name: release
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64] # [amd64, arm64]
# Build in Alpine => musl toolchain
container:
image: golang:alpine
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deps (musl toolchain)
run: |
apk add --no-cache git build-base musl-dev
- name: Go env
run: |
go version
go env
- name: Build (linux/musl)
env:
GOOS: linux
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: "0"
run: |
mkdir -p dist
BIN="kc-policy-${GOOS}-${GOARCH}-musl"
go build -trimpath \
-ldflags="-s -w" \
-o "dist/${BIN}" ./cmd/kc-policy
tar -C dist -czf "dist/${BIN}.tar.gz" "${BIN}"
sha256sum "dist/${BIN}.tar.gz" > "dist/${BIN}.tar.gz.sha256"
- name: Upload assets to Gitea release
uses: https://gitea.com/actions/gitea-release-action@v1
with:
files: |
dist/*.tar.gz
dist/*.sha256
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}