forked from umee-network/umee
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.81 KB
/
price-feeder-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Release price-feeder
on:
push:
tags:
- "price-feeder/v*.*.*"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Get Go Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/golangci-lint
~/.cache/go-build
key: ${{ runner.os }}-go-cache-${{ hashFiles('**/go.sum') }}
if: env.GIT_DIFF
# Parse 'v*.*.*' semantic version from 'price-feeder/v*.*.*' and save to
# the $GITHUB_ENV environment variable.
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/price-feeder/}" >> $GITHUB_ENV
# Remove the possible pre-existing same tag for umee related tags instead
# of price-feeder tags, since goreleaser enforces semantic versioning and
# will error on non compliant tags.
#
# Ref: 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: Release
uses: goreleaser/goreleaser-action@v3
with:
# Note, we have to pin to v0.179.0 due to newer releases enforcing
# correct semantic versioning even when '--skip-validate' is provided.
#
# Ref: https://github.com/goreleaser/goreleaser/pull/2503
version: v0.179.0
args: release --rm-dist --skip-validate
workdir: price-feeder
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: price-feeder/${{ env.RELEASE_VERSION }}