Compare commits
15 Commits
917002834c
...
v0.0.1-tes
| Author | SHA1 | Date | |
|---|---|---|---|
| d327bedf04 | |||
| 8c5eff79cc | |||
| 0ba6df60b0 | |||
| 1733d7b1cc | |||
| a4f3f1fef3 | |||
| 9b0a5dcb4c | |||
| 15759ec42d | |||
| 6fbf9a68cf | |||
| cdf661734f | |||
| 4b12c90e50 | |||
| a3bc91bdaf | |||
| 1d12134314 | |||
| cd90a9c1b3 | |||
| 60c9f99525 | |||
| aded7dba33 |
@@ -5,41 +5,52 @@ on:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
env:
|
||||
GOPROXY: "https://mirrors.aliyun.com/goproxy/,direct"
|
||||
GOSUMDB: "off"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: golang:1.26-alpine
|
||||
env:
|
||||
GOPROXY: "https://mirrors.aliyun.com/goproxy/,direct"
|
||||
steps:
|
||||
- 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
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.26'
|
||||
- name: Download dependencies
|
||||
run: go mod download
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
platforms=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64" "windows/amd64")
|
||||
for p in "${platforms[@]}"; do
|
||||
for p in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64; do
|
||||
os=${p%/*}
|
||||
arch=${p#*/}
|
||||
ext=""
|
||||
[ "$os" = "windows" ] && ext=".exe"
|
||||
output="yoo-${os}-${arch}${ext}"
|
||||
GOOS=$os GOARCH=$arch go build -o "$output" ./cmd/yoyo
|
||||
GOOS=$os GOARCH=$arch go build -buildvcs=false -o "yoo-${os}-${arch}${ext}" ./cmd/yoyo
|
||||
done
|
||||
|
||||
- name: Checksums
|
||||
run: sha256sum yoo-* > checksums.txt
|
||||
|
||||
- name: Release
|
||||
uses: gitea/gitea-release-action@v1
|
||||
with:
|
||||
files: |
|
||||
yoo-*
|
||||
checksums.txt
|
||||
token: ${{ secrets.release_token }}
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.release_token }}
|
||||
run: |
|
||||
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
||||
|
||||
# 创建 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
|
||||
Reference in New Issue
Block a user