From b9a5a034adb76b976149c794990e1bafdd68f089 Mon Sep 17 00:00:00 2001 From: carsakiller Date: Mon, 25 Nov 2024 20:15:59 +0000 Subject: [PATCH 1/7] add: ncine addon --- .gitmodules | 4 ++++ addons/ncine/info.json | 5 +++++ addons/ncine/module | 1 + 3 files changed, 10 insertions(+) create mode 100644 addons/ncine/info.json create mode 160000 addons/ncine/module diff --git a/.gitmodules b/.gitmodules index 96914632..117285be 100644 --- a/.gitmodules +++ b/.gitmodules @@ -202,3 +202,7 @@ [submodule "addons/scribunto/module"] path = addons/scribunto/module url = https://github.com/Dianliang233/scribunto-addon +[submodule "addons/ncine/module"] + path = addons/ncine/module + url = https://github.com/nCine/nCine-LuaCATS + branch = addon diff --git a/addons/ncine/info.json b/addons/ncine/info.json new file mode 100644 index 00000000..c4b3adfc --- /dev/null +++ b/addons/ncine/info.json @@ -0,0 +1,5 @@ +{ + "$schema": "https://raw.githubusercontent.com/LuaLS/LLS-Addons/main/schemas/addon_info.schema.json", + "name": "nCine", + "description": "Definitions for the nCine, a cross-platform 2D game framework with an emphasis on performance" +} diff --git a/addons/ncine/module b/addons/ncine/module new file mode 160000 index 00000000..1d0d690e --- /dev/null +++ b/addons/ncine/module @@ -0,0 +1 @@ +Subproject commit 1d0d690ea462c6df20b70c0f3b0a76a30de10a50 From 2a0c53c0c082a3b638c3eca7771ab9de888b2cf8 Mon Sep 17 00:00:00 2001 From: carsakiller Date: Mon, 25 Nov 2024 20:20:39 +0000 Subject: [PATCH 2/7] fix: gh action --- .github/workflows/pull_request.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ac097a06..c11fb4be 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -23,7 +23,6 @@ jobs: - name: Detect Added Submodules run: | BASE_REF=${{github.event.pull_request.base.sha}} - git checkout $BASE_REF ADDED_SUBMODULES=$(git diff --submodule ${BASE_REF}..HEAD | grep '^Submodule' | awk '{ print $2 }') echo "Added submodules: $ADDED_SUBMODULES" echo "ADDED_SUBMODULES=$ADDED_SUBMODULES" >> $GITHUB_ENV @@ -59,7 +58,6 @@ jobs: - name: Detect Added Submodules run: | BASE_REF=${{github.event.pull_request.base.sha}} - git checkout $BASE_REF ADDED_SUBMODULES=$(git diff --submodule ${BASE_REF}..HEAD | grep '^Submodule' | awk '{ print $2 }') echo "Added submodules: $ADDED_SUBMODULES" echo "ADDED_SUBMODULES=$ADDED_SUBMODULES" >> $GITHUB_ENV From 582131b33d4063c1fa9be0b089314c12a9b10f67 Mon Sep 17 00:00:00 2001 From: carsakiller Date: Mon, 25 Nov 2024 20:28:06 +0000 Subject: [PATCH 3/7] fix: fetch base and head --- .github/workflows/pull_request.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c11fb4be..37672089 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -17,13 +17,16 @@ jobs: - name: Fetch Base Branch run: | - git fetch origin ${GITHUB_BASE_REF} - git checkout ${GITHUB_BASE_REF} + # Fetch all history for the base branch and PR head + git fetch origin ${{ github.base_ref }} --depth=1 + git fetch origin ${{ github.head_ref }} --depth=1 - name: Detect Added Submodules run: | - BASE_REF=${{github.event.pull_request.base.sha}} - ADDED_SUBMODULES=$(git diff --submodule ${BASE_REF}..HEAD | grep '^Submodule' | awk '{ print $2 }') + BASE_REF=${{ github.event.pull_request.base.sha }} + HEAD_REF=${{ github.event.pull_request.head.sha }} + + ADDED_SUBMODULES=$(git diff --submodule ${BASE_REF}..${HEAD_REF} | grep '^Submodule' | awk '{ print $2 }') echo "Added submodules: $ADDED_SUBMODULES" echo "ADDED_SUBMODULES=$ADDED_SUBMODULES" >> $GITHUB_ENV @@ -52,13 +55,16 @@ jobs: - name: Fetch Base Branch run: | - git fetch origin ${GITHUB_BASE_REF} - git checkout ${GITHUB_BASE_REF} + # Fetch all history for the base branch and PR head + git fetch origin ${{ github.base_ref }} --depth=1 + git fetch origin ${{ github.head_ref }} --depth=1 - name: Detect Added Submodules run: | - BASE_REF=${{github.event.pull_request.base.sha}} - ADDED_SUBMODULES=$(git diff --submodule ${BASE_REF}..HEAD | grep '^Submodule' | awk '{ print $2 }') + BASE_REF=${{ github.event.pull_request.base.sha }} + HEAD_REF=${{ github.event.pull_request.head.sha }} + + ADDED_SUBMODULES=$(git diff --submodule ${BASE_REF}..${HEAD_REF} | grep '^Submodule' | awk '{ print $2 }') echo "Added submodules: $ADDED_SUBMODULES" echo "ADDED_SUBMODULES=$ADDED_SUBMODULES" >> $GITHUB_ENV From 5a509ad466db7fefb0804785a5da75dccb0c2ca3 Mon Sep 17 00:00:00 2001 From: carsakiller Date: Mon, 25 Nov 2024 20:33:13 +0000 Subject: [PATCH 4/7] fix: remove author from metadata commit --- .github/workflows/pull_request.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 37672089..be4e4078 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -94,6 +94,3 @@ jobs: with: commit_message: "chore: Update Addon Metadata" file_pattern: addons/*/info.json - commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> - commit_user_name: github-actions[bot] - commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com From b24180725fef8c073de94ad1b0048dacb2951f05 Mon Sep 17 00:00:00 2001 From: carsakiller Date: Mon, 25 Nov 2024 20:38:21 +0000 Subject: [PATCH 5/7] Revert "fix: remove author from metadata commit" This reverts commit 5a509ad466db7fefb0804785a5da75dccb0c2ca3. --- .github/workflows/pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index be4e4078..37672089 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -94,3 +94,6 @@ jobs: with: commit_message: "chore: Update Addon Metadata" file_pattern: addons/*/info.json + commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + commit_user_name: github-actions[bot] + commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com From 5ef15d539385a264e25a1927e5c873823e183265 Mon Sep 17 00:00:00 2001 From: carsakiller Date: Mon, 25 Nov 2024 20:38:40 +0000 Subject: [PATCH 6/7] ci: give write permissions --- .github/workflows/pull_request.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 37672089..ab65d596 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -47,6 +47,8 @@ jobs: metadata: name: "Fetch Addon Metadata" runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v3 name: Checkout LLS-Addons From 2389dbcb764eca57ba484f06cdca92b044fb1c7f Mon Sep 17 00:00:00 2001 From: carsakiller Date: Mon, 25 Nov 2024 20:43:05 +0000 Subject: [PATCH 7/7] ci: split actions --- .github/workflows/metadata.yml | 62 ++++++++++++++++++++++++++++++ .github/workflows/pull_request.yml | 56 --------------------------- 2 files changed, 62 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/metadata.yml diff --git a/.github/workflows/metadata.yml b/.github/workflows/metadata.yml new file mode 100644 index 00000000..fff466c7 --- /dev/null +++ b/.github/workflows/metadata.yml @@ -0,0 +1,62 @@ +name: Fetch Addon Metadata + +on: + pull_request_review: + types: [submitted] + +jobs: + metadata: + if: ${{ github.event.review.state == 'approved' }} + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + name: Checkout LLS-Addons + with: + submodules: false + + - name: Fetch Base Branch + run: | + # Fetch all history for the base branch and PR head + git fetch origin ${{ github.base_ref }} --depth=1 + git fetch origin ${{ github.head_ref }} --depth=1 + + - name: Detect Added Submodules + run: | + BASE_REF=${{ github.event.pull_request.base.sha }} + HEAD_REF=${{ github.event.pull_request.head.sha }} + + ADDED_SUBMODULES=$(git diff --submodule ${BASE_REF}..${HEAD_REF} | grep '^Submodule' | awk '{ print $2 }') + echo "Added submodules: $ADDED_SUBMODULES" + echo "ADDED_SUBMODULES=$ADDED_SUBMODULES" >> $GITHUB_ENV + + - name: Fetch submodules + run: | + for submodule in $ADDED_SUBMODULES; do + echo "Getting submodule: $submodule" + git submodule update --init --recursive $submodule + done + + # Custom action that gets metadata on each addon + - uses: dsaltares/fetch-gh-release-asset@1.1.0 + name: Get submodule metadata fetching action + with: + token: ${{ secrets.GITHUB_TOKEN }} + repo: LuaLS/LLS-Addons-Action + file: dist.zip + target: action.zip + - name: Unzip custom action + run: unzip action.zip -d action + - uses: ./action/dist + name: Get Addon Metadata + + # Commit new metadata + - name: Commit Metadata + uses: stefanzweifel/git-auto-commit-action@v4.16.0 + with: + commit_message: "chore: Update Addon Metadata" + file_pattern: addons/*/info.json + commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> + commit_user_name: github-actions[bot] + commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ab65d596..9fca0378 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -43,59 +43,3 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} version: latest args: --check addons - - metadata: - name: "Fetch Addon Metadata" - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - name: Checkout LLS-Addons - with: - submodules: false - - - name: Fetch Base Branch - run: | - # Fetch all history for the base branch and PR head - git fetch origin ${{ github.base_ref }} --depth=1 - git fetch origin ${{ github.head_ref }} --depth=1 - - - name: Detect Added Submodules - run: | - BASE_REF=${{ github.event.pull_request.base.sha }} - HEAD_REF=${{ github.event.pull_request.head.sha }} - - ADDED_SUBMODULES=$(git diff --submodule ${BASE_REF}..${HEAD_REF} | grep '^Submodule' | awk '{ print $2 }') - echo "Added submodules: $ADDED_SUBMODULES" - echo "ADDED_SUBMODULES=$ADDED_SUBMODULES" >> $GITHUB_ENV - - - name: Fetch submodules - run: | - for submodule in $ADDED_SUBMODULES; do - echo "Getting submodule: $submodule" - git submodule update --init --recursive $submodule - done - - # Custom action that gets metadata on each addon - - uses: dsaltares/fetch-gh-release-asset@1.1.0 - name: Get submodule metadata fetching action - with: - token: ${{ secrets.GITHUB_TOKEN }} - repo: LuaLS/LLS-Addons-Action - file: dist.zip - target: action.zip - - name: Unzip custom action - run: unzip action.zip -d action - - uses: ./action/dist - name: Get Addon Metadata - - # Commit new metadata - - name: Commit Metadata - uses: stefanzweifel/git-auto-commit-action@v4.16.0 - with: - commit_message: "chore: Update Addon Metadata" - file_pattern: addons/*/info.json - commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> - commit_user_name: github-actions[bot] - commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com