6 Commits

Author SHA1 Message Date
a2fee18b43 降低不支持的编译版本
All checks were successful
Release / build (push) Successful in 14m45s
Release / release (push) Successful in 3m31s
2025-11-04 16:05:00 +08:00
6bbb25546b 增加更多的编译平台
Some checks failed
Release / build (push) Failing after 5m3s
Release / release (push) Has been skipped
2025-10-30 15:53:06 +08:00
乔焰阳
de49d6ff85 Enhance release workflow with artifact packaging
Some checks failed
Release / build (push) Failing after 40s
Release / release (push) Has been skipped
Add packaging step for binaries and checksums in release workflow.
2025-10-30 15:40:58 +08:00
d71b2ce468 提高打包速度,只打包x64 2025-10-30 15:34:39 +08:00
乔焰阳
523499ba9f Add permissions and token to release workflow
Some checks failed
Release / build (push) Failing after 1m17s
Release / release (push) Has been skipped
2025-10-30 15:29:49 +08:00
778fe67be0 不按照版本号打包
Some checks failed
Release / build (push) Failing after 1m15s
Release / release (push) Has been skipped
2025-10-30 15:23:44 +08:00
2 changed files with 35 additions and 6 deletions

View File

@@ -9,6 +9,9 @@ on:
- 'v*.*.*' - 'v*.*.*'
workflow_dispatch: workflow_dispatch:
permissions:
contents: write
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -36,7 +39,7 @@ jobs:
run: gf build -ew -v "${{ github.ref_name }}" run: gf build -ew -v "${{ github.ref_name }}"
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3 # 降级为 v3兼容 Gitea
with: with:
name: uploads3-${{ github.ref_name }} name: uploads3-${{ github.ref_name }}
path: | path: |
@@ -50,17 +53,43 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3 # 降级为 v3与上传版本匹配
with: with:
name: uploads3-${{ github.ref_name }} name: uploads3-${{ github.ref_name }}
path: bin path: bin
- name: Package artifacts
run: |
set -euo pipefail
mkdir -p dist
# Find all built binaries recursively and package with unique names per platform/arch
mapfile -t files < <(find bin -type f \( -name 'uploads3' -o -name 'uploads3.exe' \))
for f in "${files[@]}"; do
dir="$(dirname "$f")"
base="$(basename "$f")"
plat_arch="$(basename "$dir")" # expects linux_amd64, windows_amd64, etc.
case "$plat_arch" in
windows_*)
zip_name="uploads3_${{ github.ref_name }}_${plat_arch}.zip"
(cd "$dir" && zip -9 "${GITHUB_WORKSPACE}/dist/${zip_name}" "$base")
;;
*)
tar_name="uploads3_${{ github.ref_name }}_${plat_arch}.tar.gz"
(cd "$dir" && tar -czf "${GITHUB_WORKSPACE}/dist/${tar_name}" "$base")
;;
esac
done
# Checksums
(cd dist && sha256sum * > SHA256SUMS.txt)
ls -al dist
- name: Create GitHub Release - name: Create GitHub Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref_name }} tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }} name: ${{ github.ref_name }}
draft: false draft: false
prerelease: false prerelease: false
files: | files: |
bin/** dist/*

View File

@@ -4,11 +4,11 @@
gfcli: gfcli:
build: build:
name: "uploads3" name: "uploads3"
arch: "amd64,arm,arm64" arch: "amd64,386,arm,arm64"
system: "windows,android,linux" system: "windows,linux,darwin,freebsd,netbsd,openbsd"
mod: "none" mod: "none"
packSrc: "hack,resource,manifest" packSrc: "hack,resource,manifest"
version: "v1.0.0" # version: "v1.0.0"
path: "./bin" path: "./bin"
extra: -trimpath -ldflags="-s -w" extra: -trimpath -ldflags="-s -w"
# cgo: true # cgo: true