15 Commits

Author SHA1 Message Date
d327bedf04 fix: add -buildvcs=false flag and remove debug step
Some checks failed
Release / build (push) Failing after 5m39s
2026-04-07 08:40:40 +08:00
8c5eff79cc fix: use current dir instead of /workspace
Some checks failed
Release / build (push) Failing after 1m3s
2026-04-07 08:29:30 +08:00
0ba6df60b0 fix: copy files to /workspace and add debug step
Some checks failed
Release / build (push) Failing after 29s
2026-04-07 08:28:17 +08:00
1733d7b1cc fix: clone to subdir then move files to root
Some checks failed
Release / build (push) Failing after 58s
2026-04-07 08:24:47 +08:00
a4f3f1fef3 fix: use relative path for build instead of module name
Some checks failed
Release / build (push) Failing after 48s
2026-04-07 08:23:19 +08:00
9b0a5dcb4c fix: clone dev branch
Some checks failed
Release / build (push) Failing after 1m26s
2026-04-07 08:19:53 +08:00
15759ec42d fix: add go mod download before build
Some checks failed
Release / build (push) Failing after 46s
2026-04-07 08:18:28 +08:00
6fbf9a68cf fix: use module name instead of file path
Some checks failed
Release / build (push) Failing after 31s
2026-04-07 08:17:19 +08:00
cdf661734f fix: install git before clone
Some checks failed
Release / build (push) Failing after 21s
2026-04-07 08:15:35 +08:00
4b12c90e50 refactor: use golang:alpine container with direct clone
Some checks failed
Release / build (push) Failing after 2m30s
2026-04-07 08:12:22 +08:00
a3bc91bdaf fix: build path should point to main.go
Some checks failed
Release / build (push) Failing after 1m47s
2026-04-07 08:06:56 +08:00
1d12134314 fix: use curl to create release instead of external action
Some checks failed
Release / build (push) Failing after 5m9s
2026-04-07 08:00:28 +08:00
cd90a9c1b3 fix: use mirrored gitea-release-action
Some checks failed
Release / build (push) Failing after 19s
2026-04-07 07:58:38 +08:00
60c9f99525 fix: use gitea-release-action directly
Some checks failed
Release / build (push) Failing after 14s
2026-04-07 07:53:15 +08:00
aded7dba33 fix: use curl instead of external action
Some checks failed
Release / build (push) Has been cancelled
2026-04-07 07:51:56 +08:00

View File

@@ -5,41 +5,52 @@ on:
tags: tags:
- 'v*' - 'v*'
env:
GOPROXY: "https://mirrors.aliyun.com/goproxy/,direct"
GOSUMDB: "off"
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: golang:1.26-alpine
env:
GOPROXY: "https://mirrors.aliyun.com/goproxy/,direct"
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 run: |
apk add git
git clone -b dev https://hub.gaomia.site/titor/yoyo.git project
cp -r project/* .
cp -r project/.* . 2>/dev/null || true
- name: Set up Go - name: Download dependencies
uses: actions/setup-go@v5 run: go mod download
with:
go-version: '1.26'
- name: Build - name: Build
run: | run: |
platforms=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64" "windows/amd64") for p in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64; do
for p in "${platforms[@]}"; do
os=${p%/*} os=${p%/*}
arch=${p#*/} arch=${p#*/}
ext="" ext=""
[ "$os" = "windows" ] && ext=".exe" [ "$os" = "windows" ] && ext=".exe"
output="yoo-${os}-${arch}${ext}" GOOS=$os GOARCH=$arch go build -buildvcs=false -o "yoo-${os}-${arch}${ext}" ./cmd/yoyo
GOOS=$os GOARCH=$arch go build -o "$output" ./cmd/yoyo
done done
- name: Checksums - name: Checksums
run: sha256sum yoo-* > checksums.txt run: sha256sum yoo-* > checksums.txt
- name: Release - name: Release
uses: gitea/gitea-release-action@v1 env:
with: GITEA_TOKEN: ${{ secrets.release_token }}
files: | run: |
yoo-* TAG_NAME="${GITHUB_REF#refs/tags/}"
checksums.txt
token: ${{ secrets.release_token }} # 创建 Release
curl -s -X POST "https://hub.gaomia.site/api/v1/repos/titor/yoyo/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"${TAG_NAME}\",\"name\":\"${TAG_NAME}\",\"body\":\"Automated release\"}"
# 上传产物
for f in yoo-* checksums.txt; do
[ -f "$f" ] && curl -s -X POST "https://hub.gaomia.site/api/v1/repos/titor/yoyo/releases/upload?name=${TAG_NAME}" \
-H "Authorization: token ${GITEA_TOKEN}" \
-F "attachment=@$f"
done