From db36804bfaaaf2a1cc5aadcd59cb508d11e3ed49 Mon Sep 17 00:00:00 2001 From: ginuerzh Date: Tue, 31 Jan 2023 21:24:16 +0800 Subject: [PATCH] add goreleaser github action --- .github/workflows/buildx.yaml | 4 ++-- .github/workflows/release.yml | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/buildx.yaml b/.github/workflows/buildx.yaml index 0ebf5d5..1ce065e 100644 --- a/.github/workflows/buildx.yaml +++ b/.github/workflows/buildx.yaml @@ -1,7 +1,7 @@ # ref: https://docs.docker.com/ci-cd/github-actions/ # https://blog.oddbit.com/post/2020-09-25-building-multi-architecture-im/ -name: Docker +name: docker on: push: @@ -57,7 +57,7 @@ jobs: # https://github.com/actions/checkout - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Docker Buildx (no push) run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e5e3f10 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: goreleaser + +on: + push: + # run only against tags + tags: + - 'v*' + +permissions: + contents: write + # packages: write + # issues: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: git fetch --force --tags + - uses: actions/setup-go@v3 + with: + go-version: '1.19' + cache: true + # More assembly might be required: Docker logins, GPG, etc. It all depends + # on your needs. + - uses: goreleaser/goreleaser-action@v4 + 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 }}