Skip to content

fix: Address Warning "inputstream.adaptive.manifest_type" property i… #26

fix: Address Warning "inputstream.adaptive.manifest_type" property i…

fix: Address Warning "inputstream.adaptive.manifest_type" property i… #26

Workflow file for this run

name: Auto Version and Release
on:
push:
branches:
- main
paths-ignore:
- '.github/**'
- '.gitignore'
jobs:
auto-tag:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
skip: ${{ steps.check_commit.outputs.skip }}
new_version: ${{ steps.get_tag.outputs.NEW_VERSION }}
release_created: ${{ steps.check_release.outputs.exists == 'false' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check if version bump commit
id: check_commit
run: |
COMMIT_MSG=$(git log -1 --pretty=%B)
if [[ "$COMMIT_MSG" == "chore: bump version to"* ]]; then
echo "skip=true" >> $GITHUB_OUTPUT
echo "Skipping workflow - this is a version bump commit"
else
echo "skip=false" >> $GITHUB_OUTPUT
echo "Proceeding with workflow"
fi
- name: Get latest tag
if: steps.check_commit.outputs.skip == 'false'
id: get_tag
run: |
# Get the latest tag, or use v0.0.0 if no tags exist
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_OUTPUT
# Extract version numbers
VERSION=${LATEST_TAG#v}
MAJOR=$(echo $VERSION | cut -d. -f1)
MINOR=$(echo $VERSION | cut -d. -f2)
PATCH=$(echo $VERSION | cut -d. -f3)
# Increment patch version
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="v${MAJOR}.${MINOR}.${NEW_PATCH}"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "Previous version: $LATEST_TAG"
echo "New version: $NEW_VERSION"
- name: Update addon.xml version and news
if: steps.check_commit.outputs.skip == 'false'
run: |
VERSION="${{ steps.get_tag.outputs.NEW_VERSION }}"
VERSION_NUMBER="${VERSION#v}"
LATEST_TAG="${{ steps.get_tag.outputs.LATEST_TAG }}"
CURRENT_DATE=$(date +%Y-%m-%d)
# Get commit messages since last tag
if [ "$LATEST_TAG" != "v0.0.0" ]; then
COMMIT_MESSAGES=$(git log ${LATEST_TAG}..HEAD --pretty=format:"- %s" | grep -v "^- chore: bump version" || echo "- Minor updates and improvements")
else
COMMIT_MESSAGES="- Initial release"
fi
# Create news entry
NEWS_ENTRY="[B]NextGen RT News ChangeLog $VERSION - $CURRENT_DATE[/B]\n$COMMIT_MESSAGES"
# Update ONLY the addon version in addon.xml (not xbmc.python version)
# Match: <addon id="plugin.video.nextgenrt" ... version="X.X.X" ...>
sed -i "s/\(<addon [^>]*version=\"\)[0-9]*\.[0-9]*\.[0-9]*\"/\1$VERSION_NUMBER\"/" plugin.video.nextgenrt/addon.xml
# Update news section in addon.xml (replace content between <news> tags)
# Using perl for better multi-line handling
perl -i -0pe "s|<news>.*?</news>|<news>$NEWS_ENTRY\n\t\t</news>|s" plugin.video.nextgenrt/addon.xml
# Show the changes
echo "Updated addon.xml version to $VERSION_NUMBER"
echo "Updated news section with latest changes"
- name: Commit version update
if: steps.check_commit.outputs.skip == 'false'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add plugin.video.nextgenrt/addon.xml
git commit -m "chore: bump version to ${{ steps.get_tag.outputs.NEW_VERSION }}" || echo "No changes to commit"
git push || echo "No changes to push"
- name: Check if release exists
if: steps.check_commit.outputs.skip == 'false'
id: check_release
run: |
if gh release view ${{ steps.get_tag.outputs.NEW_VERSION }} > /dev/null 2>&1; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Release ${{ steps.get_tag.outputs.NEW_VERSION }} already exists, skipping"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "Release ${{ steps.get_tag.outputs.NEW_VERSION }} does not exist, will create"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create plugin zip
if: steps.check_release.outputs.exists == 'false'
run: |
zip -r plugin.video.nextgenrt-${{ steps.get_tag.outputs.NEW_VERSION }}.zip plugin.video.nextgenrt
- name: Create Release with Tag
if: steps.check_release.outputs.exists == 'false'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.get_tag.outputs.NEW_VERSION }}
name: NextGen RT News ${{ steps.get_tag.outputs.NEW_VERSION }}
files: plugin.video.nextgenrt-${{ steps.get_tag.outputs.NEW_VERSION }}.zip
body: |
## NextGen RT News ${{ steps.get_tag.outputs.NEW_VERSION }}
### Installation
1. Download the `plugin.video.nextgenrt-${{ steps.get_tag.outputs.NEW_VERSION }}.zip` file below
2. In Kodi, go to Settings → Add-ons → Install from zip file
3. Select the downloaded zip file
4. The plugin will automatically install InputStream Adaptive if needed
### What's Changed
See the [README](https://github.com/poslogica/plugin.video.nextgenrt/blob/main/README.md) for full details.
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-repository:
runs-on: ubuntu-latest
needs: auto-tag
if: needs.auto-tag.outputs.skip == 'false'
permissions:
contents: write
steps:
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout main branch addon files
run: |
git fetch origin main
git checkout origin/main -- plugin.video.nextgenrt/addon.xml repository.nextgenrt/addon.xml
- name: Wait for release asset
run: |
VERSION="${{ needs.auto-tag.outputs.new_version }}"
VERSION_NUMBER="${VERSION#v}"
echo "Waiting for release ${VERSION} asset to be available..."
for i in {1..30}; do
if wget --spider "https://github.com/poslogica/plugin.video.nextgenrt/releases/download/${VERSION}/plugin.video.nextgenrt-${VERSION}.zip" 2>&1 | grep -q '200 OK'; then
echo "Release asset is available!"
break
fi
echo "Attempt $i: Asset not ready yet, waiting 10 seconds..."
sleep 10
done
- name: Download latest release zip
run: |
VERSION="${{ needs.auto-tag.outputs.new_version }}"
VERSION_NUMBER="${VERSION#v}"
wget "https://github.com/poslogica/plugin.video.nextgenrt/releases/download/${VERSION}/plugin.video.nextgenrt-${VERSION}.zip" \
-O plugin.video.nextgenrt/plugin.video.nextgenrt-${VERSION_NUMBER}.zip
echo "Downloaded plugin version ${VERSION} as ${VERSION_NUMBER}"
# Ensure downloads folder exists and copy ONLY the repository zip for users
mkdir -p downloads
if [ -f repository.nextgenrt/repository.nextgenrt-1.0.0.zip ]; then
cp -f repository.nextgenrt/repository.nextgenrt-1.0.0.zip downloads/
fi
- name: Setup Python (for Internet Archive CLI)
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Internet Archive CLI
run: pip install --upgrade internetarchive
- name: Upload repository zip to Internet Archive
env:
IA_ACCESS_KEY: ${{ secrets.IA_ACCESS_KEY }}
IA_SECRET_KEY: ${{ secrets.IA_SECRET_KEY }}
run: |
# Upload the Kodi repository zip (if present) to Internet Archive
FILE=$(ls downloads/repository.nextgenrt-*.zip 2>/dev/null | head -n1 || true)
if [ -n "$FILE" ] && [ -n "${IA_ACCESS_KEY:-}" ] && [ -n "${IA_SECRET_KEY:-}" ]; then
# Configure Internet Archive CLI with the provided credentials (expected sections/keys)
mkdir -p "$HOME/.config"
SCREENNAME=${GITHUB_REPOSITORY_OWNER:-poslogica}
CONFIG_FILE="$HOME/.config/ia.ini"
{
echo "[general]";
echo "screenname = ${SCREENNAME}";
echo;
echo "[s3]";
echo "access = ${IA_ACCESS_KEY}";
echo "secret = ${IA_SECRET_KEY}";
} > "$CONFIG_FILE"
chmod 600 "$CONFIG_FILE"
IDENTIFIER="nextgenrtkodirepository"
echo "Uploading $FILE to Internet Archive as item: $IDENTIFIER"
ia -c "$HOME/.config/ia.ini" upload "$IDENTIFIER" "$FILE" \
--metadata="title:NextGen RT Kodi Repository" \
--metadata="mediatype:software" \
--metadata="collection:open_source_software" \
--metadata="creator:${{ github.repository_owner }}" \
--metadata="subject:Kodi;Addon;Repository" \
--no-derive \
--retries 5
else
echo "Skipping Internet Archive upload (file or credentials missing)."
fi
- name: Generate static downloads index (for Kodi)
run: |
# Kodi's file manager doesn't execute JavaScript, so generate a plain HTML listing
cat > downloads/index.html << 'EOF'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Downloads - NextGen RT News</title>
<style>
body { font-family: Arial, sans-serif; padding: 24px; max-width: 900px; margin: 0 auto; }
h1 { color: #8BC63F; }
ul { line-height: 1.9; }
a { color: #0060df; text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
</style>
</head>
<body>
<h1>Downloads</h1>
<p>Direct download files:</p>
<ul>
EOF
for f in downloads/*.zip; do
[ -e "$f" ] || continue
base=$(basename "$f")
echo " <li><a class=\"mono\" href=\"$base\">$base</a></li>" >> downloads/index.html
done
cat >> downloads/index.html << 'EOF'
</ul>
<p class="mono">This index is generated automatically.</p>
</body>
</html>
EOF
- name: Update addons.xml
run: |
# Create addons.xml from addon.xml files
cat > addons.xml << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<addons>
EOF
# Add plugin addon
sed -n '/<addon/,/<\/addon>/p' plugin.video.nextgenrt/addon.xml | sed 's/^/\t/' >> addons.xml
# Add repository addon
sed -n '/<addon/,/<\/addon>/p' repository.nextgenrt/addon.xml | sed 's/^/\t/' >> addons.xml
echo "</addons>" >> addons.xml
# Generate MD5
md5sum addons.xml | cut -d' ' -f1 > addons.xml.md5
echo "Updated addons.xml and checksum"
- name: Upload addons.xml and md5 to Internet Archive
env:
IA_ACCESS_KEY: ${{ secrets.IA_ACCESS_KEY }}
IA_SECRET_KEY: ${{ secrets.IA_SECRET_KEY }}
run: |
# Upload repository index files to Internet Archive so a mirror stays updated
if [ -f addons.xml ] && [ -f addons.xml.md5 ] && [ -n "${IA_ACCESS_KEY:-}" ] && [ -n "${IA_SECRET_KEY:-}" ]; then
mkdir -p "$HOME/.config"
SCREENNAME=${GITHUB_REPOSITORY_OWNER:-poslogica}
CONFIG_FILE="$HOME/.config/ia.ini"
{
echo "[general]";
echo "screenname = ${SCREENNAME}";
echo;
echo "[s3]";
echo "access = ${IA_ACCESS_KEY}";
echo "secret = ${IA_SECRET_KEY}";
} > "$CONFIG_FILE"
chmod 600 "$CONFIG_FILE"
IDENTIFIER="nextgenrtkodirepository"
echo "Uploading addons.xml and addons.xml.md5 to Internet Archive item: $IDENTIFIER"
ia -c "$CONFIG_FILE" upload "$IDENTIFIER" addons.xml addons.xml.md5 \
--metadata="title:NextGen RT Kodi Repository" \
--metadata="mediatype:software" \
--metadata="collection:open_source_software" \
--metadata="creator:${{ github.repository_owner }}" \
--metadata="subject:Kodi;Addon;Repository" \
--no-derive \
--retries 5
else
echo "Skipping IA upload for addons.xml (files or credentials missing)."
fi
- name: Commit and push to gh-pages
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add plugin.video.nextgenrt/*.zip addons.xml addons.xml.md5 plugin.video.nextgenrt/addon.xml downloads/repository.nextgenrt-*.zip downloads/index.html || true
git commit -m "chore: update repository with plugin ${{ needs.auto-tag.outputs.new_version }}" || echo "No changes"
git push || echo "No changes to push"