2024-09-09 17:08:24 +02:00
|
|
|
name: lua
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- ci
|
|
|
|
- stable
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
2024-09-09 19:47:42 +02:00
|
|
|
build:
|
2024-09-09 17:08:24 +02:00
|
|
|
runs-on: ${{ matrix.platform.runner }}
|
|
|
|
strategy:
|
2024-09-09 19:52:32 +02:00
|
|
|
fail-fast: false
|
2024-09-09 17:08:24 +02:00
|
|
|
matrix:
|
|
|
|
platform:
|
|
|
|
- runner: ubuntu-latest
|
2024-09-09 19:47:42 +02:00
|
|
|
target: linux-x64-gnu
|
|
|
|
filename: libcodemp.so
|
2024-09-09 17:08:24 +02:00
|
|
|
- runner: windows-latest
|
2024-09-09 19:47:42 +02:00
|
|
|
target: win32-x64
|
|
|
|
filename: codemp.dll
|
2024-09-10 02:16:21 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- uses: arduino/setup-protoc@v3
|
|
|
|
- run: cargo build --release --features=lua
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: codemp-lua-${{ matrix.platform.target }}
|
|
|
|
path: target/release/${{ matrix.platform.filename }}
|
|
|
|
|
|
|
|
# macos requires some extra cargo config to make it work, but
|
|
|
|
# these settings make test fail so better limit them to this run
|
|
|
|
build-macos:
|
|
|
|
runs-on: ${{ matrix.platform.runner }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform:
|
2024-09-09 17:08:24 +02:00
|
|
|
- runner: macos-14
|
2024-09-09 19:47:42 +02:00
|
|
|
target: darwin-arm64
|
|
|
|
filename: codemp.dylib
|
|
|
|
#- runner: macos-12
|
|
|
|
# target: darwin-x64
|
|
|
|
# filename: codemp.dylib
|
2024-09-09 17:08:24 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-09-09 19:47:42 +02:00
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
2024-09-09 17:30:23 +02:00
|
|
|
- uses: arduino/setup-protoc@v3
|
2024-09-10 02:16:21 +02:00
|
|
|
# this is the extra config required for lua
|
|
|
|
- run: mkdir .cargo
|
|
|
|
- run: echo '${{ MLUA_CARGO_CONFIG_EXTRA_SETTINGS }}' > .cargo/config.toml
|
|
|
|
# TODO can we make it prettier?
|
2024-09-09 17:08:24 +02:00
|
|
|
- run: cargo build --release --features=lua
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-09-09 19:47:42 +02:00
|
|
|
name: codemp-lua-${{ matrix.platform.target }}
|
2024-09-09 19:58:14 +02:00
|
|
|
path: target/release/${{ matrix.platform.filename }}
|
2024-09-10 02:06:57 +02:00
|
|
|
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
2024-09-10 02:16:21 +02:00
|
|
|
needs: [build, build-macos]
|
2024-09-10 02:06:57 +02:00
|
|
|
steps:
|
|
|
|
- uses: webfactory/ssh-agent@v0.9.0
|
|
|
|
with:
|
|
|
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
|
- uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
pattern: codemp-lua-*
|
|
|
|
- run: tree
|
|
|
|
- run: scp * dev@codemp.dev:/srv/http/codemp/files/releases/lua/
|