Skip to content

Nightly Build

Nightly Build #822

Workflow file for this run

name: Nightly Build
on:
workflow_dispatch:
schedule:
- cron: '0 21 * * *' # Runs at 06:00 Tokyo time every day 🕕
jobs:
decision_task:
name: Determine whether to perform Nightly build
runs-on: ubuntu-22.04
outputs:
status: ${{ steps.decision.outputs.status }}
steps:
- name: Take a decision
id: decision
env:
GH_TOKEN: ${{ github.token }}
run: |
set -xe
LATEST_RELEASE=$(gh api repos/${{ github.repository }}/releases/latest --jq '.body' | cut -d@ -f2)
FFMPEG_LATEST=$(git ls-remote https://github.com/FFmpeg/FFmpeg.git HEAD | cut -c1-9)
if [[ "$LATEST_RELEASE" == "$FFMPEG_LATEST" ]]; then
echo "status=skip" >> $GITHUB_OUTPUT
else
echo "status=proceed" >> $GITHUB_OUTPUT
fi
build_ffmpeg:
needs: decision_task
if: needs.decision_task.outputs.status == 'proceed'
name: Build ffmpeg
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
target: [ucrt64, win32, win64]
variant: [nonfree, nonfree-shared]
exclude:
- target: ucrt64
variant: nonfree-shared
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.dodosolsollalasol }}
- name: Build ffmpeg
run: ./build.sh ${{ matrix.target }} ${{ matrix.variant }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: ffmpeg
path: artifacts/
retention-days: 1
publish_release:
name: Publish release
needs: build_ffmpeg
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: ffmpeg
path: artifacts
- name: Create release
id: create_release
env:
GH_TOKEN: ${{ github.token }}
run: |
set -xe
BUILDID=$(date +'%Y-%m-%d-%H-%M')
STUB=$(find artifacts -iname '*.7z' | head -1 | xargs -I{} basename {})
REV=$(echo $STUB | cut -d'-' -f5)
NTAG=$(echo $STUB | cut -d'-' -f3)
TITLE="Build $BUILDID @ $REV"
BODY="Built from FFmpeg/FFmpeg@$REV"
TAGNAME="build-$BUILDID-n$NTAG"
gh release create $TAGNAME $(for a in artifacts/*.7z; do echo $a; done) -t "$TITLE" -n "$BODY"