From fb2d15b078c3d60cf9d2b05cf81254d2da4f8dc1 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Fri, 22 Sep 2023 10:04:58 -0400 Subject: [PATCH] feat(ci): release using goreleaser --- .github/workflows/release.yml | 37 +++++++++++++++++++++++++++++++++++ .goreleaser.yml | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..04d2314 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: release + +on: + push: + tags: + - v*.*.* + +jobs: + release: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v4 + with: + go-version: ^1 + - uses: actions/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: goreleaser/goreleaser-action@v5 + with: + version: latest + distribution: goreleaser + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} + SCOOP_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} + AUR_KEY: ${{ secrets.AUR_KEY }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..96834a1 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,36 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json + +before: + hooks: + - go mod tidy + +builds: + - skip: true + +changelog: + sort: asc + use: github + filters: + exclude: + - "^test:" + - "^chore" + - "merge conflict" + - Merge pull request + - Merge remote-tracking branch + - Merge branch + - go mod tidy + groups: + - title: Dependency updates + regexp: "^.*feat\\(deps\\)*:+.*$" + order: 300 + - title: "New Features" + regexp: "^.*feat[(\\w)]*:+.*$" + order: 100 + - title: "Bug fixes" + regexp: "^.*fix[(\\w)]*:+.*$" + order: 200 + - title: "Documentation updates" + regexp: "^.*docs[(\\w)]*:+.*$" + order: 400 + - title: Other work + order: 9999