diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 57bd5a3..4b2abd7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,3 +35,34 @@ jobs: - name: Check licenses run: addlicense -l apache -check -v -ignore '**/*.yaml' -c Humanitec ./*.go ./internal/ + + release: + if: startsWith(github.ref, 'refs/tags/0.') + needs: + - test + runs-on: ubuntu-latest + permissions: write-all + steps: + - + name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - + name: Fetch all tags + run: git fetch --force --tags + - + name: Set up Go + uses: actions/setup-go@v3 + with: + go-version-file: 'go.mod' + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v3 + with: + distribution: goreleaser + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..07e2611 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,42 @@ +# Check the documentation at https://goreleaser.com +before: + hooks: + - go mod tidy +builds: + - id: score-k8s + binary: score-k8s + main: ./ + ldflags: + - -X github.com/score-spec/score-k8s/internal/version.Version={{ .Version }} + env: + - CGO_ENABLED=0 + targets: + - linux_amd64_v1 + - linux_arm64 + - windows_amd64_v1 + - darwin_amd64_v1 + - darwin_arm64 +archives: + - format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' +brews: + - name: score-k8s + homepage: "https://score.dev" + tap: + owner: score-spec + name: homebrew-tap + token: "{{ .Env.TAP_GITHUB_TOKEN }}" + commit_author: + name: rachfop + email: prachford@icloud.com