diff --git a/.github/workflows/cosmovisor-release.yml b/.github/workflows/cosmovisor-release.yml new file mode 100644 index 0000000000..57b746b870 --- /dev/null +++ b/.github/workflows/cosmovisor-release.yml @@ -0,0 +1,34 @@ +name: Release Cosmovisor + +on: + push: + tags: + - "cosmovisor/v*.*.*" +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-go@v2.1.4 + with: + go-version: 1.17 + # get 'v*.*.*' part from 'cosmovisor/v*.*.*' and save to $GITHUB_ENV + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/cosmovisor/}" >> $GITHUB_ENV + # remove the possible pre-existing same tag for cosmos-sdk related tags instead of cosmovisor tags + # Because goreleaser enforces semantic versioning and will error on non compliant tags.(https://goreleaser.com/limitations/semver/) + - name: Tag without prefix locally to avoid error in goreleaser + run: |- + git tag -d ${{ env.RELEASE_VERSION }} || echo "No such a tag exists before" + git tag ${{ env.RELEASE_VERSION }} HEAD + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist --skip-validate + workdir: cosmovisor + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GORELEASER_CURRENT_TAG: cosmovisor/${{ env.RELEASE_VERSION }} diff --git a/cosmovisor/.goreleaser.yml b/cosmovisor/.goreleaser.yml new file mode 100644 index 0000000000..3cb3f9a5f8 --- /dev/null +++ b/cosmovisor/.goreleaser.yml @@ -0,0 +1,40 @@ +project_name: cosmovisor + +release: + disable: false + name_template: "{{.Tag}}" + +before: + hooks: + - go mod tidy + +builds: + - main: ./cmd/cosmovisor + ldflags: + - -X 'github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor/cmd.Version={{ replace .Version "cosmovisor/" "" }}' + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + env: + - CGO_ENABLED=0 + +archives: + - name_template: '{{ replace .Version "cosmovisor/" "cosmovisor-" }}-{{ .Os }}-{{ .Arch }}' + format_overrides: + - goos: windows + format: zip + +checksum: + name_template: 'SHA256SUMS-{{ replace .Version "cosmovisor/" "cosmovisor-" }}.txt' + algorithm: sha256 +changelog: + skip: true + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'