2020-09-03 00:15:17 +00:00
|
|
|
name: Build FFmpeg
|
|
|
|
|
2020-09-03 17:20:10 +00:00
|
|
|
on:
|
|
|
|
push: []
|
2020-09-07 00:38:49 +00:00
|
|
|
repository_dispatch:
|
|
|
|
types: [build]
|
2020-09-03 17:20:10 +00:00
|
|
|
schedule:
|
|
|
|
- cron: '0 12 * * *'
|
2020-09-03 00:15:17 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_base:
|
|
|
|
name: Build base image
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-09-20 13:46:29 +00:00
|
|
|
- name: Login to Docker
|
2020-09-20 00:40:08 +00:00
|
|
|
uses: docker/login-action@v1
|
2020-09-03 00:15:17 +00:00
|
|
|
with:
|
2020-09-20 13:46:29 +00:00
|
|
|
registry: docker.pkg.github.com
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ github.token }}
|
2020-09-20 00:40:08 +00:00
|
|
|
- name: Pull latest
|
2020-09-20 13:46:29 +00:00
|
|
|
run: docker pull docker.pkg.github.com/${GITHUB_REPOSITORY,,}/base:latest || true
|
2020-09-20 00:40:08 +00:00
|
|
|
- name: Build base image
|
2020-09-20 13:46:29 +00:00
|
|
|
run: |
|
|
|
|
IMG="docker.pkg.github.com/${GITHUB_REPOSITORY,,}/base:latest"
|
|
|
|
docker build --pull --cache-from "$IMG" --tag "$IMG" images/base
|
2020-09-20 00:40:08 +00:00
|
|
|
- name: Push base image
|
2020-09-20 13:46:29 +00:00
|
|
|
run: docker push docker.pkg.github.com/${GITHUB_REPOSITORY,,}/base:latest
|
2020-09-03 00:15:17 +00:00
|
|
|
build_target_bases:
|
2020-09-03 12:41:26 +00:00
|
|
|
name: Build target base image
|
2020-09-03 00:15:17 +00:00
|
|
|
needs: build_base
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2020-09-06 02:08:17 +00:00
|
|
|
fail-fast: false
|
2020-09-03 00:15:17 +00:00
|
|
|
matrix:
|
|
|
|
target: [win64]
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-09-20 13:46:29 +00:00
|
|
|
- name: Login to Docker
|
2020-09-20 00:40:08 +00:00
|
|
|
uses: docker/login-action@v1
|
2020-09-03 00:15:17 +00:00
|
|
|
with:
|
2020-09-20 13:46:29 +00:00
|
|
|
registry: docker.pkg.github.com
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ github.token }}
|
2020-09-20 00:40:08 +00:00
|
|
|
- name: Pull latest
|
2020-09-20 13:46:29 +00:00
|
|
|
run: docker pull docker.pkg.github.com/${GITHUB_REPOSITORY,,}/base-${{ matrix.target }}:latest || true
|
2020-09-20 00:40:08 +00:00
|
|
|
- name: Build target base image
|
2020-09-20 13:46:29 +00:00
|
|
|
run: |
|
|
|
|
IMG="docker.pkg.github.com/${GITHUB_REPOSITORY,,}/base-${{ matrix.target }}:latest"
|
|
|
|
docker build --pull --build-arg GH_REPO=${GITHUB_REPOSITORY,,} --cache-from "$IMG" --tag "$IMG" images/base-${{ matrix.target }}
|
2020-09-20 00:40:08 +00:00
|
|
|
- name: Push target base image
|
2020-09-20 13:46:29 +00:00
|
|
|
run: docker push docker.pkg.github.com/${GITHUB_REPOSITORY,,}/base-${{ matrix.target }}:latest
|
2020-09-03 00:15:17 +00:00
|
|
|
build_targets:
|
2020-09-03 12:41:26 +00:00
|
|
|
name: Build target-variant image
|
2020-09-03 00:15:17 +00:00
|
|
|
needs: build_target_bases
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2020-09-06 02:08:17 +00:00
|
|
|
fail-fast: false
|
2020-09-03 00:15:17 +00:00
|
|
|
matrix:
|
|
|
|
target: [win64]
|
2020-09-07 15:40:37 +00:00
|
|
|
variant: [gpl,lgpl,gpl-vulkan,lgpl-vulkan,gpl-4.3,lgpl-4.3]
|
2020-09-03 00:15:17 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Generate Dockerfile
|
|
|
|
run: ./generate.sh ${{ matrix.target }} ${{ matrix.variant }}
|
2020-09-20 13:46:29 +00:00
|
|
|
- name: Login to Docker
|
2020-09-20 00:40:08 +00:00
|
|
|
uses: docker/login-action@v1
|
2020-09-03 00:15:17 +00:00
|
|
|
with:
|
2020-09-20 13:46:29 +00:00
|
|
|
registry: docker.pkg.github.com
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ github.token }}
|
2020-09-20 00:40:08 +00:00
|
|
|
- name: Pull latest
|
2020-09-20 13:46:29 +00:00
|
|
|
run: docker pull docker.pkg.github.com/${GITHUB_REPOSITORY,,}/${{ matrix.target }}-${{ matrix.variant }}:latest || true
|
2020-09-20 00:40:08 +00:00
|
|
|
- name: Build variant image
|
2020-09-20 13:46:29 +00:00
|
|
|
run: |
|
|
|
|
IMG="docker.pkg.github.com/${GITHUB_REPOSITORY,,}/${{ matrix.target }}-${{ matrix.variant }}:latest"
|
|
|
|
docker build --pull --cache-from "$IMG" --tag "$IMG" .
|
2020-09-20 00:40:08 +00:00
|
|
|
- name: Push variant image
|
2020-09-20 13:46:29 +00:00
|
|
|
run: docker push docker.pkg.github.com/${GITHUB_REPOSITORY,,}/${{ matrix.target }}-${{ matrix.variant }}:latest
|
2020-09-03 14:33:29 +00:00
|
|
|
build_ffmpeg:
|
|
|
|
name: Build ffmpeg
|
|
|
|
needs: build_targets
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2020-09-06 02:08:17 +00:00
|
|
|
fail-fast: false
|
2020-09-03 14:33:29 +00:00
|
|
|
matrix:
|
|
|
|
target: [win64]
|
2020-09-07 15:40:37 +00:00
|
|
|
variant: [gpl,lgpl,gpl-vulkan,lgpl-vulkan,gpl-4.3,lgpl-4.3]
|
2020-09-03 14:40:19 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2020-09-20 13:46:29 +00:00
|
|
|
- name: Login to Docker
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: docker.pkg.github.com
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ github.token }}
|
2020-09-03 14:40:19 +00:00
|
|
|
- name: Build ffmpeg
|
|
|
|
run: ./build.sh ${{ matrix.target }} ${{ matrix.variant }}
|
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: ffmpeg
|
|
|
|
path: artifacts/*
|
2020-09-03 15:19:35 +00:00
|
|
|
publish_release:
|
|
|
|
name: Publish release
|
2020-09-07 00:38:49 +00:00
|
|
|
if: github.event_name != 'push'
|
2020-09-03 15:19:35 +00:00
|
|
|
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
|
2020-09-03 15:42:29 +00:00
|
|
|
path: artifacts
|
2020-09-03 15:19:35 +00:00
|
|
|
- name: Create release
|
2020-09-03 16:27:19 +00:00
|
|
|
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"
|
2020-09-03 15:19:35 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-09-19 23:25:41 +00:00
|
|
|
- name: Prune old releases
|
|
|
|
run: ./util/prunetags.sh
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|