Repository navigation
Nightly Build #1857
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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-24.04 | |
| outputs: | |
| status: ${{ steps.decision.outputs.status }} | |
| commit: ${{ steps.decision.outputs.ffmpeg_commit }} | |
| 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=$(gh api repos/FFmpeg/FFmpeg/commits/master --jq '.sha' | cut -c1-9) | |
| echo "ffmpeg_commit=${FFMPEG_LATEST}" >> "$GITHUB_OUTPUT" | |
| 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-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [win64] | |
| variant: [nonfree, nonfree-shared] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.dodosolsollalasol }} | |
| - name: Build ffmpeg | |
| run: ./build.sh ${{ matrix.target }} ${{ matrix.variant }} | |
| env: | |
| FFMPEG_COMMIT: ${{ needs.decision_task.outputs.commit }} | |
| - name: Replace spaces in artifact name | |
| id: artifact | |
| run: | | |
| REF="${{ matrix.target }}-${{ matrix.variant }}" | |
| echo "name=${REF// /-}" >> "$GITHUB_OUTPUT" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ffmpeg-${{ steps.artifact.outputs.name }} | |
| path: artifacts/ | |
| retention-days: 1 | |
| archive: false | |
| publish_release: | |
| name: Publish release | |
| needs: build_ffmpeg | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create release | |
| id: create_release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| set -xe | |
| BUILDID=$(date +'%Y-%m-%d-%H-%M') | |
| STUB=$(basename artifacts/*.zst | head -n1) | |
| REV=$(echo "$STUB" | cut -d'-' -f5) | |
| NTAG=$(echo "$STUB" | cut -d'-' -f3) | |
| for f in artifacts/ffmpeg-N-*-win64-nonfree*.tar.zst; do | |
| newname=$(basename "$f" | sed 's/ffmpeg-N-[^-]*-git-[^-]*-/ffmpeg-/') | |
| mv "$f" "artifacts/$newname" | |
| done | |
| TITLE="Build $BUILDID" | |
| RELNOTE="Built from FFmpeg/FFmpeg@$REV" | |
| TAGNAME="build-$BUILDID-n$NTAG" | |
| gh release create "$TAGNAME" \ | |
| --title "$TITLE" \ | |
| --notes "$RELNOTE" \ | |
| artifacts/*.zst |