51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
name: Agent Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "agent/v*"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.23"
|
|
cache: true
|
|
cache-dependency-path: agent/go.sum
|
|
|
|
- name: Extract version
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF_NAME#agent/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build
|
|
working-directory: agent
|
|
env:
|
|
VERSION: ${{ steps.version.outputs.VERSION }}
|
|
run: |
|
|
mkdir -p dist
|
|
GOOS=linux GOARCH=amd64 go build \
|
|
-ldflags="-s -w -X main.Version=${VERSION}" \
|
|
-o dist/keymanager-agent-linux-amd64 ./cmd
|
|
GOOS=linux GOARCH=arm64 go build \
|
|
-ldflags="-s -w -X main.Version=${VERSION}" \
|
|
-o dist/keymanager-agent-linux-arm64 ./cmd
|
|
|
|
- name: Checksums
|
|
working-directory: agent/dist
|
|
run: sha256sum keymanager-agent-linux-amd64 keymanager-agent-linux-arm64 > checksums.txt
|
|
|
|
- name: Create release
|
|
uses: https://gitea.com/actions/gitea-release-action@v1
|
|
with:
|
|
token: ${{ secrets.RELEASE_TOKEN }}
|
|
files: |
|
|
agent/dist/keymanager-agent-linux-amd64
|
|
agent/dist/keymanager-agent-linux-arm64
|
|
agent/dist/checksums.txt
|