-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (74 loc) · 2.8 KB
/
build.yaml
File metadata and controls
86 lines (74 loc) · 2.8 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
83
84
85
86
name: Build Prebuilt
on: [push, pull_request]
jobs:
Build-Linux:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: 'Install Build Deps'
run: |
sudo apt-get install -y build-essential make cmake git pkg-config
- name: 'Build'
run: |
export BUILD_DATETIME=$(date '+%Y-%m-%d %H:%M:%S.%3N %Z' --date='TZ="Asia/Shanghai" now')
export BUILD_GIT_TAG=$GITHUB_SHA
mkdir prebuilt
go env
CGO_CFLAGS="-I$(pwd)/vm_libvix/include" CGO_LDFLAGS="-L$(pwd)/vm_libvix/libs/linux64 -lvixAllProducts -ldl -lpthread" go build -ldflags "-X 'main.dateTime=$BUILD_DATETIME' -X 'main.gitTag=$BUILD_GIT_TAG' " -o prebuilt/openvm-api cmd/server/main.go
- name: 'Copy RUNTIME'
run: |
# prebuilt/start.sh
echo '#!/bin/bash' > prebuilt/start.sh
echo 'SCRIPT_DIR=$(dirname "$(readlink -f "$0")")' >> prebuilt/start.sh
echo 'LD_LIBRARY_PATH=$SCRIPT_DIR $SCRIPT_DIR/openvm-api' >> prebuilt/start.sh
chmod +x prebuilt/start.sh
# prebuilt/libvixAllProducts.so
cp $(pwd)/vm_libvix/libs/linux64/libvixAllProducts.so prebuilt/
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: openvm-api_prebuilt_linux_amd64
path: prebuilt
Build-Windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
cache: false
go-version: '1.20.0'
- name: 'Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
cache: false
path-type: 'inherit'
install: >-
git
zip
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-gcc-libs
- name: 'Build'
run: |
export BUILD_DATETIME=$(date '+%Y-%m-%d %H:%M:%S.%3N %Z' --date='TZ="Asia/Shanghai" now')
export BUILD_GIT_TAG=$GITHUB_SHA
mkdir prebuilt
go env
CGO_CFLAGS="-I$(pwd)/vm_libvix/include" CGO_LDFLAGS="-L$(pwd)/vm_libvix/libs/win64 -lvixAllProducts -lpthread" go build -ldflags "-X 'main.dateTime=$BUILD_DATETIME' -X 'main.gitTag=$BUILD_GIT_TAG' " -o prebuilt/openvm-api.exe cmd/server/main.go
- name: 'Copy RUNTIME'
run: |
cp /mingw64/bin/libgcc_s_seh-1.dll prebuilt/
cp /mingw64/bin/libwinpthread-1.dll prebuilt/
cp $(pwd)/vm_libvix/libs/win64/vixAllProducts.dll prebuilt/
- name: 'Upload artifact'
uses: actions/upload-artifact@v4
with:
name: openvm-api_prebuilt_win_amd64
path: prebuilt