codemp/.github/workflows/lua.yml

84 lines
2.6 KiB
YAML
Raw Normal View History

name: lua
on:
push:
branches:
- ci
- stable
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- runner: ubuntu-latest
target: linux-x64-gnu
2024-09-10 02:39:55 +02:00
ext: so
pre: lib
- runner: windows-latest
target: win32-x64
2024-09-10 02:39:55 +02:00
ext: dll
pre:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3
- run: cargo build --release --features=lua
2024-09-10 02:39:55 +02:00
- run: mv target/release/${{ matrix.platform.pre}}codemp.${{ matrix.platform.ext }} dist/lua/codemp-lua-${{ matrix.platform.target }}.${{ matrix.platform.ext }}
- uses: actions/upload-artifact@v4
with:
name: codemp-lua-${{ matrix.platform.target }}
2024-09-10 02:39:55 +02:00
path: dist/lua/codemp-lua-${{ matrix.platform.target }}.${{ matrix.platform.ext }}
# 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:
# - runner: macos-14
# target: darwin-arm64
# filename: codemp.dylib
# #- runner: macos-12
# # target: darwin-x64
# # filename: codemp.dylib
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@stable
# - uses: arduino/setup-protoc@v3
# # this is the extra config required for lua
# - run: mkdir .cargo
# - run: echo '${{ vars.MLUA_CARGO_CONFIG_EXTRA_SETTINGS }}' > .cargo/config.toml
# # TODO can we make it prettier?
# - run: cargo build --release --features=lua
# - uses: actions/upload-artifact@v4
# with:
# name: codemp-lua-${{ matrix.platform.target }}
# path: target/release/${{ matrix.platform.filename }}
# TODO this just copies files on our server, maybe publish on luarocks? maybe do it properly with versions
publish:
runs-on: ubuntu-latest
needs: [build]
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
# TODO ugly fix to deal with folders on this side...
- name: copy files on remote
run: |
for DIR in $(ls); do
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $DIR/* dev@codemp.dev:/srv/http/codemp/files/releases/lua/
done