-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (74 loc) · 2.7 KB
/
binary.yml
File metadata and controls
82 lines (74 loc) · 2.7 KB
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
name: Build Binary
on:
workflow_dispatch:
inputs:
network:
description: "Network"
type: choice
options:
- mainnet
- testnet
required: true
default: "testnet"
service:
description: "Blockchain"
required: true
default: "side"
binary_name:
description: "Binary"
required: true
default: "sided"
repo_url:
description: "Git Repo"
required: true
default: "https://github.com/sideprotocol/side.git"
tag:
description: "Version"
required: true
default: "v0.8.1"
go:
description: "go version"
required: true
default: "1.21.12"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go environment
run: |
sudo apt -q update
sudo apt -qy install curl git jq lz4 build-essential
sudo apt -qy upgrade
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go${{ github.event.inputs.go }}.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee /etc/profile.d/golang.sh
echo 'export PATH=$PATH:${{ github.workspace }}/go/bin' | tee -a ${{ github.workspace }}/.profile
source /etc/profile.d/golang.sh
source ${{ github.workspace }}/.profile
- name: Clone project repository
run: |
cd ${{ github.workspace }}
rm -rf ${{ github.event.inputs.service }}
git clone ${{ github.event.inputs.repo_url }} ${{ github.event.inputs.service }}
cd ${{ github.event.inputs.service }}
git checkout ${{ github.event.inputs.tag }}
- name: Build binaries
run: |
cd ${{ github.workspace }}/${{ github.event.inputs.service }}
make build
cd build
chmod +x ${{ github.event.inputs.binary_name }}
- name: Create and Upload GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ github.workspace }}/${{ github.event.inputs.service }}/build/${{ github.event.inputs.binary_name }}
tag_name: ${{ github.event.inputs.service }}-${{ github.event.inputs.network }}-${{ github.event.inputs.tag }}
name: ${{ github.event.inputs.service }}-${{ github.event.inputs.network }}-${{ github.event.inputs.tag }}
body: |
Release of ${{ github.event.inputs.service }} ${{ github.event.inputs.network }} ${{ github.event.inputs.tag }}
draft: false
prerelease: false