Skip to content

Commit

Permalink
Update workflows to use single release for Kodi v19+
Browse files Browse the repository at this point in the history
  • Loading branch information
MoojMidge committed Mar 28, 2024
1 parent 0957b3b commit 90c019f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 136 deletions.
102 changes: 12 additions & 90 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ..
Expand All @@ -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: |
Expand All @@ -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 ..
Expand All @@ -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 \
Expand Down Expand Up @@ -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 \
Expand All @@ -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)
Expand Down
49 changes: 5 additions & 44 deletions .github/workflows/submit-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
git config --global user.name "anxdpanic"
git config --global user.email "[email protected]"
- name: Staging for Official Repository (Nexus)
id: stage-nexus
- name: Staging for Official Repository
id: stage
run: |
mv .git ..
rm -rf .??*
Expand All @@ -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: [email protected]

- 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 }}
Expand Down
4 changes: 2 additions & 2 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.youtube" name="YouTube" version="7.0.5+beta.1" provider-name="anxdpanic, bromix">
<requires>
<import addon="xbmc.python" version="3.0.1"/>
<import addon="xbmc.python" version="3.0.0"/>
<import addon="script.module.requests" version="2.27.1"/>
<import addon="inputstream.adaptive" version="20.0.0"/>
<import addon="inputstream.adaptive" version="19.0.0"/>
<import addon="script.module.inputstreamhelper" version="0.2.2" optional="true"/>
</requires>
<extension point="xbmc.python.pluginsource" library="resources/lib/plugin.py">
Expand Down

0 comments on commit 90c019f

Please sign in to comment.