From 90c019fc9b05d5702cc76c0006b46b4d187dea10 Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Thu, 28 Mar 2024 13:39:31 +1100 Subject: [PATCH] Update workflows to use single release for Kodi v19+ --- .github/workflows/make-release.yml | 102 ++++----------------------- .github/workflows/submit-release.yml | 49 ++----------- addon.xml | 4 +- 3 files changed, 19 insertions(+), 136 deletions(-) diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index 4b21880e5..d9ea276e7 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -49,57 +49,9 @@ jobs: echo "${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_OUTPUT working-directory: ${{ github.event.repository.name }} - - name: Create Zip (Nexus) - id: zip-nexus + - name: Create Zip + id: zip run: | - mv .git .. - rm -rf .??* - rm *.md - news=$(awk '/^## /{rel_num++} {if(rel_num==2){exit} if(rel_num==1){print}}' changelog.txt | sed -E 's/ ?#[[:digit:]]+[., ]?//;s/\r//') - version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) - xmlstarlet ed -L -P \ - -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \ - -u '/addon/@version' -v "${version}+nexus.1" \ - addon.xml - filename=${{ github.event.repository.name }}-${version}.nexus.1.zip - cd .. - zip -r $filename ${{ github.event.repository.name }} - mv .git ${{ github.event.repository.name }} - echo "filename=$filename" >> $GITHUB_OUTPUT - working-directory: ${{ github.event.repository.name }} - - - name: Create Zip (Nexus-Unofficial) - id: zip-unofficial-nexus - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git reset - git checkout . - git fetch origin nexus-unofficial - git -c user.email="\<\>" -c user.name="make-release" merge -X theirs --allow-unrelated-histories origin/nexus-unofficial - git clean -fdx - mv .git .. - rm -rf .??* - rm *.md - news=$(awk '/^## /{rel_num++} {if(rel_num==2){exit} if(rel_num==1){print}}' changelog.txt | sed -E 's/ ?#[[:digit:]]+[., ]?//;s/\r//') - version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) - xmlstarlet ed -L -P \ - -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \ - -u '/addon/@version' -v "${version}+nexus.unofficial.1" \ - addon.xml - filename=${{ github.event.repository.name }}-${version}.nexus.unofficial.1.zip - cd .. - zip -r $filename ${{ github.event.repository.name }} - mv .git ${{ github.event.repository.name }} - echo "filename=$filename" >> $GITHUB_OUTPUT - working-directory: ${{ github.event.repository.name }} - - - name: Create Zip (Matrix) - id: zip-matrix - run: | - git reset - git checkout . - git clean -fdx mv .git .. rm -rf .??* rm *.md @@ -108,9 +60,6 @@ jobs: xmlstarlet ed -L -P \ -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \ -u '/addon/@version' -v "${version}+matrix.1" \ - -u '/addon/requires/import[@addon="xbmc.python"]/@version' -v '3.0.0' \ - -u '/addon/requires/import[@addon="inputstream.adaptive"]/@version' -v '19.0.0' \ - -d '/addon/requires/import[@addon="script.module.infotagger"]' \ addon.xml filename=${{ github.event.repository.name }}-${version}.matrix.1.zip cd .. @@ -119,8 +68,8 @@ jobs: echo "filename=$filename" >> $GITHUB_OUTPUT working-directory: ${{ github.event.repository.name }} - - name: Create Zip (Matrix-Unofficial) - id: zip-unofficial-matrix + - name: Create Zip (Unofficial) + id: zip-unofficial env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -137,9 +86,6 @@ jobs: xmlstarlet ed -L -P \ -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \ -u '/addon/@version' -v "${version}+matrix.unofficial.1" \ - -u '/addon/requires/import[@addon="xbmc.python"]/@version' -v '3.0.0' \ - -u '/addon/requires/import[@addon="inputstream.adaptive"]/@version' -v '19.0.0' \ - -d '/addon/requires/import[@addon="script.module.infotagger"]' \ addon.xml filename=${{ github.event.repository.name }}-${version}.matrix.unofficial.1.zip cd .. @@ -166,7 +112,6 @@ jobs: -d '/addon/requires/import[@addon="script.module.requests"]/@version' \ -d '/addon/requires/import[@addon="inputstream.adaptive"]/@version' \ -d '/addon/requires/import[@addon="script.module.inputstreamhelper"]/@version' \ - -d '/addon/requires/import[@addon="script.module.infotagger"]' \ -s '/addon/requires' -t elem -n import_temp \ -s '/addon/requires/import_temp' -t attr -n addon -v 'script.module.kodi-six' \ -r '/addon/requires/import_temp' -v import \ @@ -200,7 +145,6 @@ jobs: -d '/addon/requires/import[@addon="script.module.requests"]/@version' \ -d '/addon/requires/import[@addon="inputstream.adaptive"]/@version' \ -d '/addon/requires/import[@addon="script.module.inputstreamhelper"]/@version' \ - -d '/addon/requires/import[@addon="script.module.infotagger"]' \ -s '/addon/requires' -t elem -n import_temp \ -s '/addon/requires/import_temp' -t attr -n addon -v 'script.module.kodi-six' \ -r '/addon/requires/import_temp' -v import \ @@ -224,48 +168,26 @@ jobs: draft: false prerelease: ${{ steps.release.outputs.pre-release }} - - name: Upload Zip (Nexus) - id: upload-nexus - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_name: ${{ steps.zip-nexus.outputs.filename }} - asset_path: ${{ steps.zip-nexus.outputs.filename }} - asset_content_type: application/zip - - - name: Upload Zip (Nexus-Unofficial) - id: upload-unofficial-nexus - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_name: ${{ steps.zip-unofficial-nexus.outputs.filename }} - asset_path: ${{ steps.zip-unofficial-nexus.outputs.filename }} - asset_content_type: application/zip - - - name: Upload Zip (Matrix) - id: upload-matrix + - name: Upload Zip + id: upload uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_name: ${{ steps.zip-matrix.outputs.filename }} - asset_path: ${{ steps.zip-matrix.outputs.filename }} + asset_name: ${{ steps.zip.outputs.filename }} + asset_path: ${{ steps.zip.outputs.filename }} asset_content_type: application/zip - - name: Upload Zip (Matrix-Unofficial) - id: upload-unofficial-matrix + - name: Upload Zip (Unofficial) + id: upload-unofficial uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create-release.outputs.upload_url }} - asset_name: ${{ steps.zip-unofficial-matrix.outputs.filename }} - asset_path: ${{ steps.zip-unofficial-matrix.outputs.filename }} + asset_name: ${{ steps.zip-unofficial.outputs.filename }} + asset_path: ${{ steps.zip-unofficial.outputs.filename }} asset_content_type: application/zip - name: Upload Zip (Leia) diff --git a/.github/workflows/submit-release.yml b/.github/workflows/submit-release.yml index 81263dcd9..bad8561c4 100644 --- a/.github/workflows/submit-release.yml +++ b/.github/workflows/submit-release.yml @@ -42,8 +42,8 @@ jobs: git config --global user.name "anxdpanic" git config --global user.email "anxdpanic@users.noreply.github.com" - - name: Staging for Official Repository (Nexus) - id: stage-nexus + - name: Staging for Official Repository + id: stage run: | mv .git .. rm -rf .??* @@ -55,53 +55,14 @@ jobs: version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) xmlstarlet ed -L -P \ -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \ - -u '/addon/@version' -v "${version}+nexus.1" \ - addon.xml - git add . - git commit -m "Update news and repository identifier" - working-directory: ${{ github.event.repository.name }} - - - name: Submit to Official Repository (Nexus) - id: submit-nexus - run: | - submit-addon -r repo-plugins -b nexus --pull-request ${{ github.event.repository.name }} - working-directory: ${{ github.event.repository.name }} - env: - GH_USERNAME: anxdpanic - GH_TOKEN: ${{ secrets.ADDON_SUBMISSION_TOKEN }} - EMAIL: anxdpanic@users.noreply.github.com - - - name: Staging for Official Repository (Matrix) - id: stage-matrix - run: | - git reset --hard ${{ github.sha }} - git checkout . - git clean -fdx - mv .git .. - rm -rf .??* - mv ../.git . - rm *.md - git add . - git commit -m "Remove Unwanted Files" - news=$(awk '/^## /{rel_num++} {if(rel_num==2){exit} if(rel_num==1){print}}' changelog.txt | sed -E 's/ ?#[[:digit:]]+[., ]?//;s/\r//') - xmlstarlet ed -L -P \ - -s '/addon/extension[@point="xbmc.addon.metadata"]' -t elem -n news -v "${news:0:1500}" \ - addon.xml - git add . - git commit -m "Update news" - version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) - xmlstarlet ed -L -P \ -u '/addon/@version' -v "${version}+matrix.1" \ - -u '/addon/requires/import[@addon="xbmc.python"]/@version' -v '3.0.0' \ - -u '/addon/requires/import[@addon="inputstream.adaptive"]/@version' -v '19.0.0' \ - -d '/addon/requires/import[@addon="script.module.infotagger"]' \ addon.xml git add . - git commit -m "Kodi 19 Patch" + git commit -m "Update news and repository identifier" working-directory: ${{ github.event.repository.name }} - - name: Submit to Official Repository (Matrix) - id: submit-matrix + - name: Submit to Official Repository + id: submit run: | submit-addon -r repo-plugins -b matrix --pull-request ${{ github.event.repository.name }} working-directory: ${{ github.event.repository.name }} diff --git a/addon.xml b/addon.xml index c4a9381c2..447b7cd0e 100644 --- a/addon.xml +++ b/addon.xml @@ -1,9 +1,9 @@ - + - +