From e99ff86798bd9cf6886c723cac410e7f12ec5315 Mon Sep 17 00:00:00 2001 From: mei Date: Mon, 6 Oct 2025 21:37:30 +0800 Subject: [PATCH] feat: ci --- .github/workflows/go-ossf-slsa3-publish.yml | 38 --------------------- .github/workflows/release.yml | 23 +++++++++++++ .slsa-goreleaser.yml | 9 ----- 3 files changed, 23 insertions(+), 47 deletions(-) delete mode 100644 .github/workflows/go-ossf-slsa3-publish.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .slsa-goreleaser.yml diff --git a/.github/workflows/go-ossf-slsa3-publish.yml b/.github/workflows/go-ossf-slsa3-publish.yml deleted file mode 100644 index f70a4da..0000000 --- a/.github/workflows/go-ossf-slsa3-publish.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow lets you compile your Go project using a SLSA3 compliant builder. -# This workflow will generate a so-called "provenance" file describing the steps -# that were performed to generate the final binary. -# The project is an initiative of the OpenSSF (openssf.org) and is developed at -# https://github.com/slsa-framework/slsa-github-generator. -# The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier. -# For more information about SLSA and how it improves the supply-chain, visit slsa.dev. - -name: SLSA Go releaser -on: - workflow_dispatch: - release: - types: [created] - -permissions: read-all - -jobs: - # ======================================================================================================================================== - # Prerequesite: Create a .slsa-goreleaser.yml in the root directory of your project. - # See format in https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/go/README.md#configuration-file - #========================================================================================================================================= - build: - permissions: - id-token: write # To sign. - contents: write # To upload release assets. - actions: read # To read workflow path. - uses: slsa-framework/slsa-github-generator/.github/workflows/builder_go_slsa3.yml@v2.1.0 - with: - go-version: 1.23 - # ============================================================================================================= - # Optional: For more options, see https://github.com/slsa-framework/slsa-github-generator#golang-projects - # ============================================================================================================= - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..54cc69a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release +on: + workflow_dispatch: + push: + tags: + - '*' +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + version: '~> v2' + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.slsa-goreleaser.yml b/.slsa-goreleaser.yml deleted file mode 100644 index fc3f7ac..0000000 --- a/.slsa-goreleaser.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: 1 -builds: - - main: . - binary: goodbaby - GOOS: - - linux - - windows - GOARCH: - - amd64 \ No newline at end of file