From a0936640e31b773c7ea572bd326fc5bc0b8d5778 Mon Sep 17 00:00:00 2001 From: Claudio Netto Date: Wed, 25 Mar 2020 14:48:03 -0300 Subject: [PATCH] chore(ci): release rpaasv2 plugin with goreleaser --- .github/workflows/release.yml | 23 +++++++++++++++++++++ .goreleaser.yml | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 61 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 000000000..dcf05ef76 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: git fetch --prune --unshallow + - uses: actions/setup-go@v1 + with: + go-version: 1.14.x + - uses: goreleaser/goreleaser-action@v1 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 000000000..124e757c8 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,38 @@ +builds: +- id: rpaasv2 + main: ./cmd/plugin/rpaasv2/main.go + binary: rpaasv2 + ldflags: + - -s -w -X "github.com/tsuru/rpaas-operator/version.Version={{ .Tag }}/{{ .ShortCommit }}" + env: + - CGO_ENABLED=0 + goos: + - darwin + - linux + - windows + goarch: + - amd64 + - 386 + ignore: + - goos: darwin + goarch: 386 + +archives: +- id: rpaasv2 + builds: + - rpaasv2 + name_template: "rpaasv2_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + format_overrides: + - goos: windows + format: zip + replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + files: + - LICENSE + +checksum: + name_template: "checksums.txt"