|
| 1 | +name: Go releaser |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + |
| 8 | +permissions: read-all |
| 9 | + |
| 10 | +jobs: |
| 11 | + goreleaser: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Test |
| 15 | + uses: eat-pray-ai/yutu/.github/actions/test@main |
| 16 | + - name: Run goreleaser |
| 17 | + uses: goreleaser/goreleaser-action@v6 |
| 18 | + env: |
| 19 | + GITHUB_TOKEN: ${{ github.token }} |
| 20 | + with: |
| 21 | + distribution: goreleaser |
| 22 | + args: release --clean --snapshot |
| 23 | + - name: Upload artifact |
| 24 | + uses: actions/upload-artifact@v4 |
| 25 | + with: |
| 26 | + path: dist |
| 27 | + |
| 28 | + attestation: |
| 29 | + needs: [goreleaser] |
| 30 | + runs-on: ubuntu-latest |
| 31 | + permissions: |
| 32 | + id-token: write |
| 33 | + contents: read |
| 34 | + attestations: write |
| 35 | + strategy: |
| 36 | + fail-fast: false |
| 37 | + matrix: |
| 38 | + path: |
| 39 | + - darwin_amd64_v1/yutu |
| 40 | + - darwin_arm64/yutu |
| 41 | + - linux_amd64_v1/yutu |
| 42 | + - linux_arm64/yutu |
| 43 | + - windows_amd64_v1/yutu.exe |
| 44 | + - windows_arm64/yutu.exe |
| 45 | + steps: |
| 46 | + - name: Download artifact |
| 47 | + uses: actions/download-artifact@v4 |
| 48 | + with: |
| 49 | + name: dist/yutu_{{ matrix.path }} |
| 50 | + - name: Attest |
| 51 | + uses: actions/attest-build-provenance@v1 |
| 52 | + with: |
| 53 | + subject-path: '${{ github.workspace }}/dist/yutu_${{ matrix.path }}' |
| 54 | + |
| 55 | + winget: |
| 56 | + needs: [goreleaser] |
| 57 | + runs-on: windows-latest |
| 58 | + if: startsWith(github.ref, 'refs/tags/') |
| 59 | + steps: |
| 60 | + - uses: vedantmgoyal9/winget-releaser@main |
| 61 | + with: |
| 62 | + identifier: eat-pray-ai.yutu |
| 63 | + installers-regex: '\.exe$' # Only .exe files |
| 64 | + token: ${{ secrets.RELEASE_PAT }} |
| 65 | + max-versions-to-keep: 3 |
| 66 | + |
| 67 | + homebrew: |
| 68 | + needs: [goreleaser] |
| 69 | + runs-on: macos-latest |
| 70 | + if: false |
| 71 | + steps: |
| 72 | + - uses: dawidd6/action-homebrew-bump-formula@v3 |
| 73 | + with: |
| 74 | + token: ${{ secrets.RELEASE_PAT }} |
| 75 | + tag: ${{ github.event.release.tag_name }} |
| 76 | + org: eat-pray-ai |
| 77 | + formula: yutu |
| 78 | + |
| 79 | + github-package: |
| 80 | + needs: [goreleaser] |
| 81 | + runs-on: ubuntu-latest |
| 82 | + if: startsWith(github.ref, 'refs/tags/') |
| 83 | + permissions: |
| 84 | + contents: read |
| 85 | + packages: write |
| 86 | + attestations: write |
| 87 | + id-token: write |
| 88 | + steps: |
| 89 | + - uses: eat-pray-ai/yutu/.github/actions/github-packages@main |
| 90 | + with: |
| 91 | + version: ${{ github.event.release.tag_name }} |
0 commit comments