91 lines
2.3 KiB
YAML
91 lines
2.3 KiB
YAML
name: Go releaser
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
- '!*.*.*-rc*'
|
|
- '!*.*.*-beta*'
|
|
- '!*.*.*-alpha*'
|
|
- '!*.*.*-dev*'
|
|
|
|
permissions: read-all
|
|
|
|
jobs:
|
|
goreleaser:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: ./go.mod
|
|
- name: Test
|
|
uses: eat-pray-ai/yutu/.github/actions/test@main
|
|
- name: Run goreleaser
|
|
uses: goreleaser/goreleaser-action@v6
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
distribution: goreleaser
|
|
args: release --clean
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: binary
|
|
path: dist/yutu_*/yutu-*
|
|
|
|
attestation:
|
|
needs: [goreleaser]
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
attestations: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
path:
|
|
- darwin_amd64_v1/yutu-darwin-amd64
|
|
- darwin_arm64_v8.0/yutu-darwin-arm64
|
|
- linux_amd64_v1/yutu-linux-amd64
|
|
- linux_arm64_v8.0/yutu-linux-arm64
|
|
- windows_amd64_v1/yutu-windows-amd64.exe
|
|
- windows_arm64_v8.0/yutu-windows-arm64.exe
|
|
steps:
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v5
|
|
with:
|
|
name: binary
|
|
- name: Attest
|
|
uses: actions/attest-build-provenance@v3
|
|
with:
|
|
subject-path: '${{ github.workspace }}/yutu_${{ matrix.path }}'
|
|
|
|
winget:
|
|
needs: [goreleaser]
|
|
runs-on: windows-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
steps:
|
|
- uses: vedantmgoyal9/winget-releaser@main
|
|
with:
|
|
identifier: eat-pray-ai.yutu
|
|
installers-regex: '\.exe$' # Only .exe files
|
|
token: ${{ secrets.RELEASE_PAT }}
|
|
max-versions-to-keep: 3
|
|
|
|
github-registry:
|
|
needs: [goreleaser]
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
attestations: write
|
|
id-token: write
|
|
steps:
|
|
- uses: eat-pray-ai/yutu/.github/actions/github-packages@main
|