diff --git a/.gitea/workflows/build-publish.yaml b/.gitea/workflows/build-publish.yaml index dee0f75..3fc9738 100644 --- a/.gitea/workflows/build-publish.yaml +++ b/.gitea/workflows/build-publish.yaml @@ -10,19 +10,24 @@ jobs: build: name: Build Plugin + Update Manifest runs-on: ubuntu-latest - + steps: - name: Checkout Repo uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.GT_TOKEN }} - + - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: '9.0.x' - + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Set version from tag id: vars run: | @@ -30,31 +35,28 @@ jobs: VERSION="${TAG#v}" # Remove 'v' prefix echo "VERSION=$VERSION" >> "$GITHUB_ENV" echo "TAG=$TAG" >> "$GITHUB_ENV" - - - name: Restore dependencies - run: dotnet restore - - - name: Build plugin + + - name: Install JPRM + run: pip install jprm + + - name: Build plugin with JPRM run: | - dotnet publish Jellyfin.Plugin.SmartNotify/Jellyfin.Plugin.SmartNotify.csproj \ - --configuration Release \ - --output ./publish \ - -p:Version=${VERSION}.0 - - - name: Create plugin ZIP + jprm --verbosity=debug plugin build Jellyfin.Plugin.SmartNotify \ + --dotnet-framework="net9.0" \ + --version="${VERSION}.0" \ + --output=./artifacts + + - name: Prepare artifact run: | - # Only include plugin DLL and actual dependencies (not Jellyfin framework DLLs) - cd publish - zip ../smartnotify_${VERSION}.zip \ - Jellyfin.Plugin.SmartNotify.dll \ - LiteDB.dll - cd .. + # Find the ZIP that JPRM created + ARTIFACT=$(ls artifacts/*.zip | head -1) + cp "$ARTIFACT" "smartnotify_${VERSION}.zip" # Calculate MD5 checksum - CHECKSUM=$(md5sum smartnotify_${VERSION}.zip | cut -d' ' -f1) + CHECKSUM=$(md5sum "smartnotify_${VERSION}.zip" | cut -d' ' -f1) echo "CHECKSUM=$CHECKSUM" >> "$GITHUB_ENV" echo "Checksum: $CHECKSUM" - + - name: Upload ZIP to Release env: GIT_TOKEN: ${{ secrets.GT_TOKEN }} @@ -62,13 +64,13 @@ jobs: # Get release ID RELEASE_ID=$(curl -s "https://git.tdpi.dev/api/v1/repos/TDPI/jellyfin-plugin-smartnotify/releases/tags/${TAG}" \ -H "Authorization: token $GIT_TOKEN" | jq -r '.id') - + # Upload asset curl -X POST "https://git.tdpi.dev/api/v1/repos/TDPI/jellyfin-plugin-smartnotify/releases/${RELEASE_ID}/assets?name=smartnotify_${VERSION}.zip" \ -H "Authorization: token $GIT_TOKEN" \ -H "Content-Type: application/octet-stream" \ --data-binary @smartnotify_${VERSION}.zip - + - name: Update manifest.json env: GIT_TOKEN: ${{ secrets.GT_TOKEN }} @@ -76,14 +78,14 @@ jobs: # Get changelog for this version CHANGELOG=$(awk '/^## '"$VERSION"'/{flag=1} /^## / && flag && !/^## '"$VERSION"'/{exit} flag' CHANGELOG.md | tail -n +2) TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ") - + # Update manifest.json with new version python3 << EOF import json - + with open('manifest.json', 'r') as f: manifest = json.load(f) - + new_version = { "version": "${VERSION}.0", "changelog": """${CHANGELOG}""".strip(), @@ -92,26 +94,26 @@ jobs: "checksum": "${CHECKSUM}", "timestamp": "${TIMESTAMP}" } - + # Insert at beginning of versions array manifest[0]["versions"].insert(0, new_version) - + # Keep only last 10 versions manifest[0]["versions"] = manifest[0]["versions"][:10] - + with open('manifest.json', 'w') as f: json.dump(manifest, f, indent=2, ensure_ascii=False) - + print("Manifest updated successfully") EOF - + # Commit and push manifest git config user.name "Gitea Actions" git config user.email "actions@git.tdpi.dev" git add manifest.json git commit -m "chore: update manifest for ${TAG}" git push https://x-access-token:${GIT_TOKEN}@git.tdpi.dev/TDPI/jellyfin-plugin-smartnotify.git HEAD:main - + - name: Summary run: | echo "## Build Summary" >> $GITHUB_STEP_SUMMARY diff --git a/Jellyfin.Plugin.SmartNotify/Jellyfin.Plugin.SmartNotify.csproj b/Jellyfin.Plugin.SmartNotify/Jellyfin.Plugin.SmartNotify.csproj index 1997bfc..def70e4 100644 --- a/Jellyfin.Plugin.SmartNotify/Jellyfin.Plugin.SmartNotify.csproj +++ b/Jellyfin.Plugin.SmartNotify/Jellyfin.Plugin.SmartNotify.csproj @@ -13,17 +13,19 @@ Default - - - + + runtime + + + runtime + - - \ No newline at end of file + diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..c0f3a07 --- /dev/null +++ b/build.yaml @@ -0,0 +1,14 @@ +name: "SmartNotify" +guid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" +targetAbi: "10.11.0.0" +framework: "net9.0" +overview: "Intelligent Discord notifications for new media" +description: > + Smart Discord notifications that detect quality upgrades vs truly new content. + Groups episodes intelligently (e.g., 'Episode 1-12 added'). +category: "Notifications" +owner: "TDPI" +artifacts: +- "Jellyfin.Plugin.SmartNotify.dll" +- "LiteDB.dll" +changelog: ""