新增编译脚本和 github 工作流配置文件

This commit is contained in:
2026-01-26 22:48:48 +08:00
parent 50275265ac
commit 950a9aef9d
15 changed files with 416 additions and 83 deletions

43
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build and Package
run: |
chmod +x scripts/build.sh
./scripts/build.sh ${{ github.ref_name }}
- name: Generate Changelog
id: changelog
run: |
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -z "$PREV_TAG" ]; then
git log --pretty=format:"* %s (%h)" > CHANGELOG.md
else
git log --pretty=format:"* %s (%h)" $PREV_TAG..HEAD > CHANGELOG.md
fi
echo "CHANGELOG_PATH=CHANGELOG.md" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
files: output/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

27
.github/workflows/verify.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Verify
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Install dependencies
run: go mod download
- name: Build
run: CGO_ENABLED=0 go build -v ./...
- name: Test
run: CGO_ENABLED=0 go test -v ./...