-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 2.19 KB
/
ics-linux-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
name: ICS Consumer Linux Build Release
on:
workflow_dispatch:
push:
jobs:
collect_remote_release:
name: Read latest interchain-security release
runs-on: ubuntu-latest
outputs:
release: ${{ steps.query_release.outputs.release }}
steps:
- name: Query latest release of the interchain-security repo
id: query_release
run: |
latest=$(curl -s -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/cosmos/interchain-security/releases | jq -r '.[0].tag_name')
echo "release=$latest" >> "$GITHUB_OUTPUT"
build:
name: Build
runs-on: ubuntu-latest
needs: [collect_remote_release]
permissions:
contents: write
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Install tools
run: |
sudo apt-get install curl jq -y
- name: Setup environment
run: |
sudo apt install build-essential wget -y
- name: Install golang
run: |
wget -q https://go.dev/dl/go1.20.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
- name: Clone and build interchain security
run: |
export PATH=$PATH:/usr/local/go/bin
LAST_RELEASE=$(curl -s -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/cosmos/interchain-security/releases | jq -r '.[0].tag_name')
git clone https://github.com/cosmos/interchain-security.git
cd interchain-security
git checkout v4.1.0
export LDFLAGS="-extldflags=-static"
export CGO_ENABLED=0
make install
cp ~/go/bin/interchain-security-cd ~/interchain-security-cd-linux
# Publish
- name: Add release
uses: ncipollo/release-action@v1
with:
artifacts: "~/interchain-security-cd-linux"
name: ics-consumer-v4.1.0
bodyFile: .github/workflows/ics-linux-release-body.md
prerelease: true
replacesArtifacts: false
allowUpdates: false
tag: "ics-consumer-v4.1.0"
token: ${{ secrets.GITHUB_TOKEN }}