From 32466701677bb720b7510ccd1e0b3226a3aeaced Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 31 Aug 2021 17:53:26 +0300 Subject: [PATCH 1/8] release: Let devel / SCM builds require Luarocks 3 --- cassowary-scm-0.rockspec | 1 + 1 file changed, 1 insertion(+) diff --git a/cassowary-scm-0.rockspec b/cassowary-scm-0.rockspec index 9559975..a8278ca 100644 --- a/cassowary-scm-0.rockspec +++ b/cassowary-scm-0.rockspec @@ -1,3 +1,4 @@ +rockspec_format = "3.0" package = "cassowary" version = "scm-0" From 98e48aa3c94508f49f6e5a95658e156c1967449e Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 31 Aug 2021 18:11:23 +0300 Subject: [PATCH 2/8] ci: Add workflow to test build SCM rockspec --- .github/workflows/luarocks.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/luarocks.yml diff --git a/.github/workflows/luarocks.yml b/.github/workflows/luarocks.yml new file mode 100644 index 0000000..ca4d981 --- /dev/null +++ b/.github/workflows/luarocks.yml @@ -0,0 +1,21 @@ +name: Luarocks + +on: [push, pull_request] + +jobs: + + luarocks: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup ‘lua’ + uses: leafo/gh-actions-lua@v8 + - name: Setup ‘luarocks’ + uses: leafo/gh-actions-luarocks@v4 + - name: Luarocks lint + run: | + luarocks --local lint -- cassowary-scm-0.rockspec + - name: Luarocks make + run: | + luarocks --local make -- cassowary-scm-0.rockspec From 3c6b3feda02ffb32b6945c4eecd54f28c05d800d Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 31 Aug 2021 20:36:07 +0300 Subject: [PATCH 3/8] ci: Add deploy workflow to test build new rockspecs --- .github/workflows/deploy.yml | 47 ++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..207e9cc --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,47 @@ +name: Deploy + +on: + push: + paths: + - rockspecs/*.rockspec + +jobs: + + affected: + runs-on: ubuntu-20.04 + outputs: + rockspecs: '["${{ steps.changed-files.outputs.all_modified_files }}"]' + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - id: changed-files + uses: tj-actions/changed-files@v1.0.2 + with: + files: rockspecs/*.rockspec + separator: '", "' + + make: + needs: affected + strategy: + fail-fast: false + matrix: + luaVersion: ["5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"] + luarocksVersion: ["3.7.0", "2.4.2"] + rockspec: ${{ fromJSON(needs.affected.outputs.rockspecs) }} + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup ‘lua’ + uses: leafo/gh-actions-lua@v8 + with: + luaVersion: ${{ matrix.luaVersion }} + - name: Setup ‘luarocks’ + uses: leafo/gh-actions-luarocks@v4 + with: + luarocksVersion: ${{ matrix.luarocksVersion }} + - name: Confirm rockspec builds + run: | + luarocks --lua-version ${{ matrix.luaVersion }} --local build -- ${{ matrix.rockspec }} From 0b946071dd6a0d26fcadc75253561ac85fed8cdd Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 00:40:12 +0300 Subject: [PATCH 4/8] ci: Add workflow to upload modified rockspecs --- .github/workflows/deploy.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 207e9cc..8e17c8e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,7 +22,7 @@ jobs: files: rockspecs/*.rockspec separator: '", "' - make: + build: needs: affected strategy: fail-fast: false @@ -45,3 +45,20 @@ jobs: - name: Confirm rockspec builds run: | luarocks --lua-version ${{ matrix.luaVersion }} --local build -- ${{ matrix.rockspec }} + + upload: + needs: build + strategy: + fail-fast: false + matrix: + rockspec: ${{ fromJSON(needs.affected.outputs.rockspecs) }} + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup ‘lua’ + uses: leafo/gh-actions-lua@v8 + - name: Setup ‘luarocks’ + uses: leafo/gh-actions-luarocks@v4 + - run: | + luarocks upload --force --api-key ${{ github.LUAROCKS_APIKEY }} -- ${{ matrix.rockspec }} From d73953b017303472ad4970f36d7de0c5d4ee2649 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 01:11:20 +0300 Subject: [PATCH 5/8] ci: Only run build checks and upload if rockspecs changed --- .github/workflows/deploy.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8e17c8e..eee9d7a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,6 +24,7 @@ jobs: build: needs: affected + if: ${{ needs.affected.outputs.rockspecs }} strategy: fail-fast: false matrix: @@ -47,7 +48,8 @@ jobs: luarocks --lua-version ${{ matrix.luaVersion }} --local build -- ${{ matrix.rockspec }} upload: - needs: build + needs: [affected, build] + if: ${{ needs.affected.outputs.rockspecs }} strategy: fail-fast: false matrix: From 80a0a4992e0c1b81784654f3987fac037597263f Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 01:48:53 +0300 Subject: [PATCH 6/8] ci: Skip packging src rock, only upload rockspec --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index eee9d7a..7d80a65 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -63,4 +63,4 @@ jobs: - name: Setup ‘luarocks’ uses: leafo/gh-actions-luarocks@v4 - run: | - luarocks upload --force --api-key ${{ github.LUAROCKS_APIKEY }} -- ${{ matrix.rockspec }} + luarocks upload --skip-pack --force --api-key ${{ github.LUAROCKS_APIKEY }} -- ${{ matrix.rockspec }} From 2419bf6007a428c07603c54a6ad8cae0a40d2f6b Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 00:53:03 +0300 Subject: [PATCH 7/8] fix: Make rockspec source v1.0 compatible --- rockspecs/cassowary-2.3.1-2.rockspec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rockspecs/cassowary-2.3.1-2.rockspec b/rockspecs/cassowary-2.3.1-2.rockspec index 9750e8d..491e8d5 100644 --- a/rockspecs/cassowary-2.3.1-2.rockspec +++ b/rockspecs/cassowary-2.3.1-2.rockspec @@ -1,9 +1,11 @@ +rockspec_format = "1.0" package = "cassowary" version = "2.3.1-2" source = { url = "git://github.com/sile-typesetter/cassowary.lua", - tag = "v2.3.1" + tag = "v2.3.1", + dir = "cassowary.lua" } description = { From 96237af7ba57307c95ec6a6a79c5d4ec679bc812 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 13:03:01 +0300 Subject: [PATCH 8/8] ci: Use older v3 Luarocks to be Luajit compatible for testing --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7d80a65..5f83593 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,7 +29,7 @@ jobs: fail-fast: false matrix: luaVersion: ["5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"] - luarocksVersion: ["3.7.0", "2.4.2"] + luarocksVersion: ["3.1.3", "2.4.2"] rockspec: ${{ fromJSON(needs.affected.outputs.rockspecs) }} runs-on: ubuntu-20.04 steps: