kaffeecli/.forgejo/workflows/build_release.yaml
Henner Flick 9e6beb9adc
All checks were successful
Build Klog Release / build (linux) (release) Successful in 38s
Build Klog Release / build (windows) (release) Successful in 39s
Runner for automatic compiling of releases.
2025-08-30 14:53:49 +02:00

47 lines
1.1 KiB
YAML

name: Build Klog Release
on:
release:
types: [published]
jobs:
build:
runs-on: docker # Use your Docker runner label
strategy:
matrix:
os: [linux, windows]
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build
run: |
if [ "${{ matrix.os }}" == "windows" ]; then
GOOS=windows GOARCH=amd64 go build -o klog.exe main.go
else
GOOS=linux GOARCH=amd64 go build -o klog main.go
fi
- name: Upload release assets via Forgejo API
env:
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
FORGEJO_URL: https://dev.hflabs.de
REPO_OWNER: henner
REPO_NAME: kaffeecli
RELEASE_ID: ${{ github.event.release.id }}
run: |
if [ "${{ matrix.os }}" == "windows" ]; then
FILE=klog.exe
else
FILE=klog
fi
curl -H "Authorization: token $FORGEJO_TOKEN" \
-F "name=$FILE" \
-F "attachment=@$FILE" \
"$FORGEJO_URL/api/v1/repos/$REPO_OWNER/$REPO_NAME/releases/$RELEASE_ID/assets"