This repository has been archived on 2026-05-13. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
sfdl/.gitea/workflows/release.yaml
xkm 7850d49d70
All checks were successful
release / build-and-release (push) Successful in 23s
添加 .gitea/workflows/release.yaml
2025-12-04 19:46:26 +08:00

60 lines
1.3 KiB
YAML

name: release
on:
workflow_dispatch: {}
push:
tags:
- 'v*'
jobs:
build-and-release:
runs-on: ubuntu-latest
env:
APP_NAME: sfdl
steps:
- name: Checkout
uses: https://gitea.starryskymeow.cn/mirrors/checkout@v4
- name: Setup Go
uses: https://gitea.starryskymeow.cn/mirrors/setup-go@v5
with:
go-version: '1.25.4'
- name: Build multi-platform binaries
run: |
set -e
mkdir -p dist
platforms=(
"linux amd64"
"linux arm64"
"windows amd64"
"darwin amd64"
"darwin arm64"
)
for platform in "${platforms[@]}"; do
os=$(echo "$platform" | cut -d' ' -f1)
arch=$(echo "$platform" | cut -d' ' -f2)
ext=""
if [ "$os" = "windows" ]; then
ext=".exe"
fi
echo ">>> Building for $os/$arch"
GOOS=$os GOARCH=$arch CGO_ENABLED=0 \
go build -o "dist/${APP_NAME}-${os}-${arch}${ext}" .
done
- name: Create Gitea Release
uses: https://gitea.starryskymeow.cn/mirrors/gitea-release-action@v1
with:
token: '${{ secrets.RELEASE_TOKEN }}'
server_url: 'https://gitea.starryskymeow.cn'
files: |
dist/*