From 5b0f9a61978cf9a4660a411207f4bf312ff7ad65 Mon Sep 17 00:00:00 2001 From: Cooper Oh Date: Tue, 17 Dec 2024 00:28:26 +0900 Subject: [PATCH] Add go releaser --- .github/workflows/release.yaml | 24 +++++++++++++++++++++ .goreleaser.yml | 39 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/release.yaml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..68c85f8 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,24 @@ +name: Release +on: + push: + tags: + - 'v*' +jobs: + goreleaser: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - uses: goreleaser/goreleaser-action@v6 + with: + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..67cf797 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,39 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +version: 2 + +project_name: gh-cherry-pick + +builds: + - binary: gh-cherry-pick + main: ./cmd/cherry-pick/ + env: + - CGO_ENABLED=0 + goos: + - darwin + - windows + - linux + goarch: + - amd64 + - arm64 + - binary: gh-pr-merged-with + main: ./cmd/pr-merged-with/ + env: + - CGO_ENABLED=0 + goos: + - darwin + - windows + - linux + goarch: + - amd64 + - arm64 + +archives: + - format: tar.gz + wrap_in_directory: true + name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ end }}" + files: + - LICENSE + - README.md + +snapshot: + name_template: "SNAPSHOT-{{ .Commit }}"