diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..88f733f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,66 @@ +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: '", "' + + build: + needs: affected + if: ${{ needs.affected.outputs.rockspecs }} + strategy: + fail-fast: false + matrix: + luaVersion: ["5.4", "5.3", "5.2", "5.1", "luajit", "luajit-openresty"] + luarocksVersion: ["3.1.3", "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 }} + + upload: + needs: [affected, build] + if: ${{ needs.affected.outputs.rockspecs && github.ref == '/refs/heads/master' }} + 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 --skip-pack --force --api-key ${{ github.LUAROCKS_APIKEY }} -- ${{ matrix.rockspec }} 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 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 = {