ci(lua): publish to luarocks, upload with version

This commit is contained in:
əlemi 2024-09-21 12:03:23 +02:00
parent c0fa0363c2
commit 312dc4f606
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -40,14 +40,31 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: ${{ matrix.platform.buildcmd }}
- run: mv target/release/${{matrix.platform.pre}}codemp.${{matrix.platform.ext}} dist/lua/codemp-lua-${{matrix.platform.arch}}-${{matrix.platform.target}}.${{matrix.platform.ext}}
- id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: v0.0.0
- run: mv target/release/${{matrix.platform.pre}}codemp.${{matrix.platform.ext}} dist/lua/codemp-lua-${{steps.previoustag.outputs.tag}}-${{matrix.platform.arch}}-${{matrix.platform.target}}.${{matrix.platform.ext}}
- uses: actions/upload-artifact@v4
with:
name: codemp-lua-${{ matrix.platform.target }}
path: dist/lua/codemp-lua-${{matrix.platform.arch}}-${{matrix.platform.target}}.${{matrix.platform.ext}}
path: dist/lua/codemp-lua-*
# TODO this just copies files on our server, maybe consider other ways to distribute? maybe do it properly with versions?
publish:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: leafo/gh-actions-lua@v9
- uses: leafo/gh-actions-luarocks@v4
- run: luarock upload codemp-*.rockspec
working-directory: dist/lua
upload:
runs-on: ubuntu-latest
needs: [build]
steps: