Skip to content

Commit

Permalink
Merge pull request #17 from FedericoCarboni/v3-preview
Browse files Browse the repository at this point in the history
V3
  • Loading branch information
federicocarboni committed Jan 3, 2024
2 parents 5058c98 + e4757b7 commit 36c6454
Show file tree
Hide file tree
Showing 22 changed files with 59,154 additions and 13,619 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/builds.yml

This file was deleted.

38 changes: 37 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ on:
- '**.md'

jobs:
test-arch:
runs-on: ubuntu-latest
timeout-minutes: 2

steps:
- uses: actions/checkout@v3
- name: Run FedericoCarboni/setup-ffmpeg
uses: ./
with:
architecture: arm64
- name: Run FedericoCarboni/setup-ffmpeg
uses: ./
with:
architecture: arm64
- run: which ffmpeg
- run: which ffprobe

test:
runs-on: ${{ matrix.os }}
timeout-minutes: 2
Expand All @@ -20,7 +37,26 @@ jobs:
- name: Run FedericoCarboni/setup-ffmpeg
uses: ./
- name: Run FedericoCarboni/setup-ffmpeg
id: setup-ffmpeg
uses: ./
- run: ffmpeg -version
- run: ffprobe -version
- name: Run FedericoCarboni/setup-ffmpeg
uses: ./
with:
ffmpeg-version: git
- name: Run FedericoCarboni/setup-ffmpeg
uses: ./
with:
ffmpeg-version: git
- run: ffmpeg -version
- run: ffprobe -version
- name: Run FedericoCarboni/setup-ffmpeg
uses: ./
with:
ffmpeg-version: '5.1.1'
- name: Run FedericoCarboni/setup-ffmpeg
uses: ./
with:
ffmpeg-version: '5.1.1'
- run: ffmpeg -version
- run: ffprobe -version
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"bracketSpacing": false,
"arrowParens": "always"
}
58 changes: 42 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
# setup-ffmpeg
Setup FFmpeg in GitHub Actions to use `ffmpeg` and `ffprobe`. The action will download, cache and
add to `PATH` a recent FFmpeg build for the current os.

# Usage
To use `ffmpeg` and `ffprobe`, run the action before them.
This action sets up and caches a specific FFmpeg version, providing the `ffmpeg`
and `ffprobe` commands.

Builds are downloaded from the following sources:

- <https://johnvansickle.com/ffmpeg/> Linux builds
- <https://www.gyan.dev/ffmpeg/builds/> Windows builds
- <https://evermeet.cx/ffmpeg/> MacOS builds

## v3 vs v2

Version 3 of this action downloads binaries directly from the sources listed above
instead of periodically updating GitHub releases. In turn this means it receives
updates more frequently and supports git master builds and selecting a specific
version.

By default the latest release version available for the platform is used. As
upstream sources are not guaranteed to update at the same time, the action may
at times install different versions of ffmpeg for different operating systems,
unless a specific version is requested.

## Usage

See [`action.yml`](./action.yml).

```yml
steps:
- uses: actions/checkout@v3
- uses: FedericoCarboni/setup-ffmpeg@v2
- uses: FedericoCarboni/setup-ffmpeg@v3
id: setup-ffmpeg
with:
# A specific version to download, may also be "release" or a specific version
# like "6.1.0". At the moment semver specifiers (i.e. >=6.1.0) are supported
# only on Windows, on other platforms they are allowed but version is matched
# exactly regardless.
ffmpeg-version: release
# Target architecture of the ffmpeg executable to install. Defaults to the
# system architecture. Only x64 and arm64 are supported (arm64 only on Linux).
architecture: ''
# As of version 3 of this action, builds are no longer downloaded from GitHub
# except on Windows: https://github.com/GyanD/codexffmpeg/releases.
github-token: ${{ github.server_url == 'https://github.com' && github.token || '' }}
- run: ffmpeg -i input.avi output.mkv
```
This action also sets a few outputs:
- `path`: Path to the install directory
- `ffmpeg-path`: Path to the ffmpeg executable
- `ffprobe-path`: Path to the ffprobe executable

# FFmpeg Version
The action uses a recent FFmpeg build provided by the following sources:
- Linux Builds - https://johnvansickle.com/ffmpeg/
- Windows Builds - https://www.gyan.dev/ffmpeg/builds/
- MacOS Builds - https://evermeet.cx/ffmpeg/
### Outputs
**Note:** This action only supports x64 operating systems.
- `ffmpeg-version`: Installed version of FFmpeg.
- `ffmpeg-path`: Path to the install directory containing `ffmpeg` and `ffprobe`
binaries.
- `cache-hit`: A boolean value indicating whether the tool cache was hit.
25 changes: 18 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
name: Setup FFmpeg
description: Setup FFmpeg in GitHub Actions

description: 'Download, cache and add to PATH ffmpeg and ffprobe binaries.'
author: Federico Carboni
inputs:
token:
required: false
default: ${{ github.token }}

ffmpeg-version:
description: 'Version of ffmpeg to use. Version Spec is only fully supported on Windows.'
default: release
architecture:
description: 'Target architecture for FFmpeg, on Windows and MacOS only x64 is supported; on Linux arm64 may also be used. Defaults to the system architecture.'
github-token:
description: "Used to pull Windows builds from GyanD/codexffmpeg. Since there's a default, this is typically not supplied by the user."
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
outputs:
ffmpeg-version:
description: The installed ffmpeg version
ffmpeg-path:
description: Path to the ffmpeg binaries
cache-hit:
description: A boolean value to indicate whether the tool cache was hit
runs:
using: node16
using: node20
main: dist/index.js
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// For testing with Jest
module.exports = {
presets: [['@babel/preset-env', {
targets: {node: 'current'},
}]],
};
Binary file added dist/7zr.exe
Binary file not shown.
Loading

0 comments on commit 36c6454

Please sign in to comment.