mirror of
https://github.com/jellyfin/jellyfin-ffmpeg.git
synced 2026-09-03 05:09:58 +03:00
125 lines
4.9 KiB
YAML
125 lines
4.9 KiB
YAML
on:
|
|
workflow_call:
|
|
inputs:
|
|
distro:
|
|
required: true
|
|
default: 'debian'
|
|
type: string
|
|
codenames:
|
|
description: 'Stringified JSON object listing target distro codenames'
|
|
required: true
|
|
default: '["bullseye"]'
|
|
type: string
|
|
architectures:
|
|
description: 'Stringified JSON object listing target architectures'
|
|
required: true
|
|
default: '["amd64"]'
|
|
type: string
|
|
release:
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
secrets:
|
|
deploy-host:
|
|
required: false
|
|
deploy-user:
|
|
required: false
|
|
deploy-key:
|
|
required: false
|
|
|
|
jobs:
|
|
build:
|
|
name: 'Build FFmpeg'
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
release: ${{fromJson(inputs.codenames)}}
|
|
arch: ${{fromJson(inputs.architectures)}}
|
|
|
|
steps:
|
|
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
|
|
|
- name: Install make and mmv
|
|
run: sudo apt-get install make mmv
|
|
|
|
- name: Build Linux
|
|
run: ./build ${{ matrix.release }} ${{ matrix.arch }} dist
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: ${{ inputs.distro }}-${{ matrix.release }}-${{ matrix.arch }}
|
|
path: dist
|
|
|
|
publish:
|
|
name: Publish Release
|
|
if: ${{ inputs.release }}
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- build
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
release: ${{fromJson(inputs.codenames)}}
|
|
arch: ${{fromJson(inputs.architectures)}}
|
|
|
|
steps:
|
|
- name: Set Versions
|
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
id: set_version
|
|
with:
|
|
script: |
|
|
const tag = context.ref.substring(10)
|
|
const no_v = tag.replace('v', '')
|
|
const dash_index = no_v.lastIndexOf('-')
|
|
const major_index = no_v.indexOf('.')
|
|
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@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
|
|
with:
|
|
name: ${{ inputs.distro }}-${{ matrix.release }}-${{ matrix.arch }}
|
|
path: artifact
|
|
|
|
- name: Upload GH Release Assets
|
|
uses: shogo82148/actions-upload-release-asset@610b1987249a69a79de9565777e112fb38f22436 # v1.8.1
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
overwrite: true
|
|
asset_path: |
|
|
./artifact/**/*.zip
|
|
./artifact/**/*.deb
|
|
|
|
- name: Upload release archive to repo.jellyfin.org
|
|
uses: appleboy/scp-action@ff85246acaad7bdce478db94a363cd2bf7c90345 # v1.0.0
|
|
with:
|
|
host: ${{ secrets.deploy-host }}
|
|
username: ${{ secrets.deploy-user }}
|
|
key: ${{ secrets.deploy-key }}
|
|
source: artifact/*
|
|
strip_components: 1
|
|
target: /srv/incoming/ffmpeg/${{ steps.set_version.outputs.no-v }}/${{ inputs.distro }}/${{ matrix.arch }}/${{ matrix.release }}
|
|
|
|
- name: Move incoming release into repository
|
|
uses: appleboy/ssh-action@2ead5e36573f08b82fbfce1504f1a4b05a647c6f # v1.2.2
|
|
with:
|
|
host: ${{ secrets.deploy-host }}
|
|
username: ${{ secrets.deploy-user }}
|
|
key: ${{ secrets.deploy-key }}
|
|
envs: JELLYFIN_VERSION
|
|
script_stop: true
|
|
script: |
|
|
# Create the target folder and move arch directory into it
|
|
sudo mkdir -p /srv/repository/main/ffmpeg/${{ inputs.distro }}/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }}
|
|
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 }}/${{ matrix.release }}/*
|
|
sudo chown -R root:root /srv/repository/main/ffmpeg/${{ inputs.distro }}/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }}/${{ matrix.arch }}
|
|
# Update symlink for latest-X.x
|
|
sudo rm -f /srv/repository/main/ffmpeg/${{ inputs.distro }}/latest-${{ steps.set_version.outputs.major }}.x || true
|
|
sudo ln -s /srv/repository/main/ffmpeg/${{ inputs.distro }}/${{ steps.set_version.outputs.major }}.x/${{ steps.set_version.outputs.no-v }} /srv/repository/main/ffmpeg/${{ inputs.distro }}/latest-${{ steps.set_version.outputs.major }}.x || true
|