ffmpeg-release #72
Workflow file for this run
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: ffmpeg-release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Check if current commit is tagged | |
| id: check_tag | |
| run: | | |
| TAG=$(git describe --exact-match --tags HEAD 2>/dev/null || echo "") | |
| if [ -z "$TAG" ]; then | |
| echo "Error: Current commit is not tagged with a version tag" | |
| exit 1 | |
| fi | |
| if [[ ! "$TAG" =~ ^v ]]; then | |
| echo "Error: Tag must start with 'v' (found: $TAG)" | |
| exit 1 | |
| fi | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| echo "Found version tag: $TAG" | |
| - name: Verify all platform builds succeeded | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ steps.check_tag.outputs.tag }}" | |
| echo "Verifying platform builds for tag $TAG (commit ${{ github.sha }})..." | |
| # Check Linux workflow - filter by both head_sha and head_branch (tag name) | |
| LINUX_STATUS=$(gh api repos/${{ github.repository }}/actions/workflows/ffmpeg-linux.yml/runs \ | |
| --jq ".workflow_runs[] | select(.head_sha == \"${{ github.sha }}\" and .head_branch == \"$TAG\") | select(.conclusion != null) | .conclusion" | head -1) | |
| # Check Windows workflow - filter by both head_sha and head_branch (tag name) | |
| WINDOWS_STATUS=$(gh api repos/${{ github.repository }}/actions/workflows/ffmpeg-windows.yml/runs \ | |
| --jq ".workflow_runs[] | select(.head_sha == \"${{ github.sha }}\" and .head_branch == \"$TAG\") | select(.conclusion != null) | .conclusion" | head -1) | |
| # Check macOS workflow - filter by both head_sha and head_branch (tag name) | |
| MACOS_STATUS=$(gh api repos/${{ github.repository }}/actions/workflows/ffmpeg-macos.yml/runs \ | |
| --jq ".workflow_runs[] | select(.head_sha == \"${{ github.sha }}\" and .head_branch == \"$TAG\") | select(.conclusion != null) | .conclusion" | head -1) | |
| echo "Linux build status: ${LINUX_STATUS:-not found}" | |
| echo "Windows build status: ${WINDOWS_STATUS:-not found}" | |
| echo "macOS build status: ${MACOS_STATUS:-not found}" | |
| # Verify all builds succeeded | |
| if [ "$LINUX_STATUS" != "success" ] || [ "$WINDOWS_STATUS" != "success" ] || [ "$MACOS_STATUS" != "success" ]; then | |
| echo "Error: Not all platform builds have succeeded for tag $TAG" | |
| echo "Please ensure all three platform workflows (ffmpeg-linux, ffmpeg-windows, ffmpeg-macos) triggered by tag $TAG have completed successfully" | |
| exit 1 | |
| fi | |
| echo "All platform builds succeeded for tag $TAG!" | |
| - name: Download Linux artifacts | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ steps.check_tag.outputs.tag }}" | |
| mkdir -p /tmp/artifacts | |
| RUN_ID=$(gh api repos/${{ github.repository }}/actions/workflows/ffmpeg-linux.yml/runs \ | |
| --jq ".workflow_runs[] | select(.head_sha == \"${{ github.sha }}\" and .head_branch == \"$TAG\" and .conclusion == \"success\") | .id" | head -1) | |
| echo "Downloading Linux artifacts from run ID: $RUN_ID (tag: $TAG)" | |
| gh run download $RUN_ID -D /tmp/artifacts | |
| - name: Download Windows artifacts | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ steps.check_tag.outputs.tag }}" | |
| RUN_ID=$(gh api repos/${{ github.repository }}/actions/workflows/ffmpeg-windows.yml/runs \ | |
| --jq ".workflow_runs[] | select(.head_sha == \"${{ github.sha }}\" and .head_branch == \"$TAG\" and .conclusion == \"success\") | .id" | head -1) | |
| echo "Downloading Windows artifacts from run ID: $RUN_ID (tag: $TAG)" | |
| gh run download $RUN_ID -D /tmp/artifacts | |
| - name: Download macOS artifacts | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ steps.check_tag.outputs.tag }}" | |
| RUN_ID=$(gh api repos/${{ github.repository }}/actions/workflows/ffmpeg-macos.yml/runs \ | |
| --jq ".workflow_runs[] | select(.head_sha == \"${{ github.sha }}\" and .head_branch == \"$TAG\" and .conclusion == \"success\") | .id" | head -1) | |
| echo "Downloading macOS artifacts from run ID: $RUN_ID (tag: $TAG)" | |
| gh run download $RUN_ID -D /tmp/artifacts | |
| - name: List downloaded artifacts | |
| run: | | |
| echo "Downloaded artifacts:" | |
| find /tmp/artifacts -type f -name "*.tar.xz" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.check_tag.outputs.tag }} | |
| files: /tmp/artifacts/**/*.tar.xz | |
| fail_on_unmatched_files: true |