FFmpeg-Builds/.github/workflows/build.yml

154 lines
5.3 KiB
YAML
Raw Normal View History

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:
2020-09-27 23:42:13 +00:00
purge_artifacts:
name: Purge old artifacts
runs-on: ubuntu-latest
steps:
- name: Purge old artifacts
2020-09-28 18:20:19 +00:00
uses: c-hive/gha-remove-artifacts@v1
2020-09-27 23:42:13 +00:00
with:
2020-09-28 18:20:19 +00:00
age: 0 days
skip-recent: 3
2020-09-03 00:15:17 +00:00
build_base:
name: Build base image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- 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:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ github.token }}
2020-09-27 21:46:53 +00:00
- name: Image Name
id: imagename
run: echo "::set-output name=name::docker.pkg.github.com/${GITHUB_REPOSITORY,,}/base:latest"
2020-09-20 00:40:08 +00:00
- name: Pull latest
2020-09-27 21:46:53 +00:00
run: docker pull ${{ steps.imagename.outputs.name }} || true
2020-09-20 00:40:08 +00:00
- name: Build base image
2020-09-27 21:46:53 +00:00
run: docker build --pull --cache-from ${{ steps.imagename.outputs.name }} --tag ${{ steps.imagename.outputs.name }} images/base
2020-09-20 00:40:08 +00:00
- name: Push base image
2020-09-27 21:46:53 +00:00
run: docker push ${{ steps.imagename.outputs.name }}
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
- 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:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ github.token }}
2020-09-27 21:46:53 +00:00
- name: Image Name
id: imagename
run: echo "::set-output name=name::docker.pkg.github.com/${GITHUB_REPOSITORY,,}/base-${{ matrix.target }}:latest"
2020-09-20 00:40:08 +00:00
- name: Pull latest
2020-09-27 21:46:53 +00:00
run: docker pull ${{ steps.imagename.outputs.name }} || true
2020-09-20 00:40:08 +00:00
- name: Build target base image
2020-09-27 21:46:53 +00:00
run: docker build --pull --build-arg GH_REPO=${GITHUB_REPOSITORY,,} --cache-from ${{ steps.imagename.outputs.name }} --tag ${{ steps.imagename.outputs.name }} images/base-${{ matrix.target }}
2020-09-20 00:40:08 +00:00
- name: Push target base image
2020-09-27 21:46:53 +00:00
run: docker push ${{ steps.imagename.outputs.name }}
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-27 21:19:54 +00:00
variant: [gpl,lgpl,gpl vulkan,lgpl vulkan,gpl 4.3,lgpl 4.3,gpl-shared,lgpl-shared,gpl-shared vulkan,lgpl-shared vulkan,gpl-shared 4.3,lgpl-shared 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 }}
- 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:
registry: docker.pkg.github.com
username: ${{ github.actor }}
password: ${{ github.token }}
2020-09-27 21:40:54 +00:00
- name: Image Name
id: imagename
run: |
IMG="docker.pkg.github.com/${GITHUB_REPOSITORY,,}/${{ matrix.target }}-${{ matrix.variant }}:latest"
2020-09-27 21:40:54 +00:00
echo "::set-output name=name::${IMG/ /-}"
- name: Pull latest
run: docker pull ${{ steps.imagename.outputs.name }} || true
- name: Build variant image
run: docker build --pull --cache-from ${{ steps.imagename.outputs.name }} --tag ${{ steps.imagename.outputs.name }} .
2020-09-20 00:40:08 +00:00
- name: Push variant image
2020-09-27 21:40:54 +00:00
run: docker push ${{ steps.imagename.outputs.name }}
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-27 21:19:54 +00:00
variant: [gpl,lgpl,gpl vulkan,lgpl vulkan,gpl 4.3,lgpl 4.3,gpl-shared,lgpl-shared,gpl-shared vulkan,lgpl-shared vulkan,gpl-shared 4.3,lgpl-shared 4.3]
2020-09-03 14:40:19 +00:00
steps:
- name: Checkout
uses: actions/checkout@v2
- 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-30 19:27:42 +00:00
id: 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')"
2020-09-30 19:27:42 +00:00
hub release create $(for a in artifacts/*.zip; do echo -a $a; done) -m "$NAME" -t "master" "$TAGNAME"
echo "::set-output name=tag_name::${TAGNAME}"
2020-09-03 15:19:35 +00:00
env:
2020-09-30 19:27:42 +00:00
GITHUB_TOKEN: ${{ github.token }}
- name: Update Wiki
run: ./util/update_wiki.sh artifacts ${{ steps.create_release.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Prune old releases
run: ./util/prunetags.sh
env:
2020-09-30 19:27:42 +00:00
GITHUB_TOKEN: ${{ github.token }}