Skip to content

Commit 44939c4

Browse files
committed
👷 Use goreleaser
1 parent 79a9fa2 commit 44939c4

File tree

10 files changed

+92
-399
lines changed

10 files changed

+92
-399
lines changed

.github/workflows/go-ossf-slsa3-publish.yml

Lines changed: 0 additions & 136 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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 }}

.goreleaser.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
before:
1515
hooks:
1616
- go mod tidy
17+
- go install github.com/tc-hib/go-winres@latest
1718
- go generate ./...
1819

1920
builds:

.slsa-goreleaser/darwin-amd64.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.slsa-goreleaser/darwin-arm64.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.slsa-goreleaser/linux-amd64.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.slsa-goreleaser/linux-arm64.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)