Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate releases using GHA #517

Merged
merged 3 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
40 changes: 40 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -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
Loading