FFmpeg library release #6
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 library release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'FFmpeg library version (e.g., 8.0.0.1)' | |
| required: true | |
| push: | |
| tags: | |
| - 'lib-[0-9]*.[0-9]*.[0-9]*.[0-9]*' | |
| permissions: | |
| pull-requests: write | |
| contents: write | |
| jobs: | |
| ffmpeg-release: | |
| name: Release FFmpeg library for ${{ matrix.os }} ${{ matrix.arch }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: linux | |
| arch: amd64 | |
| runner: ubuntu-24.04 | |
| - os: linux | |
| arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| - os: darwin | |
| arch: amd64 | |
| runner: macos-15-intel | |
| - os: darwin | |
| arch: arm64 | |
| runner: macos-15 | |
| fail-fast: false | |
| steps: | |
| - name: Validate version format | |
| if: github.event_name == 'workflow_dispatch' | |
| run: | | |
| if [[ ! "${{ inputs.version }}" =~ ^lib- ]]; then | |
| echo "Error: Version must start with 'lib-' prefix (e.g., 'lib-8.0.0.0')" | |
| exit 1 | |
| fi | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.24' | |
| cache: true | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-bin: false | |
| - uses: taiki-e/cache-cargo-install-action@v2 | |
| with: | |
| tool: cargo-c | |
| - name: Install Linux dependencies | |
| if: matrix.os == 'linux' | |
| run: sudo apt-get update && sudo apt-get install -y yasm nasm meson gperf python3 | |
| - name: Install macOS dependencies | |
| if: matrix.os == 'darwin' | |
| run: brew update && brew install yasm autoconf ragel meson nasm automake libtool python3 | |
| - name: Cache FFmpeg source downloads | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build/downloads | |
| key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-downloads-${{ hashFiles('internal/builder/libraries.go') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-ffmpeg-downloads- | |
| - name: Cache compiled dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .build/staging | |
| .build/build | |
| key: ${{ runner.os }}-${{ runner.arch }}-ffmpeg-deps-${{ hashFiles('internal/builder/libraries.go', 'internal/builder/buildsystems.go') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ runner.arch }}-ffmpeg-deps- | |
| - name: Clean FFmpeg build | |
| run: go run ./internal/builder/ ffmpeg --clean | |
| - name: Build FFmpeg library | |
| run: go run ./internal/builder/ | |
| - name: List built files | |
| run: ls -lh lib/${{ matrix.os }}_${{ matrix.arch }}/ | |
| - name: Create tarball | |
| run: | | |
| cd lib | |
| tar -czf ../ffmpeg-${{ matrix.os }}-${{ matrix.arch }}.tar.gz ${{ matrix.os }}_${{ matrix.arch }}/libffmpeg.a | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ffmpeg-${{ matrix.os }}-${{ matrix.arch }}.tar.gz | |
| tag_name: ${{ inputs.version }} | |
| body: | | |
| ## FFmpeg Static Libraries | |
| **Version:** ${{ inputs.version }} | |
| **Platforms:** | |
| - Linux amd64 | |
| - Linux arm64 | |
| - macOS x86 (Intel) | |
| - macOS arm64 (Apple Silicon) | |