mirror of
https://github.com/jellyfin/jellyfin-ffmpeg.git
synced 2026-09-03 05:09:58 +03:00
124 lines
3.9 KiB
YAML
124 lines
3.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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
|
|
- 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@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.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 no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v
|
|
core.setOutput('tag', tag)
|
|
core.setOutput('no-v', no_v)
|
|
core.setOutput('no-dash', no_dash)
|
|
|
|
- name: Download Artifacts
|
|
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
|
|
with:
|
|
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@dccd6d23e64fd6a746dce6814c0bde0a04886085 # v1.7.2
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
overwrite: true
|
|
asset_path: |
|
|
./artifact/**/*.zip
|
|
./artifact/**/*.deb
|
|
./artifact/**/*.sha256sum
|
|
|
|
- name: Make Sure Release Directory Exists
|
|
uses: appleboy/ssh-action@55dabf81b49d4120609345970c91507e2d734799 # v1.0.0
|
|
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 }}/
|
|
|
|
- name: Upload Release Assets
|
|
uses: burnett01/rsync-deployments@45d84ad5f6c174f3e0ffc50e9060a9666d09c16e # 6.0.0
|
|
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 }}
|