-
Notifications
You must be signed in to change notification settings - Fork 215
118 lines (115 loc) · 4.14 KB
/
release.yaml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: release
defaults:
run:
shell: bash
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- name: set environment
uses: HatsuneMiku3939/direnv-action@v1
- run: |
toolchain=$(cat go.mod | grep toolchain | cut -d ' ' -f 2 | sed 's/go*//')
echo "GOTOOLCHAIN=go${toolchain}" >> $GITHUB_ENV
echo "GOVERSION=${toolchain}" >> $GITHUB_ENV
echo "GOROOT=/opt/hostedtoolcache/go/${toolchain}/x64" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: "${{ env.GOVERSION }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set release version into env variable
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Make and publish
run: |
sudo rm -rf dist
make release
env:
GORELEASER_RELEASE: true
GORELEASER_MOUNT_CONFIG: true
# using PAT as homebrew is located in different repo
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test-network-upgrade-on-release:
runs-on: upgrade-tester
needs:
- publish
steps:
- uses: actions/checkout@v3
- run: git fetch --prune --unshallow
- name: set environment
uses: HatsuneMiku3939/direnv-action@v1
- run: |
toolchain=$(cat go.mod | grep toolchain | cut -d ' ' -f 2 | sed 's/go*//')
echo "GOTOOLCHAIN=go${toolchain}" >> $GITHUB_ENV
echo "GOVERSION=${toolchain}" >> $GITHUB_ENV
echo "GOROOT=/opt/hostedtoolcache/go/${toolchain}/x64" >> $GITHUB_ENV
- uses: actions/setup-go@v4
with:
go-version: "${{ env.GOVERSION }}"
- name: detect release tag
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: configure variables
run: |
test_required=$(./script/upgrades.sh test-required ${{ env.RELEASE_TAG }})
echo "TEST_REQUIRED=$test_required" >> $GITHUB_ENV
- name: run test
if: env.TEST_REQUIRED == 'true'
env:
UPGRADE_BINARY_VERSION: ${{ env.RELEASE_TAG }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd tests/upgrade
make test
- name: dump stderr
if: always() && steps.test.outcome != 'skipped'
run: cat .cache/run/upgrade/stderr.log
- name: upload stderr
if: always() && steps.test.outcome != 'skipped'
uses: actions/upload-artifact@v3
with:
name: stderr.log
path: .cache/run/upgrade/stderr.log
- name: upload stdout
if: always() && steps.test.outcome != 'skipped'
uses: actions/upload-artifact@v3
with:
name: stdout.log
path: .cache/run/upgrade/stdout.log
notify-homebrew:
runs-on: ubuntu-latest
needs:
- publish
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: release version
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: check if pre-release
id: check
run: |
is_prerelease=$(./script/is_prerelease.sh ${{ env.RELEASE_TAG }}; echo $?)
is_mainnet=$(./script/mainnet-from-tag.sh ${{ env.RELEASE_TAG }}; echo $?)
echo "is_prerelease=${is_prerelease}" >> $GITHUB_OUTPUT
echo "is_mainnet=${is_mainnet}" >> $GITHUB_OUTPUT
- name: notify homebrew with a new release
if: contains(steps.check.outputs.is_mainnet, '0') && contains(steps.check.outputs.is_prerelease, '1')
uses: benc-uk/workflow-dispatch@v1
with:
token: ${{ secrets.GORELEASER_ACCESS_TOKEN }}
repo: akash-network/homebrew-tap
ref: refs/heads/main
workflow: akash
inputs: '{"tag": "${{ env.RELEASE_TAG }}"}'