-
Notifications
You must be signed in to change notification settings - Fork 45
103 lines (88 loc) · 2.91 KB
/
test-build.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
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
name: test build
on:
push:
env:
GOPATH: ${{ github.workspace }}
GOBIN: ${{ github.workspace }}/bin
jobs:
build-x86_64:
name: Build hmy binary for x86_64
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-22.04, macos-latest ]
steps:
- name: Checkout hmy code
uses: actions/checkout@v3
with:
path: go-sdk
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go-sdk/go.mod
- name: Checkout dependence repo
uses: actions/checkout@v3
with:
repository: harmony-one/mcl
path: ${{ github.workspace }}/src/github.com/harmony-one/mcl
- name: Checkout dependence repo
uses: actions/checkout@v3
with:
repository: harmony-one/bls
path: ${{ github.workspace }}/src/github.com/harmony-one/bls
- name: Checkout dependence code
uses: actions/checkout@v2
with:
repository: harmony-one/harmony
path: ${{ github.workspace }}/src/github.com/harmony-one/harmony
ref: main
fetch-depth: 0
- name: Get latest version and release
run: |
VERSION=$(git tag -l --sort=-v:refname | head -n 1 | tr -d v)
RELEASE=$(git describe --long | cut -f2 -d-)
echo "build_version=$VERSION" >> $GITHUB_ENV
echo "build_release=$RELEASE" >> $GITHUB_ENV
working-directory: go-sdk
- name: Debug
run: |
pwd
echo ${HOME}
echo ${GITHUB_WORKSPACE}
echo ${GOPATH}
echo ${GOROOT}
ls ${{ github.workspace }}/src/github.com/harmony-one/
- name: Build hmy binary for linux ubuntu
if: matrix.os == 'ubuntu-22.04'
run: |
make static
working-directory: go-sdk
- name: Build libs for macos-latest
if: matrix.os == 'macos-latest'
run: |
brew install gmp
brew install openssl
sudo mkdir -p /opt/homebrew/opt/
sudo ln -sf /usr/local/opt/[email protected] /opt/homebrew/opt/[email protected]
echo "ls -l /opt/homebrew/opt/[email protected]"; ls -l /opt/homebrew/opt/[email protected]
make libs
working-directory: ${{ github.workspace }}/src/github.com/harmony-one/harmony
- name: Build hmy binary for macos-latest x86_64
if: matrix.os == 'macos-latest'
run: |
make all
working-directory: go-sdk
- name: Upload artifact for linux
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-22.04'
with:
name: hmy-linux
path: ${{ github.workspace }}/go-sdk/dist/*
retention-days: 1
- name: Upload artifact for darwin
uses: actions/upload-artifact@v3
if: matrix.os == 'macos-latest'
with:
name: hmy-darwin
path: ${{ github.workspace }}/go-sdk/dist/*
retention-days: 1