-
Notifications
You must be signed in to change notification settings - Fork 47
146 lines (123 loc) · 5.49 KB
/
build_linux_x86.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
136
137
138
139
140
141
142
143
144
145
146
name: Linux x86
on:
push:
branches:
- 'master'
- 'main'
- 'dev'
pull_request:
branches:
- 'master'
- 'main'
- 'dev'
jobs:
linux-x86:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install prerequisites
run: |
lsb_release -d
echo && echo "** Setting up repos" && echo
sudo sudo dpkg --add-architecture i386
sudo add-apt-repository universe && sudo apt-get -qq update > /dev/null
echo "Done"
echo && echo "** Installing and setting up compiler and tools" && echo
sudo apt install -yqq --no-install-recommends ninja-build linux-libc-dev:i386 gcc-12 gcc-12-multilib g++-12 g++-12-multilib > /dev/null
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 90 --slave /usr/bin/g++ g++ /usr/bin/g++-12
echo "Done"
# MariaDB dependencies
echo && echo "Install MariaDB dependencies"
echo "Installing some deps with apt..."
sudo apt install -yqq --no-install-recommends libc6:i386 libgcc-s1:i386 zlib1g:i386
echo "Installing libssl1.1 manually from Bionic repo..."
wget --quiet --output-document=dep1.deb http://launchpadlibrarian.net/367327733/libssl1.1_1.1.0g-2ubuntu4_i386.deb
sudo dpkg -r --force-all libssl1.1
sudo dpkg -i --force-all dep1.deb
#sudo apt install --fix-broken ./dep1.deb
echo "Done"
# Workaround: there are no official packages built for i386 on this OS. Let's install from previous Ubuntu LTS versions repo.
echo "Downloading MariaDB i386 manually from Bionic repo..."
wget --quiet --output-document=temp1.deb http://launchpadlibrarian.net/355877539/libmariadb3_3.0.3-1build1_i386.deb
wget --quiet --output-document=temp2.deb http://launchpadlibrarian.net/355877538/libmariadb-dev_3.0.3-1build1_i386.deb
#echo "Downloading MariaDB i386 manually from Focal repo..."
#wget --quiet --output-document=temp1.deb http://launchpadlibrarian.net/448491536/libmariadb3_10.3.18-1_i386.deb
# No libmariadb-dev ?
#wget --quiet --output-document=temp2.deb http://launchpadlibrarian.net/355877538/libmariadb-dev_3.0.3-1build1_i386.deb
# Third choice: directly download and install packages from Debian repos?
#echo "Packages to be installed by libmariadb3:"
#dpkg-deb -c temp1.deb
echo "Installing via dpkg libmariadb3"
sudo dpkg -i temp1.deb
echo "Done"
#echo "Packages to be installed by libmariadb-dev:"
#dpkg-deb -c temp2.deb
echo "Installing via dpkg libmariadb-dev"
sudo dpkg -i temp2.deb
echo "List lib directory files where MariaDB is supposed to be installed:"
ls /usr/lib/i386-linux-gnu/libmaria*
ls /usr/lib/i386-linux-gnu/mariadb
echo "Done"
- name: Report building tools
run: |
echo "GCC:" && gcc -v
echo && echo "CMake:" && cmake --version
echo && echo "Ninja:" && ninja --version
- name: CMake
run: |
mkdir -p build
cmake -G "Ninja" -DCMAKE_BUILD_TYPE="Nightly" -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/Linux-GNU-x86.cmake -S ./ -B ./build
- name: Ninja
run: cd build && ninja && cd ..
- name: Create package
run: |
mkdir accounts logs save scripts
tar -czf SphereSvrX-linux-x86-nightly.tar.gz accounts/ logs/ save/ scripts/ -C build/bin-x86/ SphereSvrX32_nightly -C ../../src sphere.ini sphereCrypt.ini
# Upload artifact linked to the workflow run - only if the run is for a pull request, or for selected branches
- name: Upload artifact
if: contains(fromJson('["master", "main", "dev"]'), github.ref_name) || ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Build-linux-x86
path: SphereSvrX-linux-x86-nightly.tar.gz
overwrite: true
upload_github_release:
needs: linux-x86
# Upload artifact linked to GitHub RELEASE we are creating - only if the run is for a pull request, or for selected branches
if: contains(fromJson('["master", "main"]'), github.ref_name)
runs-on: ubuntu-latest
steps:
- name: Download builds
uses: actions/download-artifact@v4
with:
name: Build-linux-x86
merge-multiple: true
run-id: ${{ github.run_id }}
- name: Create release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Nightly
tag_name: Nightly
prerelease: true
files: SphereSvrX-linux-x86-nightly.tar.gz
upload_selfhost_release:
needs: linux-x86
if: contains(fromJson('["master", "main"]'), github.ref_name) && (github.repository == 'SphereServer/Source-X')
runs-on: ubuntu-latest
steps:
- name: Download builds
uses: actions/download-artifact@v4
with:
name: Build-linux-x86
merge-multiple: true
run-id: ${{ github.run_id }}
- name: Push release
run: |
curl -sST "{SphereSvrX-linux-x86-nightly.tar.gz}" -u ${{secrets.UP_USER}}:${{secrets.UP_PASS}} ${{secrets.UP_WHERE}}