From 6d1475a708cc2970ab72b9c97f7a8595ae1f9c02 Mon Sep 17 00:00:00 2001 From: Yuvraj Date: Mon, 15 Nov 2021 04:58:05 +0530 Subject: [PATCH] Added goreleaser for release notes (#25) --- .github/workflows/pull_request.yml | 17 ++++++++++++- .github/workflows/release.yml | 26 +++++++++++++++++++ .goreleaser.yml | 41 ++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 593ed28..fd58431 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -52,4 +52,19 @@ jobs: env: GO111MODULE: "on" with: - args: make install && make lint \ No newline at end of file + args: make install && make lint + + dry-run-gorelease: + name: Dry run goreleaser + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '1.16' + - name: Run GoReleaser dry run + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: --snapshot --skip-publish --rm-dist diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fff2994 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release Flytecopilot + +on: + push: + tags: + - 'v*' + +jobs: + releaser: + name: Release flytecopilot + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: "0" + - uses: actions/setup-go@v2 + with: + go-version: '1.16' + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..2362090 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,41 @@ +project_name: flytecopilot +before: + hooks: + - go mod download +builds: + - id: flytecopilot + env: + - CGO_ENABLED=0 + main: ./main.go + ldflags: + - -s -w -X github.com/flyteorg/flytestdlib/version.Version={{.Version}} -X github.com/flyteorg/flytestdlib/version.Build={{.ShortCommit}} -X github.com/flyteorg/flytestdlib/version.BuildTime={{.Date}} + binary: flytecopilot + goos: + - linux + - windows + - darwin +archives: + - id: flytecopilot-archive + name_template: |- + flytecopilot_{{ .Tag }}_{{ .Os }}_{{ .Arch -}} + {{- with .Arm -}} + {{- if (eq . "6") -}}hf + {{- else -}}v{{- . -}} + {{- end -}} + {{- end -}} + builds: + - flytecopilot + replacements: + 386: i386 + amd64: x86_64 + format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'