name: "Release Build" on: workflow_dispatch: inputs: version: required: true type: string description: 'The server and web release tag ("vX.Y.Z") or "master"' permissions: contents: read jobs: Debian: runs-on: ubuntu-22.04 strategy: matrix: release: - bullseye - bookworm arch: - amd64 - arm64 - armhf steps: - name: "Set dated version for unstable builds" id: version run: |- if [[ ${{ inputs.version }} == "master" ]]; then echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV else echo "JELLYFIN_VERSION=${{ inputs.version }}" >> $GITHUB_ENV fi - name: "Install dependencies" run: |- sudo apt-get install --yes python3-git - name: "Checkout repository" uses: actions/checkout@v3 - name: "Prepare repository" run: |- ./checkout.py ${{ inputs.version }} - name: "Run builder for ${{ matrix.version }} ${{ matrix.arch }}" run: |- sudo ./build.py ${JELLYFIN_VERSION} debian ${{ matrix.arch }} ${{ matrix.release }} - name: "Upload artifacts to repository server" uses: appleboy/scp-action@v0.1.7 with: host: "${{ secrets.REPO_HOST }}" username: "${{ secrets.REPO_USER }}" key: "${{ secrets.REPO_KEY }}" source: "out/debian/*" strip_components: 2 target: "/srv/incoming/${JELLYFIN_VERSION}/debian/${{ matrix.arch }}/${{ matrix.release }}" - name: "Import artifacts into reprepro" uses: appleboy/ssh-action@v1.0.3 with: host: "${{ secrets.REPO_HOST }}" username: "${{ secrets.REPO_USER }}" key: "${{ secrets.REPO_KEY }}" script: | set -o xtrace echo ${JELLYFIN_VERSION} if [[ ${{ inputs.version }} != "master" ]]; then COMPONENT="main" else COMPONENT="unstable" fi # Only include the architecture-dependent deb here, as the others are done only for amd64 flock /run/lock/github-reprepro-debian.lock sudo reprepro --basedir /srv/debian --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/${JELLYFIN_VERSION}/debian/${{ matrix.arch }}/${{ matrix.release }}/*_${{ matrix.arch }}.deb if [[ ${{ matrix.arch }} == "amd64" ]]; then # Only include the architecture-independent packages for amd64; the other architectures are the same and conflict flock /run/lock/github-reprepro-debian.lock sudo reprepro --basedir /srv/debian --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/${JELLYFIN_VERSION}/debian/${{ matrix.arch }}/${{ matrix.release }}/*_all.deb # Only include the source DSC for amd64; the other architectures are the same and conflict flock /run/lock/github-reprepro-debian.lock sudo reprepro --basedir /srv/debian --component ${COMPONENT} includedsc ${{ matrix.release }} /srv/incoming/${JELLYFIN_VERSION}/debian/${{ matrix.arch }}/${{ matrix.release }}/*.dsc fi - name: "Move artifacts into repository" uses: appleboy/ssh-action@v1.0.3 with: host: "${{ secrets.REPO_HOST }}" username: "${{ secrets.REPO_USER }}" key: "${{ secrets.REPO_KEY }}" script: | sudo mkdir -p /srv/repository/mirror/releases/server/debian/versions/${JELLYFIN_VERSION}/${{ matrix.arch }} sudo mv -t /srv/repository/mirror/releases/server/debian/versions/${JELLYFIN_VERSION}/${{ matrix.arch }}/ /srv/incoming/${JELLYFIN_VERSION}/debian/${{ matrix.arch }}/${{ matrix.release }}/* if [[ ${{ inputs.version }} != "master" ]]; then sudo ln -s /srv/repository/mirror/releases/server/debian/versions/${JELLYFIN_VERSION}/${{ matrix.arch }} /srv/repository/mirror/releases/server/debian/latest-server fi Ubuntu: runs-on: ubuntu-22.04 strategy: matrix: release: - focal - jammy # - noble arch: - amd64 - arm64 - armhf steps: - name: "Set dated version for unstable builds" id: version run: |- if [[ ${{ inputs.version }} == "master" ]]; then echo "JELLYFIN_VERSION=$(date +'%Y%m%d%H')" >> $GITHUB_ENV else echo "JELLYFIN_VERSION=${{ inputs.version }}" >> $GITHUB_ENV fi - name: "Install dependencies" run: |- sudo apt-get install --yes python3-git - name: "Checkout repository" uses: actions/checkout@v3 - name: "Prepare repository" run: |- ./checkout.py ${{ inputs.version }} - name: "Run builder for ${{ matrix.version }} ${{ matrix.arch }}" run: |- sudo ./build.py ${JELLYFIN_VERSION} ubuntu ${{ matrix.arch }} ${{ matrix.release }} - name: "Upload artifacts to repository server" uses: appleboy/scp-action@v0.1.7 with: host: "${{ secrets.REPO_HOST }}" username: "${{ secrets.REPO_USER }}" key: "${{ secrets.REPO_KEY }}" source: "out/ubuntu/*" strip_components: 2 target: "/srv/incoming/${JELLYFIN_VERSION}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}" - name: "Import artifacts into reprepro" uses: appleboy/ssh-action@v1.0.3 with: host: "${{ secrets.REPO_HOST }}" username: "${{ secrets.REPO_USER }}" key: "${{ secrets.REPO_KEY }}" script: | set -o xtrace echo ${JELLYFIN_VERSION} if [[ ${{ inputs.version }} != "master" ]]; then COMPONENT="main" else COMPONENT="unstable" fi # Only include the architecture-dependent deb here, as the others are done only for amd64 flock /run/lock/github-reprepro-ubuntu.lock sudo reprepro --basedir /srv/ubuntu --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/${JELLYFIN_VERSION}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*_${{ matrix.arch }}.deb if [[ ${{ matrix.arch }} == "amd64" ]]; then # Only include the architecture-independent packages for amd64; the other architectures are the same and conflict flock /run/lock/github-reprepro-ubuntu.lock sudo reprepro --basedir /srv/ubuntu --component ${COMPONENT} includedeb ${{ matrix.release }} /srv/incoming/${JELLYFIN_VERSION}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*_all.deb # Only include the source DSC for amd64; the other architectures are the same and conflict flock /run/lock/github-reprepro-ubuntu.lock sudo reprepro --basedir /srv/ubuntu --component ${COMPONENT} includedsc ${{ matrix.release }} /srv/incoming/${JELLYFIN_VERSION}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/*.dsc fi - name: "Move artifacts into repository" uses: appleboy/ssh-action@v1.0.3 with: host: "${{ secrets.REPO_HOST }}" username: "${{ secrets.REPO_USER }}" key: "${{ secrets.REPO_KEY }}" script: | sudo mkdir -p /srv/repository/mirror/releases/server/ubuntu/versions/${JELLYFIN_VERSION}/${{ matrix.arch }} sudo mv -t /srv/repository/mirror/releases/server/ubuntu/versions/${JELLYFIN_VERSION}/${{ matrix.arch }} /srv/incoming/${JELLYFIN_VERSION}/ubuntu/${{ matrix.arch }}/${{ matrix.release }}/* if [[ ${{ inputs.version }} != "master" ]]; then sudo ln -s /srv/repository/mirror/releases/server/ubuntu/versions/${JELLYFIN_VERSION}/${{ matrix.arch }} /srv/repository/mirror/releases/server/ubuntu/latest-server fi