diff --git a/.github/workflows/update-lua.yml b/.github/workflows/update-lua.yml new file mode 100644 index 0000000..2a5af60 --- /dev/null +++ b/.github/workflows/update-lua.yml @@ -0,0 +1,41 @@ +name: Update Lua Submodule + +on: + workflow_dispatch: + schedule: + - cron: "*/5 * * * *" + +permissions: + contents: write + +concurrency: + group: update-modules-${{ github.ref }} + cancel-in-progress: true + +jobs: + update-modules: + name: Update Modules + runs-on: ubuntu-latest + + # https://stackoverflow.com/questions/64407333/using-github-actions-to-automatically-update-the-repos-submodules + defaults: + run: + shell: bash + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + + - name: Pull and Update Submodules + run: | + git pull --recurse-submodules + git submodule update --remote --recursive + + - name: Commit Update + run: | + git config --global user.name 'Lua Submodule Updater' + git config --global user.email 'bot@noreply.github.com' + git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} + git commit -am "Update Lua" && git push || echo "No changes to commit" diff --git a/README.md b/README.md index 62801d6..356d480 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,15 @@ on `cmake`'s [`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html) flag. No `install` target is configured and no standalone executable is built, given the intended use case. -Here's how to use it: +# How to use it: +## CPM +In the `CMakeLists.txt` of your application, add +``` +CPMAddPackage("gh:lubgr/lua-cmake#master") + +target_link_libraries(yourTarget PRIVATE lua::lib) +``` +## Git Submodules ```bash cd path/to/your/project @@ -36,5 +44,6 @@ add_subdirectory(external/lua) target_link_libraries(yourTarget PRIVATE lua::lib) ``` +------------------------------------------------------------------------ That's it. Further integration with a library to facilitate the bindings (e.g. [sol2](https://github.com/ThePhD/sol2)) is straightfoward. diff --git a/upstream b/upstream index 9f79153..2a7cf4f 160000 --- a/upstream +++ b/upstream @@ -1 +1 @@ -Subproject commit 9f791535cde1539338f6ba1b9154006595d97fe7 +Subproject commit 2a7cf4f319fc276f4554a8f6364e6b1ba4eb2ded