From 4c678e83dc9acf45bf7c7229a44498f5bb7348c3 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 31 Aug 2021 18:11:23 +0300 Subject: [PATCH 1/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 092111824dac5495292670ebd2ec7831b1c851af Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Tue, 31 Aug 2021 20:36:07 +0300 Subject: [PATCH 2/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 c6d9228a46bd2b13e7add5ed1e0bca25bf780495 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 00:40:12 +0300 Subject: [PATCH 3/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 19ab024683460b2d832d012f11a7a775282aa593 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 01:11:20 +0300 Subject: [PATCH 4/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 033ca0dedc1e25759853d3723170ea90a7b494a7 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 01:48:53 +0300 Subject: [PATCH 5/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 6e89e64d96e6ef5c48b79fc9213c59615317ce8d Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 13:03:01 +0300 Subject: [PATCH 6/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: From 183d54239f85f4b0805155873f300ab91d49d910 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 18:23:22 +0300 Subject: [PATCH 7/8] ci: Limit final upload to commits on master branch --- .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 5f83593..88f733f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -49,7 +49,7 @@ jobs: upload: needs: [affected, build] - if: ${{ needs.affected.outputs.rockspecs }} + if: ${{ needs.affected.outputs.rockspecs && github.ref == '/refs/heads/master' }} strategy: fail-fast: false matrix: From a67f04b699c9ba274bc46b1f4f0841b9c0a6ca05 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 1 Sep 2021 00:53:03 +0300 Subject: [PATCH 8/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 = {