Skip to content

Commit

Permalink
Merge pull request #59 from jellyfin/gha
Browse files Browse the repository at this point in the history
Phase 1: Automate building the installer from manual trigger
  • Loading branch information
anthonylavado authored Apr 9, 2022
2 parents c8b3c97 + 7da6700 commit 8a8e817
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 99 deletions.
99 changes: 0 additions & 99 deletions .ci/azure-pipelines.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/_meta-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
on:
workflow_call:
inputs:
jellyfin_version:
required: true
type: string
server_url:
required: true
type: string

jobs:
publish:
runs-on: windows-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Clone UX Repository
uses: actions/checkout@v3
with:
repository: jellyfin/jellyfin-ux
path: .\jellyfin-ux

- name: Setup Jellyfin server
run: |
Invoke-WebRequest '${{ inputs.server_url }}' -OutFile 'jellyfin.zip'
Expand-Archive 'jellyfin.zip'
Copy-Item ".\Support Files\LICENSE" -Destination $(Resolve-Path .\jellyfin\jellyfin_*)
- name: Publish Tray
run: dotnet publish -c Release -r win-x64 --no-self-contained --output $(Resolve-Path .\jellyfin\jellyfin_*)

- name: Build installer
run: |
$env:InstallLocation = $(Resolve-Path .\jellyfin\jellyfin_*)
makensis /Dx64 /DUXPATH=$(Resolve-Path .\jellyfin-ux) $(Join-Path -Path $(Resolve-Path .\nsis) -ChildPath jellyfin.nsi)
- name: Rename Installer
run: |
cd .\nsis
Rename-Item -Path .\jellyfin_*_windows-x64.exe -NewName ("jellyfin_${{ inputs.jellyfin_version }}_windows-x64.exe")
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: windows-x64
retention-days: 30
if-no-files-found: error
path: .\nsis\jellyfin_*_windows-x64.exe

- name: Upload to GitHub Release
if: ${{ github.event_name == 'release' }}
uses: shogo82148/[email protected]
with:
upload_url: ${{ github.event.release.upload_url }}
overwrite: true
asset_path: .\nsis\jellyfin_*_windows-x64.exe
15 changes: 15 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Build'

on:
push:
pull_request:

jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Build
run: dotnet build -c Release
19 changes: 19 additions & 0 deletions .github/workflows/publish-stable-pre.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Publish Stable-Pre'

on:
release:
types:
- "prereleased"
workflow_dispatch:
inputs:
jellyfin_version:
required: true
type: string
description: "The Jellyfin version (eg: 10.8.0-beta1, 10.8.0-beta2)"

jobs:
publish:
uses: ./.github/workflows/_meta-publish.yaml
with:
jellyfin_version: ${{ github.event.release.tag_name || github.event.inputs.jellyfin_version }}
server_url: ${{ format('https://repo.jellyfin.org/releases/server/windows/stable-pre/{0}/combined/jellyfin_{0}.zip', (github.event.release.tag_name || github.event.inputs.jellyfin_version)) }}
19 changes: 19 additions & 0 deletions .github/workflows/publish-stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Publish Stable'

on:
release:
types:
- "released"
workflow_dispatch:
inputs:
jellyfin_version:
required: true
type: string
description: "The Jellyfin version (eg: 10.8.0, 10.7.7)"

jobs:
publish:
uses: ./.github/workflows/_meta-publish.yaml
with:
jellyfin_version: ${{ github.event.release.tag_name || github.event.inputs.jellyfin_version }}
server_url: ${{ format('https://repo.jellyfin.org/releases/server/windows/stable/combined/jellyfin_{0}.zip', (github.event.release.tag_name || github.event.inputs.jellyfin_version)) }}
16 changes: 16 additions & 0 deletions .github/workflows/publish-unstable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Publish Unstable'

on:
workflow_dispatch:
inputs:
jellyfin_version:
required: true
type: string
description: "The Jellyfin version (eg: 20220405.10)"

jobs:
publish:
uses: ./.github/workflows/_meta-publish.yaml
with:
jellyfin_version: ${{ github.event.inputs.jellyfin_version }}
server_url: ${{ format('https://repo.jellyfin.org/releases/server/windows/versions/unstable/combined/{0}/jellyfin_{0}-unstable.zip', github.event.inputs.jellyfin_version) }}

0 comments on commit 8a8e817

Please sign in to comment.