Skip to content

Commit

Permalink
Merge pull request #354 from lwbt/pr-update-to-v10.9
Browse files Browse the repository at this point in the history
Update dependencies to fix builds for v10.9
  • Loading branch information
lwbt authored Nov 17, 2024
2 parents 58d323d + d969d1e commit 3b1332b
Show file tree
Hide file tree
Showing 8 changed files with 25,210 additions and 16,860 deletions.
124 changes: 62 additions & 62 deletions .github/workflows/NuGet-Checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: NuGet Checker

on:
schedule:
- cron: '0 0/12 * * *'
- cron: 0 0/12 * * *
workflow_dispatch:

jobs:
Expand All @@ -13,71 +13,71 @@ jobs:
pull-requests: write

steps:
- uses: actions/checkout@v3
with:
path: main

- name: Check if branch exist
working-directory: main
run: |
if [ "$(git ls-remote --heads origin update-nuget)" != "" ]; then
echo "::warning ::Branch update-nuget exist. Merge PR or delete the branch"
exit 1
fi
- uses: actions/checkout@v4
with:
path: main

- name: Flatpak Cache
uses: actions/cache@v3
with:
path: |
~/.local/share/flatpak
key: flatpak-cache-x86_64-${{ github.sha }}
restore-keys: |
flatpak
- name: Check if branch exist
working-directory: main
run: |
if [ "$(git ls-remote --heads origin update-nuget)" != "" ]; then
echo "::warning ::Branch update-nuget exist. Merge PR or delete the branch"
exit 1
fi
- name: Setup Dependencies
run: |
sudo apt update -y
sudo apt install flatpak -y
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo su $(whoami) -c 'flatpak install flathub org.flatpak.Builder -y'
mkdir -p ~/.local/bin
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O ~/.local/bin/yq
chmod +x ~/.local/bin/yq
- name: Flatpak Cache
uses: actions/cache@v4
with:
path: |
~/.local/share/flatpak
key: flatpak-cache-x86_64-${{ github.sha }}
restore-keys: |
flatpak
- name: Set ENV Variables
run: |
echo "RUNTIME-VERSIONFROMYAML=$(yq '.runtime-version' main/org.jellyfin.JellyfinServer.yml)" >> "$GITHUB_ENV"
echo "DOTNETSDKFROMYAML=$(yq '.sdk-extensions[0]' main/org.jellyfin.JellyfinServer.yml)" >> "$GITHUB_ENV"
echo "TAGFROMYAML=$(yq '.modules[-1].sources[2].tag' main/org.jellyfin.JellyfinServer.yml)" >> "$GITHUB_ENV"
- name: Setup Dependencies
run: |
sudo apt update -y
sudo apt install flatpak -y
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo su $(whoami) -c 'flatpak install flathub org.flatpak.Builder -y'
mkdir -p ~/.local/bin
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O ~/.local/bin/yq
chmod +x ~/.local/bin/yq
- name: Checkout Jellyfin
uses: actions/checkout@v3
with:
repository: jellyfin/jellyfin
path: jellyfin
ref: ${{ env.TAGFROMYAML }}
- name: Set ENV Variables
run: |
echo "RUNTIME-VERSIONFROMYAML=$(yq '.runtime-version' main/org.jellyfin.JellyfinServer.yml)" >> "$GITHUB_ENV"
echo "DOTNETSDKFROMYAML=$(yq '.sdk-extensions[0]' main/org.jellyfin.JellyfinServer.yml)" >> "$GITHUB_ENV"
echo "TAGFROMYAML=$(yq '.modules[-1].sources[2].tag' main/org.jellyfin.JellyfinServer.yml)" >> "$GITHUB_ENV"
- name: Checkout Flatpak Builder Tools
uses: actions/checkout@v3
with:
repository: flatpak/flatpak-builder-tools
path: flatpak-builder-tools
- name: Checkout Jellyfin
uses: actions/checkout@v4
with:
repository: jellyfin/jellyfin
path: jellyfin
ref: ${{ env.TAGFROMYAML }}

- name: Generate cache for NuGet
run: |
sudo su $(whoami) -c 'flatpak update -y'
sudo su $(whoami) -c 'flatpak install flathub org.freedesktop.Sdk//${{ env.RUNTIME-VERSIONFROMYAML }} -y'
sudo su $(whoami) -c 'flatpak install flathub ${{ env.DOTNETSDKFROMYAML }}//${{ env.RUNTIME-VERSIONFROMYAML }} -y'
./flatpak-builder-tools/dotnet/flatpak-dotnet-generator.py \
--runtime=linux-x64 main/nuget-generated-sources-x64.json jellyfin/Jellyfin.Server/Jellyfin.Server.csproj
./flatpak-builder-tools/dotnet/flatpak-dotnet-generator.py \
--runtime=linux-arm64 main/nuget-generated-sources-arm64.json jellyfin/Jellyfin.Server/Jellyfin.Server.csproj
- name: Checkout Flatpak Builder Tools
uses: actions/checkout@v4
with:
repository: flatpak/flatpak-builder-tools
path: flatpak-builder-tools

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
path: main
title: Update NuGet Cache
commit-message: Update NuGet Cache
branch: update-nuget
delete-branch: true
- name: Generate cache for NuGet
run: |
sudo su $(whoami) -c 'flatpak update -y'
sudo su $(whoami) -c 'flatpak install flathub org.freedesktop.Sdk//${{ env.RUNTIME-VERSIONFROMYAML }} -y'
sudo su $(whoami) -c 'flatpak install flathub ${{ env.DOTNETSDKFROMYAML }}//${{ env.RUNTIME-VERSIONFROMYAML }} -y'
./flatpak-builder-tools/dotnet/flatpak-dotnet-generator.py \
--runtime=linux-x64 main/nuget-generated-sources-x64.json jellyfin/Jellyfin.Server/Jellyfin.Server.csproj
./flatpak-builder-tools/dotnet/flatpak-dotnet-generator.py \
--runtime=linux-arm64 main/nuget-generated-sources-arm64.json jellyfin/Jellyfin.Server/Jellyfin.Server.csproj
- name: Create Pull Request
uses: peter-evans/create-pull-request@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v7.0.1
with:
path: main
title: Update NuGet Cache
commit-message: Update NuGet Cache
branch: update-nuget
delete-branch: true
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.flatpak
.flatpak-builder/
flatpak-builder-tools/
jellyfin-web/
jellyfin/
repo/
113 changes: 113 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
MANIFEST=org.jellyfin.JellyfinServer.yml
APPMETA=org.jellyfin.JellyfinServer.metainfo.xml
#TAG_JELLYFIN := $(shell curl -s https://api.github.com/repos/jellyfin/jellyfin/tags | jq -r .[0].name)
#TAG_JELLYFIN_WEB := $(shell curl -s https://api.github.com/repos/jellyfin/jellyfin-web/tags | jq -r .[0].name)
TAG_JELLYFIN=v10.9.11
TAG_JELLYFIN_WEB=v10.9.11
#VERSION := $(shell cat VERSION)
VERSION=v10.9.11
DOT_NET_VER=8
LLVM_VER=18
NODE_VER=20
RUNTIME_VER=23.08
BUILD_DATE := $(shell date -I)
GH_ACCOUNT := $(gh auth status --active | grep "Logged in to github.com account" | cut -d " " -f 9)

.PHONY: all clean reset prepare pkg run bundle lint setup-sdk check-meta release

all: setup-sdk prepare npm-generated-sources.json nuget-generated-sources-x64.json nuget-generated-sources-arm64.json pkg bundle

clean:
rm -rf build-dir_x86_64 build-dir_aarch64 .flatpak-builder repo

reset: clean
rm -rf jellyfin/ jellyfin-web/
rm -rf flatpak-builder-tools/
rm -f npm-generated-sources.json nuget-generated-sources-x64.json nuget-generated-sources-arm64.json checksums.txt

setup-sdk:
flatpak --user install -y flathub org.flatpak.Builder
flatpak --user install -y org.freedesktop.Platform/x86_64/$(RUNTIME_VER)
flatpak --user install -y org.freedesktop.Sdk/x86_64/$(RUNTIME_VER)
flatpak --user install -y org.freedesktop.Sdk.Extension.dotnet$(DOT_NET_VER)/x86_64/$(RUNTIME_VER)
flatpak --user install -y org.freedesktop.Sdk.Extension.llvm$(LLVM_VER)/x86_64/$(RUNTIME_VER)
flatpak --user install -y org.freedesktop.Sdk.Extension.node$(NODE_VER)/x86_64/$(RUNTIME_VER)
flatpak --user install -y org.freedesktop.Platform/aarch64/$(RUNTIME_VER)
flatpak --user install -y org.freedesktop.Sdk/aarch64/$(RUNTIME_VER)
flatpak --user install -y org.freedesktop.Sdk.Extension.dotnet$(DOT_NET_VER)/aarch64/$(RUNTIME_VER)
flatpak --user install -y org.freedesktop.Sdk.Extension.llvm$(LLVM_VER)/aarch64/$(RUNTIME_VER)
flatpak --user install -y org.freedesktop.Sdk.Extension.node$(NODE_VER)/aarch64/$(RUNTIME_VER)
git -c advice.detachedHead=false clone --depth 1 https://github.com/flatpak/flatpak-builder-tools.git
cd "flatpak-builder-tools/node/"
pipx install .
cd -

prepare:
$(info Jellyfin: $(TAG_JELLYFIN), Jellyfin Web: $(TAG_JELLYFIN_WEB))
# ifeq ($(TAG_JELLYFIN),$(TAG_JELLYFIN_WEB))
# $(info This is version $(TAG_JELLYFIN))
git -c advice.detachedHead=false clone --depth 1 -b "$(TAG_JELLYFIN)" https://github.com/jellyfin/jellyfin.git
git -c advice.detachedHead=false clone --depth 1 -b "$(TAG_JELLYFIN_WEB)" https://github.com/jellyfin/jellyfin-web.git

echo "$(TAG_JELLYFIN)" > VERSION
# else
# $(info Warning version numbers don't match $(TAG_JELLYFIN) vs. $(TAG_JELLYFIN_WEB))
# endif

pkg: $(MANIFEST)
flatpak --user run org.flatpak.Builder \
--user \
--arch x86_64 \
--repo "repo" \
--force-clean \
"build-dir_x86_64" \
"$(MANIFEST)"
flatpak --user run org.flatpak.Builder \
--user \
--arch aarch64 \
--repo "repo" \
--force-clean \
"build-dir_aarch64" \
"$(MANIFEST)"

bundle:
flatpak build-bundle \
"repo" \
--arch x86_64 \
"JellyfinServer-$(VERSION)-TESTING-$(BUILD_DATE)-amd64.flatpak" \
"org.jellyfin.JellyfinServer"
flatpak build-bundle \
"repo" \
--arch aarch64 \
"JellyfinServer-$(VERSION)-TESTING-$(BUILD_DATE)-arm64.flatpak" \
"org.jellyfin.JellyfinServer"
sha512sum JellyfinServer-$(VERSION)-TESTING-$(BUILD_DATE)-*.flatpak > checksums.txt

release:
gh release create $(VERSION) \
--repo $(GH_ACCOUNT)/org.jellyfin.JellyfinServer \
--title "$(VERSION) $(BUILD_DATE)" \
--notes "Update Jellyfin to $(VERSION). These are not CI/CD releases! The assets have been built on my workstation." \
--prerelease=false \
JellyfinServer-$(VERSION)-TESTING-$(BUILD_DATE)-*.flatpak checksums.txt
# --draft \
lint:
flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest $(MANIFEST)
flatpak run --command=flatpak-builder-lint org.flatpak.Builder repo repo

check-meta:
flatpak run --command=appstream-util org.flatpak.Builder validate $(APPMETA)

npm-generated-sources.json:
flatpak-node-generator -o "npm-generated-sources.json" npm "jellyfin-web/package-lock.json"

nuget-generated-sources-x64.json:
./flatpak-builder-tools/dotnet/flatpak-dotnet-generator.py \
--dotnet $(DOT_NET_VER) --freedesktop $(RUNTIME_VER) --runtime=linux-x64 \
"nuget-generated-sources-x64.json" "jellyfin/Jellyfin.Server/Jellyfin.Server.csproj"

nuget-generated-sources-arm64.json:
./flatpak-builder-tools/dotnet/flatpak-dotnet-generator.py \
--dotnet $(DOT_NET_VER) --freedesktop $(RUNTIME_VER) --runtime=linux-arm64 \
"nuget-generated-sources-arm64.json" "jellyfin/Jellyfin.Server/Jellyfin.Server.csproj"
Loading

0 comments on commit 3b1332b

Please sign in to comment.