-
Notifications
You must be signed in to change notification settings - Fork 24
135 lines (116 loc) · 3.77 KB
/
release-github.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build & Compile CPP SDK
on:
workflow_dispatch:
env:
HUSKY: 0
jobs:
build-and-compile:
name: Build & Compile CPP SDK
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install node modules
run: npm ci
- name: Install C++ dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
python3-pip \
build-essential \
cmake \
pkg-config \
wget \
git \
software-properties-common \
python3 \
curl \
libssl-dev \
vim \
lcov \
gcovr \
jq \
libxml2-utils \
bc \
cloc \
libdbus-1-dev \
unzip \
ssh \
openssl \
libusb-1.0-0-dev \
libsystemd-dev \
gawk \
sudo \
ninja-build \
dpkg
- name: Add toolchain for GCC 9
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt-get update
- name: Install cross compilation tools
run: |
sudo apt-get install -y \
gcc-9 \
g++-9 \
gcc-9-arm-linux-gnueabihf \
g++-9-arm-linux-gnueabihf \
libc6-armhf-cross \
libc6-dev-armhf-cross
- name: Set up env variables for cross-compilation
run: |
echo "CC=arm-linux-gnueabihf-gcc-9" >> $GITHUB_ENV
echo "CXX=arm-linux-gnueabihf-g++-9" >> $GITHUB_ENV
echo "CFLAGS=-O2" >> $GITHUB_ENV
echo "CXXFLAGS=-O2" >> $GITHUB_ENV
echo "LDFLAGS=-L/usr/arm-linux-gnueabihf/lib" >> $GITHUB_ENV
echo "SYSROOT=/usr/arm-linux-gnueabihf" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$SYSROOT/lib" >> $GITHUB_ENV
- name: Install zlib from source
run: |
wget https://zlib.net/zlib-1.3.1.tar.gz
tar -xzf zlib-1.3.1.tar.gz
cd zlib-1.3.1
./configure --prefix=${SYSROOT} --libdir=${SYSROOT}/lib --includedir=${SYSROOT}/include
make
sudo make install
# Verify that zlib was installed correctly
ls -l ${SYSROOT}/lib/libz.so
ls -l ${SYSROOT}/include/zlib.h
- name: Set file permissions
run: |
chmod -R 755 ./
chown -R $(id -u):$(id -g) ./
- name: Install jsonref
run: pip3 install jsonref
# - name: Generate js sdk
# run: npm run dist
- name: Get version from package.json
run: |
RELEASE_VERSION=$(node -p "require('./package.json').version")
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "build_cpp_source=true" >> $GITHUB_ENV
# - name: Generate native sdk source
# if: env.build_cpp_source == 'true'
# run: |
# .github/workflows/utils.sh generateSource
- name: Clone and Install Thunder
if: env.build_cpp_source == 'true'
id: install_thunder
run: |
.github/workflows/utils.sh cloneAndInstallThunder
# - name: Build Core SDK CPP
# if: env.build_cpp_source == 'true'
# id: build_core_cpp
# run: |
# .github/workflows/utils.sh buildCoreCPPSDK $RELEASE_VERSION
# - name: Upload SDK artifact
# if: success()
# uses: actions/upload-artifact@v3
# with:
# name: core-sdk
# path: firebolt-apis/src/sdks/core/build/cpp/src/*.tgz