Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5fadf5a9a7 | ||
|
|
a6ae4994e9 | ||
|
|
12af9bddb1 | ||
|
|
92a840cf42 | ||
|
|
9210532cf1 | ||
|
|
66d5faead2 | ||
|
|
65c7a16cee | ||
|
|
46684402e6 |
+21
-20
@@ -15,47 +15,48 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: linux/amd64
|
||||||
|
container:
|
||||||
|
image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
- name: Verify .NET installation
|
path: build-${{ github.run_id }}
|
||||||
run: dotnet --version
|
|
||||||
|
|
||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
|
working-directory: build-${{ github.run_id }}
|
||||||
run: dotnet restore Jellyfin.Plugin.SRFPlay.sln
|
run: dotnet restore Jellyfin.Plugin.SRFPlay.sln
|
||||||
|
|
||||||
- name: Build solution
|
- name: Build solution
|
||||||
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Release --no-restore --no-self-contained
|
working-directory: build-${{ github.run_id }}
|
||||||
|
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Release --no-restore --no-self-contained /m:1
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
working-directory: build-${{ github.run_id }}
|
||||||
run: dotnet test Jellyfin.Plugin.SRFPlay.sln --no-build --configuration Release --verbosity normal
|
run: dotnet test Jellyfin.Plugin.SRFPlay.sln --no-build --configuration Release --verbosity normal
|
||||||
|
|
||||||
- name: Install JPRM
|
|
||||||
run: |
|
|
||||||
python3 -m venv /tmp/jprm-venv
|
|
||||||
/tmp/jprm-venv/bin/pip install jprm
|
|
||||||
|
|
||||||
- name: Build Jellyfin Plugin
|
- name: Build Jellyfin Plugin
|
||||||
id: jprm
|
id: jprm
|
||||||
|
working-directory: build-${{ github.run_id }}
|
||||||
run: |
|
run: |
|
||||||
# Create artifacts directory for JPRM output
|
|
||||||
mkdir -p artifacts
|
mkdir -p artifacts
|
||||||
|
jprm --verbosity=debug plugin build .
|
||||||
# Build plugin using JPRM
|
ARTIFACT=$(find . -name "*.zip" -type f -print -quit | sed 's|^\./||')
|
||||||
/tmp/jprm-venv/bin/jprm --verbosity=debug plugin build .
|
LATEST="artifacts/srfplay_latest.zip"
|
||||||
|
cp "${ARTIFACT}" "${LATEST}"
|
||||||
# Find the generated zip file
|
echo "artifact=${LATEST}" >> $GITHUB_OUTPUT
|
||||||
ARTIFACT=$(find . -name "*.zip" -type f -print -quit)
|
echo "Found artifact: ${ARTIFACT} -> ${LATEST}"
|
||||||
echo "artifact=${ARTIFACT}" >> $GITHUB_OUTPUT
|
|
||||||
echo "Found artifact: ${ARTIFACT}"
|
|
||||||
|
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: jellyfin-srfplay-plugin
|
name: jellyfin-srfplay-plugin
|
||||||
path: ${{ steps.jprm.outputs.artifact }}
|
path: build-${{ github.run_id }}/${{ steps.jprm.outputs.artifact }}
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Cleanup
|
||||||
|
if: always()
|
||||||
|
run: rm -rf build-${{ github.run_id }}
|
||||||
|
|||||||
@@ -13,14 +13,15 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-release:
|
build-and-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: linux/amd64
|
||||||
|
container:
|
||||||
|
image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
- name: Verify .NET installation
|
path: release-${{ github.run_id }}
|
||||||
run: dotnet --version
|
|
||||||
|
|
||||||
- name: Get version
|
- name: Get version
|
||||||
id: get_version
|
id: get_version
|
||||||
@@ -35,36 +36,31 @@ jobs:
|
|||||||
echo "Building version: ${VERSION}"
|
echo "Building version: ${VERSION}"
|
||||||
|
|
||||||
- name: Update build.yaml with version
|
- name: Update build.yaml with version
|
||||||
|
working-directory: release-${{ github.run_id }}
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.get_version.outputs.version_number }}"
|
VERSION="${{ steps.get_version.outputs.version_number }}"
|
||||||
sed -i "s/^version:.*/version: \"${VERSION}\"/" build.yaml
|
sed -i "s/^version:.*/version: \"${VERSION}\"/" build.yaml
|
||||||
cat build.yaml
|
cat build.yaml
|
||||||
|
|
||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
|
working-directory: release-${{ github.run_id }}
|
||||||
run: dotnet restore Jellyfin.Plugin.SRFPlay.sln
|
run: dotnet restore Jellyfin.Plugin.SRFPlay.sln
|
||||||
|
|
||||||
- name: Build solution
|
- name: Build solution
|
||||||
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Release --no-restore --no-self-contained
|
working-directory: release-${{ github.run_id }}
|
||||||
|
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Release --no-restore --no-self-contained /m:1
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
working-directory: release-${{ github.run_id }}
|
||||||
run: dotnet test Jellyfin.Plugin.SRFPlay.sln --no-build --configuration Release --verbosity normal
|
run: dotnet test Jellyfin.Plugin.SRFPlay.sln --no-build --configuration Release --verbosity normal
|
||||||
|
|
||||||
- name: Install JPRM
|
|
||||||
run: |
|
|
||||||
python3 -m venv /tmp/jprm-venv
|
|
||||||
/tmp/jprm-venv/bin/pip install jprm
|
|
||||||
|
|
||||||
- name: Build Jellyfin Plugin
|
- name: Build Jellyfin Plugin
|
||||||
id: jprm
|
id: jprm
|
||||||
|
working-directory: release-${{ github.run_id }}
|
||||||
run: |
|
run: |
|
||||||
# Create artifacts directory for JPRM output
|
|
||||||
mkdir -p artifacts
|
mkdir -p artifacts
|
||||||
|
jprm --verbosity=debug plugin build ./
|
||||||
# Build plugin using JPRM
|
ARTIFACT=$(find . -name "*.zip" -type f -print -quit | sed 's|^\./||')
|
||||||
/tmp/jprm-venv/bin/jprm --verbosity=debug plugin build ./
|
|
||||||
|
|
||||||
# Find the generated zip file
|
|
||||||
ARTIFACT=$(find . -name "*.zip" -type f -print -quit)
|
|
||||||
ARTIFACT_NAME=$(basename "${ARTIFACT}")
|
ARTIFACT_NAME=$(basename "${ARTIFACT}")
|
||||||
echo "artifact=${ARTIFACT}" >> $GITHUB_OUTPUT
|
echo "artifact=${ARTIFACT}" >> $GITHUB_OUTPUT
|
||||||
echo "artifact_name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
echo "artifact_name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
||||||
@@ -72,12 +68,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Calculate checksum
|
- name: Calculate checksum
|
||||||
id: checksum
|
id: checksum
|
||||||
|
working-directory: release-${{ github.run_id }}
|
||||||
run: |
|
run: |
|
||||||
CHECKSUM=$(md5sum "${{ steps.jprm.outputs.artifact }}" | awk '{print $1}')
|
CHECKSUM=$(md5sum "${{ steps.jprm.outputs.artifact }}" | awk '{print $1}')
|
||||||
echo "checksum=${CHECKSUM}" >> $GITHUB_OUTPUT
|
echo "checksum=${CHECKSUM}" >> $GITHUB_OUTPUT
|
||||||
echo "Checksum: ${CHECKSUM}"
|
echo "Checksum: ${CHECKSUM}"
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
|
working-directory: release-${{ github.run_id }}
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
@@ -86,22 +84,20 @@ jobs:
|
|||||||
REPO_NAME="${{ github.event.repository.name }}"
|
REPO_NAME="${{ github.event.repository.name }}"
|
||||||
GITEA_URL="${{ github.server_url }}"
|
GITEA_URL="${{ github.server_url }}"
|
||||||
|
|
||||||
# Prepare release body
|
# Build JSON payload with jq to handle escaping properly
|
||||||
RELEASE_BODY="SRFPlay Jellyfin Plugin ${{ steps.get_version.outputs.version }}\n\nSee attached files for plugin installation."
|
VERSION="${{ steps.get_version.outputs.version }}"
|
||||||
RELEASE_BODY_JSON=$(echo -n "${RELEASE_BODY}" | jq -Rs .)
|
PAYLOAD=$(jq -n \
|
||||||
|
--arg tag "${VERSION}" \
|
||||||
|
--arg name "Release ${VERSION}" \
|
||||||
|
--arg body "SRFPlay Jellyfin Plugin ${VERSION}\n\nSee attached files for plugin installation." \
|
||||||
|
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')
|
||||||
|
|
||||||
# Create release using Gitea API
|
# Create release using Gitea API
|
||||||
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
|
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases" \
|
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases" \
|
||||||
-d "{
|
-d "${PAYLOAD}")
|
||||||
\"tag_name\": \"${{ steps.get_version.outputs.version }}\",
|
|
||||||
\"name\": \"Release ${{ steps.get_version.outputs.version }}\",
|
|
||||||
\"body\": ${RELEASE_BODY_JSON},
|
|
||||||
\"draft\": false,
|
|
||||||
\"prerelease\": false
|
|
||||||
}")
|
|
||||||
|
|
||||||
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
|
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
|
||||||
BODY=$(echo "$RESPONSE" | sed '$d')
|
BODY=$(echo "$RESPONSE" | sed '$d')
|
||||||
@@ -135,6 +131,7 @@ jobs:
|
|||||||
echo "View at: ${GITEA_URL}/${REPO_OWNER}/${REPO_NAME}/releases/tag/${{ steps.get_version.outputs.version }}"
|
echo "View at: ${GITEA_URL}/${REPO_OWNER}/${REPO_NAME}/releases/tag/${{ steps.get_version.outputs.version }}"
|
||||||
|
|
||||||
- name: Update manifest.json
|
- name: Update manifest.json
|
||||||
|
working-directory: release-${{ github.run_id }}
|
||||||
env:
|
env:
|
||||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
@@ -168,3 +165,7 @@ jobs:
|
|||||||
git add manifest.json
|
git add manifest.json
|
||||||
git commit -m "Update manifest.json for version ${VERSION}"
|
git commit -m "Update manifest.json for version ${VERSION}"
|
||||||
git push origin master
|
git push origin master
|
||||||
|
|
||||||
|
- name: Cleanup
|
||||||
|
if: always()
|
||||||
|
run: rm -rf release-${{ github.run_id }}
|
||||||
|
|||||||
@@ -17,22 +17,26 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: linux/amd64
|
||||||
|
container:
|
||||||
|
image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
- name: Verify .NET installation
|
path: test-${{ github.run_id }}
|
||||||
run: dotnet --version
|
|
||||||
|
|
||||||
- name: Restore dependencies
|
- name: Restore dependencies
|
||||||
|
working-directory: test-${{ github.run_id }}
|
||||||
run: dotnet restore Jellyfin.Plugin.SRFPlay.sln
|
run: dotnet restore Jellyfin.Plugin.SRFPlay.sln
|
||||||
|
|
||||||
- name: Build solution
|
- name: Build solution
|
||||||
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Debug --no-restore --no-self-contained
|
working-directory: test-${{ github.run_id }}
|
||||||
|
run: dotnet build Jellyfin.Plugin.SRFPlay.sln --configuration Debug --no-restore --no-self-contained /m:1
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
working-directory: test-${{ github.run_id }}
|
||||||
run: dotnet test Jellyfin.Plugin.SRFPlay.sln --no-build --configuration Debug --verbosity normal --logger "trx;LogFileName=test-results.trx"
|
run: dotnet test Jellyfin.Plugin.SRFPlay.sln --no-build --configuration Debug --verbosity normal --logger "trx;LogFileName=test-results.trx"
|
||||||
|
|
||||||
- name: Upload test results
|
- name: Upload test results
|
||||||
@@ -40,5 +44,9 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: test-results
|
name: test-results
|
||||||
path: '**/test-results.trx'
|
path: test-${{ github.run_id }}/**/test-results.trx
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
|
- name: Cleanup
|
||||||
|
if: always()
|
||||||
|
run: rm -rf test-${{ github.run_id }}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# SRFPlay Builder Image
|
||||||
|
# Pre-built image with .NET SDK and JPRM for building Jellyfin plugins
|
||||||
|
# Build: docker build -f Dockerfile.builder -t gitea.tourolle.paris/dtourolle/srfplay-builder:latest .
|
||||||
|
# Push: docker push gitea.tourolle.paris/dtourolle/srfplay-builder:latest
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:8.0
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
python3 \
|
||||||
|
python3-pip \
|
||||||
|
git \
|
||||||
|
jq \
|
||||||
|
nodejs \
|
||||||
|
npm \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN pip install --break-system-packages jprm
|
||||||
|
|
||||||
|
WORKDIR /src
|
||||||
Reference in New Issue
Block a user