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:
|
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
|
||||||
Reference in New Issue
Block a user