2021-09-29 13:58:39 +00:00
|
|
|
# This workflow helps with creating releases.
|
|
|
|
# This job will only be triggered when a tag (vX.X.x) is pushed
|
|
|
|
name: Release
|
2021-07-16 09:30:34 +00:00
|
|
|
on:
|
|
|
|
push:
|
2021-09-29 13:58:39 +00:00
|
|
|
# Sequence of patterns matched against refs/tags
|
2021-07-16 09:30:34 +00:00
|
|
|
tags:
|
2021-09-29 13:58:39 +00:00
|
|
|
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
|
|
|
|
|
2021-07-16 09:30:34 +00:00
|
|
|
jobs:
|
2021-09-29 13:58:39 +00:00
|
|
|
release:
|
2021-07-16 09:30:34 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
2021-09-29 13:58:39 +00:00
|
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-go@v2.1.4
|
2021-07-16 09:30:34 +00:00
|
|
|
with:
|
2021-09-03 16:54:34 +00:00
|
|
|
go-version: 1.17
|
2021-09-29 13:58:39 +00:00
|
|
|
- name: Set Env
|
|
|
|
run: echo "TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::')" >> $GITHUB_ENV
|
|
|
|
- name: Build
|
|
|
|
uses: goreleaser/goreleaser-action@v2.7.0
|
|
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: build --rm-dist --skip-validate # skip validate skips initial sanity checks in order to be able to fully run
|
|
|
|
env:
|
|
|
|
TM_VERSION: ${{ env.TM_VERSION }}
|
|
|
|
- name: Release
|
|
|
|
uses: goreleaser/goreleaser-action@v2
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --rm-dist --release-notes ./RELEASE_NOTES.md
|
2021-07-16 09:30:34 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-09-29 13:58:39 +00:00
|
|
|
TM_VERSION: ${{ env.TM_VERSION }}
|