From e57a06d258b22e1feee0f5ddcc9a4f173257a42f Mon Sep 17 00:00:00 2001 From: YANGJINZE Date: Wed, 21 May 2025 15:45:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?ci/cd:=20=E6=96=B0=E5=A2=9E=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/goreleaser.yml | 36 ++++++++++++++++++++++++++++++++ .goreleaser.yml | 32 ++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/goreleaser.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 0000000..dccd180 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,36 @@ +name: goreleaser + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution + # GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..e6d6578 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,32 @@ +# .goreleaser.yml +version: 2 +before: + hooks: + - rm -rf frontend + - mv build frontend +release: + disable: false +archives: + - format: tar.gz + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - LICENSE + - frontend +checksum: + name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt" +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - amd64 + - arm + - arm64 + goarm: + - "7" + ignore: + - goos: windows + goarch: arm \ No newline at end of file From 42616230b9fbc1c2bd71805f60654243132c61ae Mon Sep 17 00:00:00 2001 From: YANGJINZE <91786638+KincaidYang@users.noreply.github.com> Date: Wed, 21 May 2025 16:44:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?ci/cd:=20=E8=B0=83=E6=95=B4=E6=B5=81?= =?UTF-8?q?=E6=B0=B4=E7=BA=BF=E8=87=AA=E5=8A=A8=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .goreleaser.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index e6d6578..4d0c8a7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -17,6 +17,7 @@ checksum: builds: - env: - CGO_ENABLED=0 + main: ./cmd goos: - linux - darwin @@ -29,4 +30,4 @@ builds: - "7" ignore: - goos: windows - goarch: arm \ No newline at end of file + goarch: arm