Improve version handling in Windows tasks

This allows running of the Installer steps on unstable.
This commit is contained in:
Joshua M. Boniface
2025-02-16 20:40:17 -05:00
parent aa2ae38ff0
commit 5c9f3240d9

View File

@@ -424,8 +424,20 @@ jobs:
continue-on-error: false # true in prod, false for testing
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
if: startsWith(inputs.jellyfin_version, 'v')
steps:
- name: "Set dated version for unstable builds"
id: version
shell: pwsh
run: |
$version = "${{ inputs.version || 'master' }}"
if ($version -match "^v[0-9]+") {
echo "JELLYFIN_VERSION=$version.Substring(1)" | Out-File -FilePath $env:GITHUB_ENV -Append
} else {
$dateVersion = Get-Date -Format "yyyyMMddHH"
echo "JELLYFIN_VERSION=$dateVersion" | Out-File -FilePath $env:GITHUB_ENV -Append
}
- name: "Fetch artifact from previous stage"
uses: actions/download-artifact@v4
working-directory: ./jellyfin-server-windows
@@ -468,8 +480,7 @@ jobs:
working-directory: ./jellyfin-server-windows
run: |
cd .\nsis
$version = "${{ inputs.jellyfin_version }}".Substring(1)
Rename-Item -Path .\jellyfin_*_windows-x64.exe -NewName ("jellyfin_${version}_windows-x64.exe")
Rename-Item -Path .\jellyfin_*_windows-x64.exe -NewName ("jellyfin_${{ env.JELLYFIN_VERSION }}_windows-x64.exe")
- name: "Store artifact for next stage"
uses: actions/upload-artifact@v4
@@ -488,8 +499,18 @@ jobs:
arch:
- amd64
continue-on-error: false # true in prod, false for testing
if: startsWith(inputs.jellyfin_version, 'v')
steps:
- name: "Set dated version for unstable builds"
id: version
run: |-
if grep --silent --extended-regexp '^v[0-9]+' <<< "${{ inputs.version || 'master' }}"; then
echo "JELLYFIN_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
echo "JELLYFIN_RELEASE_TYPE=stable" >> $GITHUB_ENV
else
echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV
echo "JELLYFIN_RELEASE_TYPE=unstable" >> $GITHUB_ENV
fi
- name: "Fetch artifact from previous stage"
uses: actions/download-artifact@v4
with:
@@ -503,7 +524,7 @@ jobs:
key: "${{ secrets.REPO_KEY }}"
source: "jellyfin_*_windows-x64.exe"
strip_components: 1
target: "/srv/incoming/server/${{ inputs.jellyfin_version }}/windows/${{ matrix.arch }}"
target: "/srv/incoming/server/${{ env.JELLYFIN_VERSION }}/windows/${{ matrix.arch }}"
- name: "Move artifacts into repository"
uses: appleboy/ssh-action@7eaf76671a0d7eec5d98ee897acda4f968735a17 # v1.2.0
@@ -515,7 +536,7 @@ jobs:
script_stop: true
script: |
export BASEDIR="/srv/repository/main/server/windows"
sudo mv -t ${BASEDIR}/stable/${{ inputs.jellyfin_version }}/${{ matrix.arch }}/ /srv/incoming/server/${{ inputs.jellyfin_version }}/windows/${{ matrix.arch }}/jellyfin_*_windows-x64.exe || exit 1
sudo mv -t ${BASEDIR}/${{ env.JELLYFIN_RELEASE_TYPE }}/${{ env.JELLYFIN_VERSION }}/${{ matrix.arch }}/ /srv/incoming/server/${{ env.JELLYFIN_VERSION }}/windows/${{ matrix.arch }}/jellyfin_*.exe || exit 1
MacOS:
runs-on: ubuntu-24.04