Skip to content

Add README.md [noci] #120

Add README.md [noci]

Add README.md [noci] #120

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