name: Release Plugin # Releases are published to a *separate public* distribution repo, not this one. # Gitea has no way to make individual release assets public while the source repo # stays private -- repo visibility is all-or-nothing, confirmed against Gitea's own # docs/issue tracker -- so the actual plugin zip + manifest.json live in # PUBLIC_REPO_NAME below, kept in sync by this workflow. This (private source) repo # never needs to be public for Jellyfin installs to work. env: PUBLIC_REPO_NAME: JellyfinSyncPlus-repo on: push: tags: - 'v*' jobs: release: runs-on: ubuntu-latest steps: - name: Checkout tagged commit uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup .NET uses: https://github.com/actions/setup-dotnet@v4 with: dotnet-version: '9.0.x' - name: metadata id: meta run: | echo REPO_OWNER=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $1}') >> $GITHUB_OUTPUT echo VERSION=$(echo ${GITHUB_REF_NAME} | sed 's/^v//') >> $GITHUB_OUTPUT cat $GITHUB_OUTPUT # Fetch the two private (non-NuGet) server assemblies our plugin needs a # compile-time-only reference to -- see PLAN.md "Known friction / risks" and # dev/extract-private-refs.sh, which this mirrors for CI instead of a local # docker container. - name: Fetch private SDK references run: | mkdir -p lib/jellyfin-10.11.6 docker create --name jf-extract linuxserver/jellyfin:10.11.6 docker cp jf-extract:/usr/lib/jellyfin/bin/Emby.Server.Implementations.dll lib/jellyfin-10.11.6/ docker rm jf-extract - name: Build and package id: package env: VERSION: ${{ steps.meta.outputs.VERSION }} SERVER_URL: ${{ github.server_url }} PUBLIC_REPO_OWNER: ${{ steps.meta.outputs.REPO_OWNER }} PUBLIC_REPO_NAME: ${{ env.PUBLIC_REPO_NAME }} run: dev/package-release.sh - name: Create release and upload zip on the public repo env: GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }} SERVER_URL: ${{ github.server_url }} PUBLIC_REPO_OWNER: ${{ steps.meta.outputs.REPO_OWNER }} VERSION: ${{ steps.meta.outputs.VERSION }} TAG: ${{ github.ref_name }} ZIP_PATH: ${{ steps.package.outputs.ZIP_PATH }} run: | RELEASE_ID=$(curl -sf -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: application/json" \ -d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"body\":\"See build.yaml changelog / manifest.json for this version's notes.\"}" \ "${SERVER_URL}/api/v1/repos/${PUBLIC_REPO_OWNER}/${PUBLIC_REPO_NAME}/releases" | python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])') curl -sf -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ -F "attachment=@${ZIP_PATH}" \ "${SERVER_URL}/api/v1/repos/${PUBLIC_REPO_OWNER}/${PUBLIC_REPO_NAME}/releases/${RELEASE_ID}/assets?name=JellyfinSyncPlus_${VERSION}.zip" - name: Publish manifest.json to the public repo env: GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }} SERVER_URL: ${{ github.server_url }} PUBLIC_REPO_OWNER: ${{ steps.meta.outputs.REPO_OWNER }} VERSION: ${{ steps.meta.outputs.VERSION }} CHECKSUM: ${{ steps.package.outputs.CHECKSUM }} SOURCE_URL: ${{ steps.package.outputs.SOURCE_URL }} run: dev/publish-manifest.sh