name: lua on: push: branches: - ci - stable permissions: contents: read jobs: build: runs-on: ${{ matrix.platform.runner }} strategy: fail-fast: false matrix: target: - runner: ubuntu-latest arch: x86_64 platform: linux-gnu pre: lib ext: so - runner: windows-latest arch: x86_64 platform: linux-gnu pre: ext: dll steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: arduino/setup-protoc@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - run: cargo build --release --features=luajit - run: mv target/release/${{matrix.target.pre}}codemp.${{matrix.target.ext}} dist/lua/codemp-lua-${{matrix.target.arch}}-${{matrix.target.platform}}.${{matrix.target.ext}} - uses: actions/upload-artifact@v4 with: name: codemp-lua-${{ matrix.platform.target }} path: dist/lua/codemp-lua-${{matrix.target.arch}}-${{matrix.target.platform}}.${{matrix.target.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-latest arch: aarch64 platform: darwin pre: lib ext: dylib #- runner: macos-12 # arch: x86_64 # platform: darwin # pre: lib # ext: dylib steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: arduino/setup-protoc@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - run: cargo rustc --release --features=luajit -- -C link-arg=-undefined -C link-arg=dynamic_lookup - run: mv target/release/${{matrix.target.pre}}codemp.${{matrix.target.ext}} dist/lua/codemp-lua-${{matrix.target.arch}}-${{matrix.target.platform}}.${{matrix.target.ext}} - uses: actions/upload-artifact@v4 with: name: codemp-lua-${{ matrix.platform.target }} path: dist/lua/codemp-lua-${{matrix.target.arch}}-${{matrix.target.platform}}.${{matrix.target.ext}} # 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, build-macos] 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