FFmpeg-Builds/.github/workflows/build.yml
2020-09-06 04:08:17 +02:00

114 lines
3.5 KiB
YAML

name: Build FFmpeg
on:
push: []
schedule:
- cron: '0 12 * * *'
jobs:
build_base:
name: Build base image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Pull latest
run: docker pull btbn/ffmpeg-builder:base || true
- name: Build and push base
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
always_pull: true
cache_froms: btbn/ffmpeg-builder:base
repository: btbn/ffmpeg-builder
tags: base
path: images/base
build_target_bases:
name: Build target base image
needs: build_base
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [win64]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Pull latest
run: docker pull btbn/ffmpeg-builder:base-${{ matrix.target }} || true
- name: Build and push target base
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
always_pull: true
cache_froms: btbn/ffmpeg-builder:base-${{ matrix.target }}
repository: btbn/ffmpeg-builder
tags: base-${{ matrix.target }}
path: images/base-${{ matrix.target }}
build_targets:
name: Build target-variant image
needs: build_target_bases
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [win64]
variant: [gpl,lgpl,gpl-4.3,lgpl-4.3]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate Dockerfile
run: ./generate.sh ${{ matrix.target }} ${{ matrix.variant }}
- name: Pull latest
run: docker pull btbn/ffmpeg-builder:${{ matrix.target }}-${{ matrix.variant }} || true
- name: Build and push target base
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}
always_pull: true
cache_froms: btbn/ffmpeg-builder:${{ matrix.target }}-${{ matrix.variant }}
repository: btbn/ffmpeg-builder
tags: ${{ matrix.target }}-${{ matrix.variant }}
build_ffmpeg:
name: Build ffmpeg
needs: build_targets
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [win64]
variant: [gpl,lgpl,gpl-4.3,lgpl-4.3]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build ffmpeg
run: ./build.sh ${{ matrix.target }} ${{ matrix.variant }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ffmpeg
path: artifacts/*
publish_release:
name: Publish release
if: github.event_name == 'schedule'
needs: build_ffmpeg
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: ffmpeg
path: artifacts
- name: Create release
run: |
set -xe
NAME="Auto-Build $(date +'%Y-%m-%d %H:%M')"
TAGNAME="autobuild-$(date +'%Y-%m-%d-%H-%M')"
hub release create $(for a in artifacts/*; do echo -a $a; done) -m "$NAME" -t "master" "$TAGNAME"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}