From 4388f93e595b1c8f98b609d02368ee340d805421 Mon Sep 17 00:00:00 2001 From: Matheus Moraes Date: Wed, 5 Apr 2023 09:33:21 -0300 Subject: [PATCH] Add goreleaser (#212) * goreleaser init * add goreleaser steps on release workflow * auto prerelease * add copyright --- .github/workflows/release.yaml | 34 +++++++++++++++++++++++++++++++++- .gitignore | 2 ++ .goreleaser.yaml | 29 +++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f178d6d9..512c65d2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -5,6 +5,10 @@ on: tags: - "v[0-9]+.[0-9]+.[0-9]+*" +permissions: + contents: write + packages: write + env: CHARTS_REPOSITORY_PATH: charts.undistro.io CHART_PATH: charts/zora @@ -16,10 +20,38 @@ jobs: docker: uses: ./.github/workflows/docker.yaml secrets: inherit + + goreleaser: + name: Create GitHub release + runs-on: ubuntu-latest + needs: [docker] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Fetch tags + run: git fetch --force --tags + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: stable + + - name: Release + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + helm: name: Update Helm repository runs-on: ubuntu-latest - needs: [docker] + needs: [goreleaser] steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index 3cfd1857..27363f84 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ testbin/* *~ site/ + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 00000000..38f91546 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,29 @@ +# Copyright 2023 Undistro Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +builds: + - skip: true + +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' +release: + prerelease: auto