From 68ba088e4dd0669a023fbb25fff853ee6103982c Mon Sep 17 00:00:00 2001 From: Henrik Ilgen Date: Sun, 30 Jun 2024 22:54:23 +0200 Subject: [PATCH] Preparations for the release of v0.1.0 --- .github/workflows/test-and-publish.yml | 27 ++++++++++++++++++++++---- lazylualinq-0.1.0.rockspec | 27 ++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 lazylualinq-0.1.0.rockspec diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml index 96493ce..9bf7b51 100644 --- a/.github/workflows/test-and-publish.yml +++ b/.github/workflows/test-and-publish.yml @@ -1,8 +1,13 @@ name: test-and-publish -on: [push, pull_request] +on: + push: + branches: + - main + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + pull_request: jobs: - # TODO: Tests don't seem to run for 5.1 and 5.2 due to some weirdness... tests-51: uses: ./.github/workflows/run-tests.yml with: @@ -36,7 +41,21 @@ jobs: - name: Install dkjson run: | luarocks install dkjson - - name: Publish to LuaRocks + - name: Publish dev version to LuaRocks + if: ${{ github.ref == 'refs/heads/main' }} run: | luarocks upload lazylualinq-dev-1.rockspec --force --api-key=${{ secrets.LUAROCKS_API_KEY }} - if: ${{ github.ref == 'refs/heads/main' }} + - name: Extract version from tag + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + id: extract-version + run: | + echo "VERSION=$(echo ${{ github.ref_name }} | cut -c 2-)" >> "$GITHUB_OUTPUT" + - name: Fail run if there's no valid rockspec + if: ${{ startsWith(github.ref, 'refs/tags/v') && hashFiles(format('lazylualinq-{0}.rockspec', steps.extract-version.outputs.VERSION)) == '' }} + run: | + exit 1 + - name: Publish release version to LuaRocks + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + run: | + luarocks upload lazylualinq-${{ steps.extract-version.outputs.VERSION }}.rockspec --api-key=${{ secrets.LUAROCKS_API_KEY }} + diff --git a/lazylualinq-0.1.0.rockspec b/lazylualinq-0.1.0.rockspec new file mode 100644 index 0000000..89ac4b2 --- /dev/null +++ b/lazylualinq-0.1.0.rockspec @@ -0,0 +1,27 @@ +package = "lazylualinq" +rockspec_format = "3.0" +version = "0.1.0" +source = { + url = "git://github.com/Henkoglobin/lazylualinq", + tag = "v0.1.0" +} +description = { + summary = "LazyLuaLinq provides a simple, lazy implementation of linq-like functions for Lua.", + detailed = [[ + LazyLuaLinq provides a simple, lazy implementation of linq-like functions for Lua. + With LazyLuaLinq, you can implement data transformation in elegant, + expressive queries akin to SQL. + ]], + homepage = "https://henkoglobin.github.io/lazylualinq", + license = "Unlicense" +} +dependencies = { + "lua >= 5.1, < 5.5" +} +build = { + type = "builtin", + modules = { + ["lazylualinq"] = "src/lazylualinq.lua", + ["lazylualinq.ordering"] = "src/lazylualinq/ordering.lua", + } +}