The builder image is now multi-arch (linux/amd64 + linux/arm64, pushed as srfplay-builder:latest after building all three plugin zips in each variant), so jobs no longer need an amd64 host. runs-on moves from linux/amd64 to ubuntu-latest, which draco-x86, freebox and oracle-a1 all carry, so a job no longer waits behind long jobs on draco while the ARM runners sit idle. .gitea/runner/cloud-init.yaml sets up such a runner on an Oracle Cloud Always Free Ampere VM (Ubuntu 24.04): Docker, act_runner registered instance-wide with the instance's label set, and a weekly image prune. The registration token and the optional console password hash are placeholders here and must be filled in locally before use. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
82 lines
2.7 KiB
YAML
82 lines
2.7 KiB
YAML
name: '🏗️ Build Plugin'
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- '**/*.md'
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
paths-ignore:
|
|
- '**/*.md'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: gitea.tourolle.paris/dtourolle/srfplay-builder:latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
path: build-${{ github.run_id }}
|
|
|
|
- name: Cache NuGet packages
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ~/.nuget/packages
|
|
key: nuget-${{ hashFiles('**/Jellyfin.Plugin.SRFPlay.csproj', '**/Jellyfin.Plugin.SRFPlay.Tests.csproj') }}
|
|
restore-keys: nuget-
|
|
|
|
- name: Restore dependencies
|
|
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.<YYYYMMDD>-pr<N>.<run_number>.
|
|
# 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 "format=${VERSION}%02d" >> $GITHUB_OUTPUT
|
|
echo "label=${LABEL}" >> $GITHUB_OUTPUT
|
|
echo "Build version: ${VERSION} (${LABEL})"
|
|
|
|
- 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
|
|
|
|
- name: Run tests
|
|
working-directory: build-${{ github.run_id }}
|
|
run: dotnet test Jellyfin.Plugin.SRFPlay.sln --no-build --configuration Release --verbosity normal
|
|
|
|
- name: Build Jellyfin Plugins
|
|
working-directory: build-${{ github.run_id }}
|
|
# One zip per Jellyfin generation (see .gitea/scripts/build-plugins.sh).
|
|
run: .gitea/scripts/build-plugins.sh "${{ steps.version.outputs.format }}"
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: srfplay-${{ steps.version.outputs.label }}-${{ steps.version.outputs.version }}
|
|
path: build-${{ github.run_id }}/artifacts/*.zip
|
|
retention-days: 30
|
|
if-no-files-found: error
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
run: rm -rf build-${{ github.run_id }}
|