Skip to content

Commit f1cef30

Browse files
temp: add Windows-only preview build
1 parent 0cb9ba5 commit f1cef30

File tree

1 file changed

+225
-0
lines changed

1 file changed

+225
-0
lines changed
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
name: "Preview Build Windows-Only"
2+
3+
on:
4+
workflow_dispatch:
5+
# Manual trigger (from bot)
6+
inputs:
7+
version:
8+
required: true
9+
type: string
10+
description: 'The server and web stable release tag (i.e. "vX.Y.Z")'
11+
preview_id:
12+
required: true
13+
type: string
14+
description: 'The numerical preview ID (e.g. 1 for `rc1`)'
15+
16+
env:
17+
SDK_VERSION: "9.0.x"
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
Windows:
24+
runs-on: ubuntu-24.04
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
arch:
29+
- amd64
30+
- arm64
31+
outputs:
32+
JELLYFIN_VERSION: ${{ steps.version.outputs.JELLYFIN_VERSION }}
33+
JELLYFIN_RELEASE_TYPE: ${{ steps.version.outputs.JELLYFIN_RELEASE_TYPE }}
34+
continue-on-error: false # true in prod, false for testing
35+
steps:
36+
- name: "Set dated version for unstable builds"
37+
id: version
38+
run: |-
39+
echo "JELLYFIN_VERSION=${{ inputs.version }}-rc${{ inputs.preview_id }}" >> $GITHUB_ENV
40+
echo "JELLYFIN_VERSION=${{ inputs.version }}-rc${{ inputs.preview_id }}" >> $GITHUB_OUTPUT
41+
echo "JELLYFIN_RELEASE_TYPE=preview" >> $GITHUB_ENV
42+
echo "JELLYFIN_RELEASE_TYPE=preview" >> $GITHUB_OUTPUT
43+
echo "DEBUG_FLAG=--debug" >>$GITHUB_ENV
44+
echo "DEBUG_FLAG=--debug" >>$GITHUB_OUTPUT
45+
46+
- name: "Install dependencies"
47+
run: |-
48+
sudo apt-get update
49+
sudo apt-get install --yes python3-git python3-yaml
50+
51+
- name: "Checkout repository"
52+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
53+
54+
- name: "Prepare repository"
55+
run: |-
56+
./checkout.py ${{ inputs.version }}-rc${{ inputs.preview_id }}
57+
58+
- name: "Run builder for ${{ matrix.arch }}"
59+
run: |-
60+
sudo --preserve-env ./build.py ${{ env.JELLYFIN_VERSION }} windows ${{ matrix.arch }} ${{ env.DEBUG_FLAG }}
61+
62+
- name: "Upload artifacts to repository server"
63+
uses: appleboy/scp-action@ff85246acaad7bdce478db94a363cd2bf7c90345 # v1.0.0
64+
with:
65+
host: "${{ secrets.REPO_HOST }}"
66+
username: "${{ secrets.REPO_USER }}"
67+
key: "${{ secrets.REPO_KEY }}"
68+
source: "out/windows/*"
69+
strip_components: 2
70+
target: "/srv/incoming/server/${{ env.JELLYFIN_VERSION }}/windows/${{ matrix.arch }}"
71+
72+
- name: "Move artifacts into repository"
73+
uses: appleboy/ssh-action@2ead5e36573f08b82fbfce1504f1a4b05a647c6f # v1.2.2
74+
with:
75+
host: "${{ secrets.REPO_HOST }}"
76+
username: "${{ secrets.REPO_USER }}"
77+
key: "${{ secrets.REPO_KEY }}"
78+
debug: false
79+
script: |
80+
set -e
81+
export BASEDIR="/srv/repository/main/server/windows"
82+
sudo mkdir -p ${BASEDIR}/${{ env.JELLYFIN_RELEASE_TYPE }}/${{ env.JELLYFIN_VERSION }}/${{ matrix.arch }} || exit 1
83+
sudo mv -t ${BASEDIR}/${{ env.JELLYFIN_RELEASE_TYPE }}/${{ env.JELLYFIN_VERSION }}/${{ matrix.arch }}/ /srv/incoming/server/${{ env.JELLYFIN_VERSION }}/windows/${{ matrix.release }}/${{ matrix.arch }}/* || exit 1
84+
sudo rm ${BASEDIR}/latest-${{ env.JELLYFIN_RELEASE_TYPE }} || true
85+
sudo ln -sf ${BASEDIR}/${{ env.JELLYFIN_RELEASE_TYPE }}/${{ env.JELLYFIN_VERSION }} ${BASEDIR}/latest-${{ env.JELLYFIN_RELEASE_TYPE }} || exit 1
86+
87+
- name: "Store artifacts for next stage"
88+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
89+
with:
90+
name: windows-artifacts
91+
retention-days: 1
92+
if-no-files-found: ignore # Ignore for arm64 build, as no file will be found
93+
path: out/windows/jellyfin_*-amd64.zip
94+
95+
WindowsInstaller:
96+
needs:
97+
- Windows
98+
runs-on: windows-latest
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
arch:
103+
- amd64
104+
continue-on-error: false # true in prod, false for testing
105+
env:
106+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
107+
steps:
108+
- name: "Set dated version for unstable builds"
109+
id: version
110+
shell: pwsh
111+
run: |
112+
$version = "${{ needs.Windows.outputs.JELLYFIN_VERSION }}"
113+
$cleanVersion = $version.Substring(1)
114+
echo "JELLYFIN_VERSION=$cleanVersion" | Out-File -FilePath $env:GITHUB_ENV -Append
115+
116+
- name: "Checkout repository"
117+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
118+
119+
- name: "Install dependencies"
120+
run: |-
121+
python -m pip install --upgrade gitpython
122+
123+
- name: "Install NSIS"
124+
uses: negrutiu/nsis-install@f3339c88dba6fd08910d5275a943f8f746d94876 # v2
125+
with:
126+
distro: official
127+
128+
- name: "Prepare repository"
129+
run: |-
130+
python ./checkout.py ${{ inputs.version }}-rc${{ inputs.preview_id }}
131+
132+
- name: "Fetch artifacts from previous stage"
133+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
134+
with:
135+
name: windows-artifacts
136+
path: ./jellyfin-server-windows
137+
138+
- name: "Clone UX repository"
139+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
140+
with:
141+
repository: jellyfin/jellyfin-ux
142+
path: .\jellyfin-server-windows\jellyfin-ux
143+
144+
- name: "Extract Jellyfin server archive"
145+
working-directory: ./jellyfin-server-windows
146+
run: |
147+
New-Item -ItemType Directory -Path jellyfin
148+
Expand-Archive -Path 'jellyfin_*-amd64.zip' -DestinationPath jellyfin -Force
149+
Copy-Item ".\Support Files\LICENSE" -Destination $(Resolve-Path .\jellyfin\jellyfin)
150+
151+
- name: "Add NSSM"
152+
working-directory: ./jellyfin-server-windows
153+
run: |
154+
Invoke-WebRequest 'https://repo.jellyfin.org/files/other/nssm.zip' -OutFile 'nssm.zip'
155+
Expand-Archive 'nssm.zip'
156+
Copy-Item ".\nssm\nssm.exe" -Destination $(Resolve-Path .\jellyfin\jellyfin)
157+
158+
- name: "Publish tray"
159+
working-directory: ./jellyfin-server-windows
160+
run: |
161+
New-Item -Path .\jellyfin\jellyfin\jellyfin-windows-tray -ItemType Directory
162+
dotnet publish -c Release -r win-x64 -f net472 --no-self-contained --output $(Resolve-Path .\jellyfin\jellyfin\jellyfin-windows-tray)
163+
164+
- name: "Build installer"
165+
working-directory: ./jellyfin-server-windows
166+
run: |
167+
$env:InstallLocation = $(Resolve-Path .\jellyfin\jellyfin)
168+
makensis /Dx64 /DUXPATH=$(Resolve-Path .\jellyfin-ux) $(Join-Path -Path $(Resolve-Path .\nsis) -ChildPath jellyfin.nsi)
169+
170+
- name: "Rename installer"
171+
working-directory: ./jellyfin-server-windows/nsis
172+
run: |
173+
Rename-Item -Path .\jellyfin_*_windows-x64.exe -NewName ("jellyfin_${{ env.JELLYFIN_VERSION }}_windows-x64.exe")
174+
175+
- name: "Store artifacts for next stage"
176+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
177+
with:
178+
name: windows-installer-artifacts
179+
retention-days: 1
180+
if-no-files-found: error
181+
path: ./jellyfin-server-windows/nsis/jellyfin_${{ env.JELLYFIN_VERSION }}_windows-x64.exe
182+
183+
WindowsInstallerUpload:
184+
needs:
185+
- Windows
186+
- WindowsInstaller
187+
runs-on: ubuntu-24.04
188+
strategy:
189+
fail-fast: false
190+
matrix:
191+
arch:
192+
- amd64
193+
continue-on-error: false # true in prod, false for testing
194+
steps:
195+
- name: "Set version from previous job"
196+
id: version
197+
run: |-
198+
echo "JELLYFIN_VERSION=${{ needs.Windows.outputs.JELLYFIN_VERSION }}" >> $GITHUB_ENV
199+
echo "JELLYFIN_RELEASE_TYPE=${{ needs.Windows.outputs.JELLYFIN_RELEASE_TYPE }}" >> $GITHUB_ENV
200+
201+
- name: "Fetch artifact from previous stage"
202+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
203+
with:
204+
name: windows-installer-artifacts
205+
206+
- name: "Upload artifacts to repository server"
207+
uses: appleboy/scp-action@ff85246acaad7bdce478db94a363cd2bf7c90345 # v1.0.0
208+
with:
209+
host: "${{ secrets.REPO_HOST }}"
210+
username: "${{ secrets.REPO_USER }}"
211+
key: "${{ secrets.REPO_KEY }}"
212+
source: "*.exe"
213+
target: "/srv/incoming/server/${{ env.JELLYFIN_VERSION }}/windows/${{ matrix.arch }}"
214+
215+
- name: "Move artifacts into repository"
216+
uses: appleboy/ssh-action@2ead5e36573f08b82fbfce1504f1a4b05a647c6f # v1.2.2
217+
with:
218+
host: "${{ secrets.REPO_HOST }}"
219+
username: "${{ secrets.REPO_USER }}"
220+
key: "${{ secrets.REPO_KEY }}"
221+
debug: false
222+
script: |
223+
set -e
224+
export BASEDIR="/srv/repository/main/server/windows"
225+
sudo mv -t ${BASEDIR}/${{ env.JELLYFIN_RELEASE_TYPE }}/${{ env.JELLYFIN_VERSION }}/${{ matrix.arch }}/ /srv/incoming/server/${{ env.JELLYFIN_VERSION }}/windows/${{ matrix.arch }}/*.exe

0 commit comments

Comments
 (0)