Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

Commit

Permalink
Improve build system to allow external builds
Browse files Browse the repository at this point in the history
  • Loading branch information
toasterofbread committed Feb 18, 2024
1 parent f53b377 commit d9164f6
Show file tree
Hide file tree
Showing 74 changed files with 299 additions and 220 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build-linux-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
working-directory: zeromq-4.3.5
run: make -j$(nproc) && make install

- name: Copy libzmq into src/nativeInterop
run: mkdir src/nativeInterop && cp -r libzmq/* src/nativeInterop
- name: Copy libzmq into src/nativeInterop/linux-arm64
run: mkdir -p src/nativeInterop/linux-arm64 && cp -r libzmq/* src/nativeInterop/linux-arm64

- name: Add arm64 architecture to dpkg
run: dpkg --add-architecture arm64
Expand Down Expand Up @@ -124,20 +124,20 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradle

- name: Build native binaries
run: SPMS_ARCH="aarch64" ./gradlew nativeBinariesStatic
- name: Build linux-arm64 binaries
run: ./gradlew linux-arm64BinariesStatic

- name: Strip release binary
run: $TOOLCHAIN/bin/aarch64-unknown-linux-gnu-strip build/bin/native/releaseExecutable/*.kexe
run: $TOOLCHAIN/bin/aarch64-unknown-linux-gnu-strip build/bin/linux-arm64/releaseExecutable/*.kexe

- name: Upload debug binary
uses: actions/upload-artifact@v3
with:
name: spms-linux-arm64-debug
path: build/bin/native/debugExecutable/*.kexe
path: build/bin/linux-arm64/debugExecutable/*.kexe

- name: Upload release binary
uses: actions/upload-artifact@v3
with:
name: spms-linux-arm64-release
path: build/bin/native/releaseExecutable/*.kexe
path: build/bin/linux-arm64/releaseExecutable/*.kexe
16 changes: 8 additions & 8 deletions .github/workflows/build-linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build [Linux x86_64]

on:
push:
branches: [ "main", "test" ]
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
Expand Down Expand Up @@ -78,29 +78,29 @@ jobs:
working-directory: zeromq-4.3.5
run: make -j$(nproc) && make install

- name: Copy libzmq into src/nativeInterop
run: mkdir src/nativeInterop && cp -r libzmq/* src/nativeInterop
- name: Copy libzmq into src/nativeInterop/linux-x86_64
run: mkdir -p src/nativeInterop/linux-x86_64 && cp -r libzmq/* src/nativeInterop/linux-x86_64

- name: Set up Gradle
uses: gradle/gradle-build-action@v3

- name: Grant execute permission for gradlew
run: chmod +x gradle

- name: Build native binaries
run: ./gradlew nativeBinariesStatic
- name: Build linux-x86_64 binaries
run: ./gradlew linux-x86_64BinariesStatic

- name: Strip release binary
run: $TOOLCHAIN/bin/x86_64-unknown-linux-gnu-strip build/bin/native/releaseExecutable/*.kexe
run: $TOOLCHAIN/bin/x86_64-unknown-linux-gnu-strip build/bin/linux-x86_64/releaseExecutable/*.kexe

- name: Upload debug binary
uses: actions/upload-artifact@v3
with:
name: spms-linux-x86_64-debug
path: build/bin/native/debugExecutable/*.kexe
path: build/bin/linux-x86_64/debugExecutable/*.kexe

- name: Upload release binary
uses: actions/upload-artifact@v3
with:
name: spms-linux-x86_64-release
path: build/bin/native/releaseExecutable/*.kexe
path: build/bin/linux-x86_64/releaseExecutable/*.kexe
28 changes: 17 additions & 11 deletions .github/workflows/build-windows-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ jobs:
token: ${{ github.token }}
github-binarycache: true

- name: Copy libzmq files
run: xcopy /s /i /y "${{ github.workspace }}\vcpkg\packages\zeromq_x64-windows\*" "${{ github.workspace }}\src\nativeInterop"

- name: Copy libcurl files
run: xcopy /s /i /y "${{ github.workspace }}\vcpkg\packages\curl_x64-windows\*" "${{ github.workspace }}\src\nativeInterop"
- name: Copy built files
run: xcopy /s /i /y "${{ github.workspace }}\vcpkg\installed\x64-windows\*" "${{ github.workspace }}\src\nativeInterop\windows-x86_64"

- name: Download 7-Zip
run: curl https://www.7-zip.org/a/7z2301-x64.exe --output 7z-installer.exe
Expand All @@ -46,25 +43,34 @@ jobs:
run: curl https://kumisystems.dl.sourceforge.net/project/mpv-player-windows/libmpv/mpv-dev-x86_64-20240114-git-bd35dc8.7z --output mpv.7z

- name: Extract mpv
run: 7zip\7z.exe x mpv.7z -osrc\nativeInterop
run: 7zip\7z.exe x mpv.7z -osrc\nativeInterop\windows-x86_64

- name: Move libmpv.dll.a
run: move src\nativeInterop\libmpv.dll.a src\nativeInterop\lib\libmpv.dll.a
run: move src\nativeInterop\windows-x86_64\libmpv.dll.a src\nativeInterop\windows-x86_64\lib\libmpv.dll.a

- name: Move libmpv-2.dll
run: move src\nativeInterop\windows-x86_64\libmpv-2.dll src\nativeInterop\windows-x86_64\bin\libmpv-2.dll

- name: Set up Gradle
uses: gradle/gradle-build-action@v3

- name: Build native binaries
run: .\gradlew.bat nativeBinariesStatic
- name: Build windows-x86_64 binaries
run: .\gradlew.bat windows-x86_64BinariesStatic

- name: Upload debug binary
uses: actions/upload-artifact@v3
with:
name: spms-windows-x86_64-debug
path: build\bin\native\debugExecutable\*.exe
path: build\bin\windows-x86_64\debugExecutable\*.exe

- name: Upload release binary
uses: actions/upload-artifact@v3
with:
name: spms-windows-x86_64-release
path: build\bin\native\releaseExecutable\*.exe
path: build\bin\windows-x86_64\releaseExecutable\*.exe

# - name: Upload DLL dependencies
# uses: actions/upload-artifact@v3
# with:
# name: dependencies
# path: build\bin\windows-x86_64\releaseExecutable\*.dll
Loading

0 comments on commit d9164f6

Please sign in to comment.