diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..553a52c3 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,37 @@ +name: Release + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + if: ${{ !startsWith(github.ref, 'refs/tags/v') }} + run: echo "flags=--snapshot" >> $GITHUB_ENV + - + name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: 'go.mod' + cache: true + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean ${{ env.flags }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..2582bede --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,40 @@ +# To test this manually, run: +# go install github.com/goreleaser/goreleaser@latest +# goreleaser --snapshot --clean +# for f in dist/helm-diff*.tgz; do echo Testing $f...; tar tzvf $f; done +project_name: helm-diff +builds: + - id: default + main: . + binary: bin/diff + env: + - CGO_ENABLED=0 + flags: + - -trimpath + ldflags: + - -X github.com/databus23/helm-diff/v3/cmd.Version={{ .Version }} + goos: + - freebsd + - darwin + - linux + - windows + goarch: + - amd64 + - arm64 + +archives: + - id: default + builds: + - default + format: tgz + name_template: '{{ .ProjectName }}-{{ if eq .Os "darwin" }}macos{{ else }}{{ .Os }}{{ end }}-{{ .Arch }}' + wrap_in_directory: diff + files: + - README.md + - plugin.yaml + - LICENSE +changelog: + use: github-native + +release: + prerelease: auto