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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
|
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@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
|
with:
|
|
name: ${{ inputs.distro }}-${{ matrix.release }}-${{ matrix.arch }}
|
|
path: artifact
|
|
|
|
- name: Upload GH Release Assets
|
|
uses: shogo82148/actions-upload-release-asset@aac270e08f6b4547ada0b3800f88e1eb3ce9d400 # v1.7.7
|
|
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@917f8b81dfc1ccd331fef9e2d61bdc6c8be94634 # v0.1.7
|
|
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@25ce8cbbcb08177468c7ff7ec5cbfa236f9341e1 # v1.1.0
|
|
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
|