diff --git a/.github/workflows/_meta.yaml b/.github/workflows/_meta.yaml index ef0301af375..f03a3435455 100644 --- a/.github/workflows/_meta.yaml +++ b/.github/workflows/_meta.yaml @@ -73,10 +73,13 @@ jobs: const tag = context.ref.substring(10) const no_v = tag.replace('v', '') const dash_index = no_v.lastIndexOf('-') + const major_index = no_v.firstIndexOf('.') const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v + const major = (major_index > -1) ? no_v.substring(0, major_index) : no_v core.setOutput('tag', tag) core.setOutput('no-v', no_v) core.setOutput('no-dash', no_dash) + core.setOutput('major', major) - name: Download Artifacts uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 @@ -84,14 +87,6 @@ jobs: name: ${{ inputs.distro }}-${{ matrix.release }}-${{ matrix.arch }} path: artifact - - name: Prepare Release Assets - run: |- - pushd artifact - find * -type f -name "*.deb" | while read file; do - sha256sum "${file}" | tee "${file}.sha256sum" - done - popd - - name: Upload GH Release Assets uses: shogo82148/actions-upload-release-asset@5bd52f05dd8076794da5975d4c0a4f3bce7dd8f5 # v1.7.4 with: @@ -100,24 +95,27 @@ jobs: asset_path: | ./artifact/**/*.zip ./artifact/**/*.deb - ./artifact/**/*.sha256sum - - name: Make Sure Release Directory Exists - uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3 + - name: Upload release archive to repo.jellyfin.org + uses: appleboy/scp-action@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7 with: - host: ${{ secrets.deploy-host }} - username: ${{ secrets.deploy-user }} - key: ${{ secrets.deploy-key }} - script_stop: true - script: |- - mkdir -p /srv/repository/releases/server/${{ inputs.distro }}/versions/jellyfin-ffmpeg/${{ steps.set_version.outputs.no-v }}/ + host: ${{ secrets.REPO_HOST }} + username: ${{ secrets.REPO_USER }} + key: ${{ secrets.REPO_KEY }} + source: artifact/* + strip_components: 1 + target: /srv/incoming/ffmpeg/${{ steps.set_version.outputs.no-v }}/${{ inputs.distro }}/${{ matrix.arch }} - - name: Upload Release Assets - uses: burnett01/rsync-deployments@93f02b856fbeaf9a8fbfdd8ce1a4adfd0843f849 # 7.0.0 + - name: Move incoming release into repository + uses: appleboy/ssh-action@8f949198563a347a01c65ffc60399aef2b59d4ab # v1.0.1 with: - switches: -vrptz - path: ./artifact/* - remote_path: /srv/repository/releases/server/${{ inputs.distro }}/versions/jellyfin-ffmpeg/${{ steps.set_version.outputs.no-v }}/ - remote_host: ${{ secrets.deploy-host }} - remote_user: ${{ secrets.deploy-user }} - remote_key: ${{ secrets.deploy-key }} + host: ${{ secrets.REPO_HOST }} + username: ${{ secrets.REPO_USER }} + key: ${{ secrets.REPO_KEY }} + envs: JELLYFIN_VERSION + script_stop: true + script: | + if [ -d "/srv/repository/main/ffmpeg/${{ inputs.distro }}/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }}" ] && [ -n "${{ steps.set_version.outputs.major }}" ] && [ -n "${{ steps.set_version.outputs.no-v }}" ]; then + sudo rm -r /srv/repository/main/ffmpeg/${{ inputs.distro }}/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }} + fi + sudo mv -t /srv/repository/main/ffmpeg/${{ inputs.distro }}/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }} /srv/incoming/ffmpeg/${{ steps.set_version.outputs.no-v }}/${{ inputs.distro }}/${{ matrix.arch }} diff --git a/.github/workflows/_meta_mac_portable.yaml b/.github/workflows/_meta_mac_portable.yaml index f2a6fd14052..7f6aa0d3f5c 100644 --- a/.github/workflows/_meta_mac_portable.yaml +++ b/.github/workflows/_meta_mac_portable.yaml @@ -67,10 +67,13 @@ jobs: const tag = context.ref.substring(10) const no_v = tag.replace('v', '') const dash_index = no_v.lastIndexOf('-') + const major_index = no_v.firstIndexOf('.') const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v + const major = (major_index > -1) ? no_v.substring(0, major_index) : no_v core.setOutput('tag', tag) core.setOutput('no-v', no_v) core.setOutput('no-dash', no_dash) + core.setOutput('major', major) - name: Download Artifacts uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 @@ -85,24 +88,27 @@ jobs: overwrite: true asset_path: | ./artifact/**/*.tar.xz - ./artifact/**/*.sha256sum - - name: Make Sure FFmpeg Directory Exists - uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3 + - name: Upload release archive to repo.jellyfin.org + uses: appleboy/scp-action@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7 with: - host: ${{ secrets.deploy-host }} - username: ${{ secrets.deploy-user }} - key: ${{ secrets.deploy-key }} - script_stop: true - script: |- - mkdir -p /srv/repository/releases/ffmpeg/${{ steps.set_version.outputs.no-v }}/ + host: ${{ secrets.REPO_HOST }} + username: ${{ secrets.REPO_USER }} + key: ${{ secrets.REPO_KEY }} + source: artifact/* + strip_components: 1 + target: /srv/incoming/ffmpeg/${{ steps.set_version.outputs.no-v }}/macos/${{ matrix.arch }} - - name: Upload Release Assets - uses: burnett01/rsync-deployments@93f02b856fbeaf9a8fbfdd8ce1a4adfd0843f849 # 7.0.0 + - name: Move incoming release into repository + uses: appleboy/ssh-action@8f949198563a347a01c65ffc60399aef2b59d4ab # v1.0.1 with: - switches: -vrptz - path: ./artifact/* - remote_path: /srv/repository/releases/ffmpeg/${{ steps.set_version.outputs.no-v }}/ - remote_host: ${{ secrets.deploy-host }} - remote_user: ${{ secrets.deploy-user }} - remote_key: ${{ secrets.deploy-key }} + host: ${{ secrets.REPO_HOST }} + username: ${{ secrets.REPO_USER }} + key: ${{ secrets.REPO_KEY }} + envs: JELLYFIN_VERSION + script_stop: true + script: | + if [ -d "/srv/repository/main/ffmpeg/${{ inputs.distro }}/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }}" ] && [ -n "${{ steps.set_version.outputs.major }}" ] && [ -n "${{ steps.set_version.outputs.no-v }}" ]; then + sudo rm -r /srv/repository/main/ffmpeg/macos/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }} + fi + sudo mv -t /srv/repository/main/ffmpeg/macos/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }} /srv/incoming/ffmpeg/${{ steps.set_version.outputs.no-v }}/macos/${{ matrix.arch }} diff --git a/.github/workflows/_meta_portable.yaml b/.github/workflows/_meta_portable.yaml index a16b08d2098..87385a0af6b 100644 --- a/.github/workflows/_meta_portable.yaml +++ b/.github/workflows/_meta_portable.yaml @@ -63,10 +63,13 @@ jobs: const tag = context.ref.substring(10) const no_v = tag.replace('v', '') const dash_index = no_v.lastIndexOf('-') + const major_index = no_v.firstIndexOf('.') const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v + const major = (major_index > -1) ? no_v.substring(0, major_index) : no_v core.setOutput('tag', tag) core.setOutput('no-v', no_v) core.setOutput('no-dash', no_dash) + core.setOutput('major', major) - name: Download Artifacts uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 @@ -74,14 +77,6 @@ jobs: name: ${{ inputs.os }}-${{ matrix.arch }}-portable path: artifact - - name: Prepare Release Assets - run: |- - pushd artifact - find * -type f \( -name "*.xz" -o -name "*.zip" \) | while read file; do - sha256sum "${file}" | tee "${file}.sha256sum" - done - popd - - name: Upload GH Release Assets uses: shogo82148/actions-upload-release-asset@5bd52f05dd8076794da5975d4c0a4f3bce7dd8f5 # v1.7.4 with: @@ -90,24 +85,27 @@ jobs: asset_path: | ./artifact/**/*.zip ./artifact/**/*.tar.xz - ./artifact/**/*.sha256sum - - name: Make Sure FFmpeg Directory Exists - uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3 + - name: Upload release archive to repo.jellyfin.org + uses: appleboy/scp-action@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7 with: - host: ${{ secrets.deploy-host }} - username: ${{ secrets.deploy-user }} - key: ${{ secrets.deploy-key }} - script_stop: true - script: |- - mkdir -p /srv/repository/releases/ffmpeg/${{ steps.set_version.outputs.no-v }}/ + host: ${{ secrets.REPO_HOST }} + username: ${{ secrets.REPO_USER }} + key: ${{ secrets.REPO_KEY }} + source: artifact/* + strip_components: 1 + target: /srv/incoming/ffmpeg/${{ steps.set_version.outputs.no-v }}/${{ inputs.os }}/${{ matrix.arch }} - - name: Upload Release Assets - uses: burnett01/rsync-deployments@93f02b856fbeaf9a8fbfdd8ce1a4adfd0843f849 # 7.0.0 + - name: Move incoming release into repository + uses: appleboy/ssh-action@8f949198563a347a01c65ffc60399aef2b59d4ab # v1.0.1 with: - switches: -vrptz - path: ./artifact/* - remote_path: /srv/repository/releases/ffmpeg/${{ steps.set_version.outputs.no-v }}/ - remote_host: ${{ secrets.deploy-host }} - remote_user: ${{ secrets.deploy-user }} - remote_key: ${{ secrets.deploy-key }} + host: ${{ secrets.REPO_HOST }} + username: ${{ secrets.REPO_USER }} + key: ${{ secrets.REPO_KEY }} + envs: JELLYFIN_VERSION + script_stop: true + script: | + if [ -d "/srv/repository/main/ffmpeg/${{ inputs.os }}/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }}" ] && [ -n "${{ steps.set_version.outputs.major }}" ] && [ -n "${{ steps.set_version.outputs.no-v }}" ]; then + sudo rm -r /srv/repository/main/ffmpeg/${{ inputs.os }}/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }} + fi + sudo mv -t /srv/repository/main/ffmpeg/${{ inputs.os }}/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }} /srv/incoming/ffmpeg/${{ steps.set_version.outputs.no-v }}/${{ inputs.os }}/${{ matrix.arch }} diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 22c33f720fe..b9c7c520ce3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,7 +30,7 @@ jobs: uses: ./.github/workflows/_meta.yaml with: distro: 'ubuntu' - codenames: '["focal", "jammy", "lunar", "mantic"]' + codenames: '["focal", "jammy"]' architectures: '["amd64", "arm64", "armhf"]' release: false diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 06dd8521391..c07503791b8 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,21 +14,21 @@ jobs: architectures: '["amd64", "arm64", "armhf"]' release: true secrets: - deploy-host: ${{ secrets.DEPLOY_HOST }} - deploy-user: ${{ secrets.DEPLOY_USER }} - deploy-key: ${{ secrets.DEPLOY_KEY }} + deploy-host: ${{ secrets.REPO_HOST }} + deploy-user: ${{ secrets.REPO_USER }} + deploy-key: ${{ secrets.REPO_KEY }} build_publish_ubuntu: uses: ./.github/workflows/_meta.yaml with: distro: 'ubuntu' - codenames: '["focal", "jammy", "lunar", "mantic"]' + codenames: '["focal", "jammy"]' architectures: '["amd64", "arm64", "armhf"]' release: true secrets: - deploy-host: ${{ secrets.DEPLOY_HOST }} - deploy-user: ${{ secrets.DEPLOY_USER }} - deploy-key: ${{ secrets.DEPLOY_KEY }} + deploy-host: ${{ secrets.REPO_HOST }} + deploy-user: ${{ secrets.REPO_USER }} + deploy-key: ${{ secrets.REPO_KEY }} build_publish_windows_portable: uses: ./.github/workflows/_meta_portable.yaml @@ -37,9 +37,9 @@ jobs: architectures: '["win64"]' release: true secrets: - deploy-host: ${{ secrets.DEPLOY_HOST }} - deploy-user: ${{ secrets.DEPLOY_USER }} - deploy-key: ${{ secrets.DEPLOY_KEY }} + deploy-host: ${{ secrets.REPO_HOST }} + deploy-user: ${{ secrets.REPO_USER }} + deploy-key: ${{ secrets.REPO_KEY }} build_publish_linux_portable: uses: ./.github/workflows/_meta_portable.yaml @@ -48,18 +48,18 @@ jobs: architectures: '["amd64", "arm64"]' release: true secrets: - deploy-host: ${{ secrets.DEPLOY_HOST }} - deploy-user: ${{ secrets.DEPLOY_USER }} - deploy-key: ${{ secrets.DEPLOY_KEY }} + deploy-host: ${{ secrets.REPO_HOST }} + deploy-user: ${{ secrets.REPO_USER }} + deploy-key: ${{ secrets.REPO_KEY }} build_publish_mac_portable: uses: ./.github/workflows/_meta_mac_portable.yaml with: release: true secrets: - deploy-host: ${{ secrets.DEPLOY_HOST }} - deploy-user: ${{ secrets.DEPLOY_USER }} - deploy-key: ${{ secrets.DEPLOY_KEY }} + deploy-host: ${{ secrets.REPO_HOST }} + deploy-user: ${{ secrets.REPO_USER }} + deploy-key: ${{ secrets.REPO_KEY }} maintain_repository: name: Maintain Repository @@ -76,30 +76,31 @@ jobs: {distro: 'debian', codename: 'bullseye'}, {distro: 'debian', codename: 'bookworm'}, {distro: 'ubuntu', codename: 'focal'}, - {distro: 'ubuntu', codename: 'jammy'}, - {distro: 'ubuntu', codename: 'lunar'}, - {distro: 'ubuntu', codename: 'mantic'} + {distro: 'ubuntu', codename: 'jammy'} ] steps: - name: Sync mirrors and update symlinks uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3 with: - host: ${{ secrets.DEPLOY_HOST }} - username: ${{ secrets.DEPLOY_USER }} - key: ${{ secrets.DEPLOY_KEY }} + host: ${{ secrets.REPO_HOST }} + username: ${{ secrets.REPO_USER }} + key: ${{ secrets.REPO_KEY }} script_stop: true script: |- set -o errexit set -o xtrace tag="${{ github.event.release.tag_name }}" version="${tag#v}" + major_version="${version%%.*} basename="jellyfin-ffmpeg*_${version}-${{ matrix.arrays.codename }}" - find /srv/repository/releases/server/${{ matrix.arrays.distro }}/ -type l -name "jellyfin-ffmpeg*_*" -exec rm {} \; - find /srv/repository/releases/server/${{ matrix.arrays.distro }}/versions/jellyfin-ffmpeg/${version} -type f -name "${basename}_*.deb" | while read file; do - reprepro -b /srv/repository/${{ matrix.arrays.distro }} --export=never --keepunreferencedfiles includedeb ${{ matrix.arrays.codename }} ${file} + basedir="/srv/repository/main/ffmpeg/${{ matrix.arrays.distro }}/${major_version}.x/${version}" + find ${basedir} -type f -name "${basename}_*.deb" | while read file; do + sudo reprepro -b /srv/${{ matrix.arrays.distro }} --export=never --keepunreferencedfiles includedeb ${{ matrix.arrays.codename }} ${file} done - reprepro -b /srv/repository/${{ matrix.arrays.distro }} deleteunreferenced - reprepro -b /srv/repository/${{ matrix.arrays.distro }} export + sudo reprepro -b /srv/${{ matrix.arrays.distro }} deleteunreferenced + sudo reprepro -b /srv/${{ matrix.arrays.distro }} export + sudo rm -f /srv/repository/main/ffmpeg/${{ matrix.arrays.distro }}/latest-${major_version}.x + sudo ln -s ${basedir} /srv/repository/main/ffmpeg/${{ matrix.arrays.distro }}/latest-${major_version}.x maintain_repository_portable: name: Maintain Repository (Portable) @@ -117,17 +118,16 @@ jobs: - name: Update symlinks uses: appleboy/ssh-action@029f5b4aeeeb58fdfe1410a5d17f967dacf36262 # v1.0.3 with: - host: ${{ secrets.DEPLOY_HOST }} - username: ${{ secrets.DEPLOY_USER }} - key: ${{ secrets.DEPLOY_KEY }} + host: ${{ secrets.REPO_HOST }} + username: ${{ secrets.REPO_USER }} + key: ${{ secrets.REPO_KEY }} script_stop: true script: |- set -o errexit set -o xtrace tag="${{ github.event.release.tag_name }}" version="${tag#v}" - if [ "${{ matrix.arrays.distro }}" == "windows" ]; then - mkdir -p /srv/repository/releases/server/${{ matrix.arrays.distro }}/versions/jellyfin-ffmpeg/${version} - ln -fs /srv/repository/releases/ffmpeg/${version}/*.zip /srv/repository/releases/server/${{ matrix.arrays.distro }}/versions/jellyfin-ffmpeg/${version}/ - ln -fs /srv/repository/releases/ffmpeg/${version}/*.zip.sha265sum /srv/repository/releases/server/${{ matrix.arrays.distro }}/versions/jellyfin-ffmpeg/${version}/ - fi + major_version="${version%%.*} + basedir="/srv/repository/main/ffmpeg/${{ matrix.arrays.distro }}/${major_version}.x/${version}" + sudo rm -f /srv/repository/main/ffmpeg/${{ matrix.arrays.distro }}/latest-${major_version}.x + sudo ln -s ${basedir} /srv/repository/main/ffmpeg/${{ matrix.arrays.distro }}/latest-${major_version}.x