Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de49d6ff85 | ||
| d71b2ce468 | |||
|
|
523499ba9f | ||
| 778fe67be0 | |||
|
|
b957d3c92c |
38
.github/workflows/release.yml
vendored
38
.github/workflows/release.yml
vendored
@@ -9,6 +9,9 @@ on:
|
||||
- 'v*.*.*'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -23,8 +26,11 @@ jobs:
|
||||
|
||||
- name: Install gf CLI
|
||||
run: |
|
||||
go install github.com/gogf/gf/cmd/gf@latest
|
||||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
curl -L -o gf https://github.com/gogf/gf/releases/latest/download/gf_linux_amd64
|
||||
chmod +x gf
|
||||
mkdir -p "$HOME/bin"
|
||||
mv gf "$HOME/bin/gf"
|
||||
echo "$HOME/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Verify gf
|
||||
run: gf -v
|
||||
@@ -52,12 +58,38 @@ jobs:
|
||||
name: uploads3-${{ github.ref_name }}
|
||||
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
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag_name: ${{ github.ref_name }}
|
||||
name: ${{ github.ref_name }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
files: |
|
||||
bin/**
|
||||
dist/*
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
gfcli:
|
||||
build:
|
||||
name: "uploads3"
|
||||
arch: "amd64,arm,arm64"
|
||||
system: "windows,android,linux"
|
||||
arch: "amd64"
|
||||
system: "windows,linux"
|
||||
mod: "none"
|
||||
packSrc: "hack,resource,manifest"
|
||||
version: "v1.0.0"
|
||||
# version: "v1.0.0"
|
||||
path: "./bin"
|
||||
extra: -trimpath -ldflags="-s -w"
|
||||
# cgo: true
|
||||
|
||||
Reference in New Issue
Block a user