forked from FAForever/uid
-
Notifications
You must be signed in to change notification settings - Fork 0
162 lines (144 loc) · 4.62 KB
/
release.yaml
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Release
on:
workflow_dispatch:
inputs:
version:
description: "Release Version"
required: true
jobs:
build-windows:
runs-on: ubuntu-latest
env:
MXE_DIR: /usr/lib/mxe
MXE_TARGET: x86_64-w64-mingw32.static
MXE_PACKAGE_PREFIX: mxe-x86-64-w64-mingw32.static
steps:
- uses: actions/checkout@v4
- name: Configure MXE
run: |
echo "deb https://pkg.mxe.cc/repos/apt focal main" | sudo tee /etc/apt/sources.list.d/mxeapt.list
wget -qO- https://pkg.mxe.cc/repos/apt/client-conf/mxeapt.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/mxeapt.gpg
sudo apt-get update
# the part without MXE_PACKAGE_PREFIX is from https://mxe.cc/#requirements
sudo apt-get install \
autoconf \
automake \
autopoint \
bash \
bison \
bzip2 \
flex \
g++ \
g++-multilib \
gettext \
git \
gperf \
intltool \
libc6-dev-i386 \
libgdk-pixbuf2.0-dev \
libltdl-dev \
libgl-dev \
libpcre3-dev \
libssl-dev \
libtool-bin \
libxml-parser-perl \
lzip \
make \
openssl \
p7zip-full \
patch \
perl \
python3 \
python3-distutils \
python3-mako \
python3-packaging \
python3-pkg-resources \
python-is-python3 \
ruby \
sed \
sqlite3 \
unzip \
wget \
xz-utils \
$MXE_PACKAGE_PREFIX-jsoncpp \
$MXE_PACKAGE_PREFIX-cryptopp \
$MXE_PACKAGE_PREFIX-icu4c
- name: Build
run: |
$MXE_DIR/usr/bin/$MXE_TARGET-cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCRYPTOPP_LIBRARIES=/usr/lib/mxe/usr/$MXE_TARGET/lib/libcryptopp.a \
-DCRYPTOPP_INCLUDE_DIRS=/usr/lib/mxe/usr/$MXE_TARGET/include \
-DUID_SKIP_LEGACY=On \
-B build
make -C build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: faf-uid.exe
path: build/faf-uid.exe
build-linux:
runs-on: ubuntu-latest
env:
JSONCPP_VERSION: 1.7.7
CRYPTOPP_VERSION: 8_9_0
steps:
- uses: actions/checkout@v4
- name: Build jsoncpp
run: |
wget https://github.com/open-source-parsers/jsoncpp/archive/$JSONCPP_VERSION.tar.gz -O jsoncpp.tar.gz
tar xfz jsoncpp.tar.gz
mkdir jsoncpp-build
cmake \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \
-DBUILD_STATIC_LIBS=ON \
-DBUILD_SHARED_LIBS=OFF \
-B jsoncpp-build \
-S jsoncpp-$JSONCPP_VERSION
make -C jsoncpp-build
- name: Build cryptopp
run: |
wget https://github.com/weidai11/cryptopp/archive/CRYPTOPP_$CRYPTOPP_VERSION.zip -O cryptopp.zip
unzip ./cryptopp.zip
mv cryptopp-CRYPTOPP_$CRYPTOPP_VERSION cryptopp
make -C cryptopp -f GNUmakefile CXXFLAGS='-DNDEBUG -O3' libcryptopp.a
- name: Build
run: |
cmake \
-DJSONCPP_LIBRARIES=$(pwd)/jsoncpp-build/src/lib_json/libjsoncpp.a \
-DJSONCPP_INCLUDE_DIRS=$(pwd)/jsoncpp-$JSONCPP_VERSION/include \
-DCRYPTOPP_LIBRARIES=$(pwd)/cryptopp/libcryptopp.a \
-DCRYPTOPP_INCLUDE_DIRS=$(pwd)/cryptopp \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-B build
make -C build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: faf-uid
path: build/faf-uid
create-release:
needs: [build-windows, build-linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: faf-uid.exe
path: release-artifacts/
- name: Download Linux artifact
uses: actions/download-artifact@v4
with:
name: faf-uid
path: release-artifacts/
- name: Create release
id: create_release
uses: ncipollo/[email protected]
with:
commit: ${{ github.sha }}
tag: ${{ github.event.inputs.version }}
draft: true
prerelease: true
artifacts: "release-artifacts/*"