-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (62 loc) · 2.68 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
name: release
# Trigger the workflow when:
on:
# A push occurs to one of the matched tags.
push:
tags:
# Pattern that roughly matches Oasis Rosetta Gateway's version tags.
# For more details on GitHub Actions' pattern match syntax, see:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#patterns-to-match-branches-and-tags.
- 'v[0-9]+.[0-9]+*'
# Global environment variables.
env:
GORELEASER_URL_PREFIX: https://github.com/goreleaser/goreleaser/releases/download/
GORELEASER_VERSION: 0.149.0
CURL_CMD: curl --proto =https --tlsv1.2 --location --silent --show-error --fail
jobs:
prepare-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Fetch all history as the recommended way to fetch all tags and
# branches of the project.
# This allows the release helpers in common.mk to determine the
# project's version from git correctly.
# For more info, see:
# https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
fetch-depth: 0
- name: Set up Go 1.22
uses: actions/setup-go@v5
with:
go-version: "1.22.x"
- name: Install GoReleaser
run: |
cd $(mktemp --directory /tmp/goreleaser.XXXXX)
${CURL_CMD} ${GORELEASER_URL_PREFIX}/v${GORELEASER_VERSION}/${GORELEASER_TARBALL} \
--output ${GORELEASER_TARBALL}
${CURL_CMD} ${GORELEASER_URL_PREFIX}/v${GORELEASER_VERSION}/goreleaser_checksums.txt \
--output CHECKSUMS
sha256sum --check --ignore-missing CHECKSUMS
tar -xf ${GORELEASER_TARBALL}
sudo mv goreleaser /usr/local/bin
env:
GORELEASER_TARBALL: goreleaser_Linux_x86_64.tar.gz
- name: Set RELEASE_BRANCH name for stable/bugfix releases
run: |
GIT_VERSION=${GITHUB_REF#refs/tags/v}
if [[ $GIT_VERSION != *.0 ]]; then
echo "RELEASE_BRANCH=stable/${GIT_VERSION%.*}.x" >> $GITHUB_ENV
fi
- name: Build and publish the next release
run: |
make release-build
env:
# Instruct Make to create a real release.
OASIS_ROSETTA_GATEWAY_REAL_RELEASE: "true"
# Pass automatically created GitHub App installation token to the action.
# For more info, see:
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}