From 110138510704157b35477cbc835ebebc843668bd Mon Sep 17 00:00:00 2001 From: Duncan Tourolle Date: Sat, 27 Jun 2026 11:29:32 +0200 Subject: [PATCH] Really fix CI --- .gitea/workflows/build.yaml | 25 ++++++++++++++++++- Directory.Build.targets | 17 +++++++++++++ .../Jellyfin.Plugin.SRFPlay.csproj | 9 ------- 3 files changed, 41 insertions(+), 10 deletions(-) create mode 100644 Directory.Build.targets diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 8b2ae44..5f1183e 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -36,6 +36,29 @@ jobs: working-directory: build-${{ github.run_id }} run: dotnet restore Jellyfin.Plugin.SRFPlay.sln + - name: Compute build version + id: version + run: | + # For PRs, stamp a distinct version so a side-loaded build is + # identifiable in Jellyfin: 1.0.-pr.. + # For plain master pushes, keep a date-based dev version. + DATE=$(date -u +"%Y%m%d") + if [ -n "${{ github.event.pull_request.number }}" ]; then + VERSION="1.0.${DATE}.${{ github.run_number }}" + LABEL="pr${{ github.event.pull_request.number }}" + else + VERSION="1.0.${DATE}.${{ github.run_number }}" + LABEL="master" + fi + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "label=${LABEL}" >> $GITHUB_OUTPUT + echo "Build version: ${VERSION} (${LABEL})" + + - name: Set build version + working-directory: build-${{ github.run_id }} + run: | + sed -i "s/^version:.*/version: \"${{ steps.version.outputs.version }}\"/" build.yaml + - name: Build solution working-directory: build-${{ github.run_id }} run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Release --no-restore --no-self-contained /m:1 @@ -59,7 +82,7 @@ jobs: - name: Upload build artifact uses: actions/upload-artifact@v3 with: - name: jellyfin-srfplay-plugin + name: srfplay-${{ steps.version.outputs.label }}-${{ steps.version.outputs.version }} path: build-${{ github.run_id }}/${{ steps.jprm.outputs.artifact }} retention-days: 30 if-no-files-found: error diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 0000000..547881b --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,17 @@ + + + + 1.0.0.0 + 1.0.0.0 + + diff --git a/Jellyfin.Plugin.SRFPlay/Jellyfin.Plugin.SRFPlay.csproj b/Jellyfin.Plugin.SRFPlay/Jellyfin.Plugin.SRFPlay.csproj index 3cd9803..c824c13 100644 --- a/Jellyfin.Plugin.SRFPlay/Jellyfin.Plugin.SRFPlay.csproj +++ b/Jellyfin.Plugin.SRFPlay/Jellyfin.Plugin.SRFPlay.csproj @@ -8,15 +8,6 @@ enable AllEnabledByDefault ../jellyfin.ruleset - - 1.0.0.0 - 1.0.0.0