diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..000157a --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -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 }} \ No newline at end of file