add: Gitea Actions workflow for release
Some checks failed
Release / build (push) Failing after 3m17s
Some checks failed
Release / build (push) Failing after 3m17s
This commit is contained in:
45
.gitea/workflows/release.yaml
Normal file
45
.gitea/workflows/release.yaml
Normal file
@@ -0,0 +1,45 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
env:
|
||||
GOPROXY: "https://mirrors.aliyun.com/goproxy/,direct"
|
||||
GOSUMDB: "off"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.26'
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
platforms=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64" "windows/amd64")
|
||||
for p in "${platforms[@]}"; 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
|
||||
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 }}
|
||||
Reference in New Issue
Block a user