-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (100 loc) · 3.87 KB
/
build-linux-x86_64.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
name: Build [Linux x86_64]
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
jobs:
build-spms:
runs-on: ubuntu-22.04
container: ubuntu:23.04
if: ${{ github.event.pull_request.draft == false && (github.event_name == 'workflow_dispatch' || !contains(github.event.head_commit.message, 'noci')) }}
env:
TOOLCHAIN_VERSION: x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2
JAVA_HOME: /usr/lib/jvm/java-21-openjdk/
steps:
- run: echo "TOOLCHAIN=$GITHUB_WORKSPACE/toolchain" >> $GITHUB_ENV
- run: apt-get update
- run: apt-get install -y nodejs
if: env.ACT
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: |
22
21
- name: Test Java
run: $JAVA_HOME/bin/java --version
- run: apt-get install -y --reinstall git make wget pkg-config libmpv-dev libcurl4-openssl-dev libayatana-appindicator3-dev
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Get cached libzmq
id: cache-libzmq
uses: actions/cache@v4
with:
path: libzmq
key: libzmq-x86_64
- name: Download and extract toolchain
run: |
wget https://download.jetbrains.com/kotlin/native/$TOOLCHAIN_VERSION.tar.gz -O toolchain.tar.gz
tar -xzf toolchain.tar.gz
mv ./$TOOLCHAIN_VERSION $TOOLCHAIN
- name: Download libzmq
if: steps.cache-libzmq.outputs.cache-hit != 'true'
run: wget https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz
- name: Extract libzmq
if: steps.cache-libzmq.outputs.cache-hit != 'true'
run: tar -xf ./zeromq-4.3.5.tar.gz
- name: Configure libzmq
if: steps.cache-libzmq.outputs.cache-hit != 'true'
working-directory: zeromq-4.3.5
run: |
LDFLAGS="-lgcc -lgcc_s" \
CC=$TOOLCHAIN/bin/x86_64-unknown-linux-gnu-gcc \
CXX=$TOOLCHAIN/bin/x86_64-unknown-linux-gnu-g++ \
./configure \
--enable-drafts \
--enable-static \
--disable-shared \
--disable-libbsd \
--prefix=$GITHUB_WORKSPACE/libzmq
- name: Compile and install libzmq
if: steps.cache-libzmq.outputs.cache-hit != 'true'
working-directory: zeromq-4.3.5
run: make -j$(nproc) && make install
- name: Copy libzmq into library/src/nativeInterop/linuxX64
run: mkdir -p library/src/nativeInterop/linuxX64 && cp -r libzmq/* library/src/nativeInterop/linuxX64
- name: Set up Gradle
uses: gradle/gradle-build-action@v3
- name: Build Linux x86_64 minimal binaries
run: ./gradlew app:linuxX64Binaries -PMINIMAL --stacktrace
- name: Strip release binary
run: $TOOLCHAIN/bin/x86_64-unknown-linux-gnu-strip app/build/bin/linuxX64/releaseExecutable/*.kexe
- name: Upload debug binary
uses: actions/upload-artifact@v3
with:
name: spms-minimal-linux-x86_64-debug
path: app/build/bin/linuxX64/debugExecutable/*.kexe
- name: Upload release binary
uses: actions/upload-artifact@v3
with:
name: spms-minimal-linux-x86_64-release
path: app/build/bin/linuxX64/releaseExecutable/*.kexe
- name: Build Linux x86_64 full binaries
run: ./gradlew app:linuxX64Binaries --stacktrace
- name: Strip release binary
run: $TOOLCHAIN/bin/x86_64-unknown-linux-gnu-strip app/build/bin/linuxX64/releaseExecutable/*.kexe
- name: Upload debug binary
uses: actions/upload-artifact@v3
with:
name: spms-linux-x86_64-debug
path: app/build/bin/linuxX64/debugExecutable/*.kexe
- name: Upload release binary
uses: actions/upload-artifact@v3
with:
name: spms-linux-x86_64-release
path: app/build/bin/linuxX64/releaseExecutable/*.kexe