From c0fa0363c2ddb8c2bcced0b0c911602addf1bd2f Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 21 Sep 2024 11:53:59 +0200 Subject: [PATCH 1/7] build: lock rockfile to specific tag --- dist/lua/codemp-0.7.0-1.rockspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/lua/codemp-0.7.0-1.rockspec b/dist/lua/codemp-0.7.0-1.rockspec index 714fb2b..7e10e79 100644 --- a/dist/lua/codemp-0.7.0-1.rockspec +++ b/dist/lua/codemp-0.7.0-1.rockspec @@ -3,7 +3,7 @@ version = "0.7.0-1" source = { url = "git+https://github.com/hexedtech/codemp", - branch = "dev", + tag = "v0.7.0", } dependencies = { From 312dc4f606dd576d86de4eea34fc792758ffdb84 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 21 Sep 2024 12:03:23 +0200 Subject: [PATCH 2/7] ci(lua): publish to luarocks, upload with version --- .github/workflows/lua.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lua.yml b/.github/workflows/lua.yml index a48975f..4914e82 100644 --- a/.github/workflows/lua.yml +++ b/.github/workflows/lua.yml @@ -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: From 63f428f05deb98d90d3789b47e8eddd0ea6c37cd Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 21 Sep 2024 12:04:22 +0200 Subject: [PATCH 3/7] ci(lua): try out new lua CI --- .github/workflows/lua.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lua.yml b/.github/workflows/lua.yml index 4914e82..27319d6 100644 --- a/.github/workflows/lua.yml +++ b/.github/workflows/lua.yml @@ -4,6 +4,7 @@ on: push: branches: - stable + - feat/lua-rock permissions: contents: read From 80dda4f5b6d7ab2878fa0eb2fea919fdfdbfc61b Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 21 Sep 2024 12:11:55 +0200 Subject: [PATCH 4/7] ci(lua): fix tag not found, fix luarocks cmd --- .github/workflows/lua.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lua.yml b/.github/workflows/lua.yml index 27319d6..a532b27 100644 --- a/.github/workflows/lua.yml +++ b/.github/workflows/lua.yml @@ -36,6 +36,8 @@ jobs: buildcmd: cargo rustc --release --features=luajit -- -C link-arg=-undefined -C link-arg=dynamic_lookup steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # necessary to get last tag - uses: dtolnay/rust-toolchain@stable - uses: arduino/setup-protoc@v3 with: @@ -62,7 +64,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: leafo/gh-actions-lua@v9 - uses: leafo/gh-actions-luarocks@v4 - - run: luarock upload codemp-*.rockspec + - run: luarocks upload codemp-*.rockspec working-directory: dist/lua upload: From ed609ff120f2b511ddff75e94f35992df46edf6b Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 21 Sep 2024 12:17:48 +0200 Subject: [PATCH 5/7] ci(lua): add luarocks token --- .github/workflows/lua.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lua.yml b/.github/workflows/lua.yml index a532b27..180c125 100644 --- a/.github/workflows/lua.yml +++ b/.github/workflows/lua.yml @@ -64,7 +64,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: leafo/gh-actions-lua@v9 - uses: leafo/gh-actions-luarocks@v4 - - run: luarocks upload codemp-*.rockspec + - run: luarocks upload codemp-*.rockspec --api-key ${{ secrets.LUAROCKS_TOKEN }} working-directory: dist/lua upload: From 6ee236b5286db9307b74dbe1aa2c2e29a6a14c23 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 21 Sep 2024 12:36:24 +0200 Subject: [PATCH 6/7] ci(lua): install dkjson because luarocks wont work --- .github/workflows/lua.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lua.yml b/.github/workflows/lua.yml index 180c125..1ac57a3 100644 --- a/.github/workflows/lua.yml +++ b/.github/workflows/lua.yml @@ -64,6 +64,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: leafo/gh-actions-lua@v9 - uses: leafo/gh-actions-luarocks@v4 + - run: luarocks install --local dkjson # needed to run upload?? ooook luarocks... - run: luarocks upload codemp-*.rockspec --api-key ${{ secrets.LUAROCKS_TOKEN }} working-directory: dist/lua From 693ab9f9796463be154f13ce57cc046ff834fb6e Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 21 Sep 2024 12:52:29 +0200 Subject: [PATCH 7/7] ci(lua): only run on stable --- .github/workflows/lua.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/lua.yml b/.github/workflows/lua.yml index 1ac57a3..cd6d93a 100644 --- a/.github/workflows/lua.yml +++ b/.github/workflows/lua.yml @@ -4,7 +4,6 @@ on: push: branches: - stable - - feat/lua-rock permissions: contents: read