Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 #17

Merged
merged 81 commits into from
Jan 3, 2024
Merged

V3 #17

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
853cc3b
fix: migrate from deprecated ::set-output
federicocarboni May 26, 2023
774bc45
fix: migrate from deprecated actions
federicocarboni May 26, 2023
b6d131a
deps: switch to pnpm and upgrade dependencies
federicocarboni May 26, 2023
9bc0531
change version to 3
federicocarboni May 26, 2023
bfa9aa7
docs: update version to 3
federicocarboni May 26, 2023
afa3ccf
build action file
federicocarboni May 26, 2023
551eae4
fix permissions
federicocarboni May 26, 2023
85d13d7
fix tag_name
federicocarboni May 26, 2023
5201bf2
update dependencies
federicocarboni Dec 15, 2023
a099a47
use node20
federicocarboni Dec 15, 2023
b5b8a5a
remove octokit
federicocarboni Dec 15, 2023
dd27767
update ncc
federicocarboni Dec 15, 2023
b422a8f
download directly from sources
federicocarboni Dec 15, 2023
13fbfc9
build
federicocarboni Dec 15, 2023
e702f87
change tar flags
federicocarboni Dec 15, 2023
e2cd0f1
build
federicocarboni Dec 15, 2023
e89a973
point cachedir to the correct directory
federicocarboni Dec 15, 2023
16b471f
build
federicocarboni Dec 15, 2023
b1d8fa0
use correct version and correct skipVerify to false
federicocarboni Dec 15, 2023
ee02d50
build
federicocarboni Dec 15, 2023
7efb183
fix hash check
federicocarboni Dec 15, 2023
79335e7
build
federicocarboni Dec 15, 2023
7abc71e
use zip
federicocarboni Dec 15, 2023
9339616
log path
federicocarboni Dec 15, 2023
a02a201
log paths
federicocarboni Dec 15, 2023
6137e9c
use 7zr
federicocarboni Dec 15, 2023
d51b613
correct windows folder
federicocarboni Dec 15, 2023
666b2c6
fix windows paths
federicocarboni Dec 15, 2023
ff63750
fix windows cachedir path
federicocarboni Dec 15, 2023
87b01bb
debug macos
federicocarboni Dec 15, 2023
1c5b458
macos
federicocarboni Dec 15, 2023
8ffbbbf
fix import
federicocarboni Dec 15, 2023
f6a0594
debug res
federicocarboni Dec 15, 2023
8cbb0d9
print error
federicocarboni Dec 15, 2023
ab24aa0
use undici instead of @actions/http-client
federicocarboni Dec 15, 2023
135b695
fix downloadText
federicocarboni Dec 15, 2023
5843dc9
import mkdir
federicocarboni Dec 15, 2023
462e793
missing await
federicocarboni Dec 15, 2023
b7e96fe
fix gnupg folder permission
federicocarboni Dec 15, 2023
7f46cf6
fix mkdir
federicocarboni Dec 15, 2023
79ea331
fix tool cache using git and release as versions
federicocarboni Dec 16, 2023
d1d3942
log toolVersion
federicocarboni Dec 16, 2023
8ca5fda
missing await
federicocarboni Dec 16, 2023
dc2f28f
fix platform
federicocarboni Dec 16, 2023
1dd4833
fix temp file clash and download key directly
federicocarboni Dec 16, 2023
92450dc
fix temp keyring
federicocarboni Dec 16, 2023
c20ca83
unlink tmp files
federicocarboni Dec 16, 2023
e503716
add prefix to git version
federicocarboni Dec 17, 2023
7520930
check both git and release
federicocarboni Dec 17, 2023
6fdaf87
fix caching
federicocarboni Dec 17, 2023
eb2ce40
fix linux release download
federicocarboni Dec 17, 2023
35309f1
fix #16
federicocarboni Dec 17, 2023
f0d261f
build
federicocarboni Dec 17, 2023
7c1f28b
refactor: remove useless rename
federicocarboni Dec 17, 2023
820fbde
add ts and prettier to config
federicocarboni Dec 19, 2023
821839f
add input ffmpeg-version and rename token to github-token
federicocarboni Dec 19, 2023
d80bdc2
split different distributions in different modules
federicocarboni Dec 19, 2023
84643ea
build
federicocarboni Dec 19, 2023
4fd800b
docs: update usage example
federicocarboni Dec 19, 2023
34b2b76
use proper version in readme
federicocarboni Dec 19, 2023
3c70ce1
add install dir to path
federicocarboni Dec 19, 2023
e679093
don't output commonjs to webpack
federicocarboni Dec 19, 2023
6825931
build
federicocarboni Dec 19, 2023
2c40c44
fix 7zr path
federicocarboni Dec 19, 2023
827cec5
enable tool cache
federicocarboni Dec 19, 2023
a626f16
use getLatestVersion
federicocarboni Dec 19, 2023
b3c0f80
ci update tests
federicocarboni Dec 19, 2023
5ca96e3
fix yaml syntax
federicocarboni Dec 19, 2023
7fb15ff
typo
federicocarboni Dec 19, 2023
e6a6966
ci use ffmpeg version 5.1.1 because it's available on linux
federicocarboni Dec 19, 2023
e7882a4
refactor: move 7zr.exe to vendor and add appropriate license
federicocarboni Dec 19, 2023
aeeb394
fix architecture option
federicocarboni Dec 21, 2023
d4071ca
add inputs and outputs to action.yml
federicocarboni Dec 21, 2023
f0ec839
docs
federicocarboni Dec 21, 2023
b1cdc00
typo
federicocarboni Dec 23, 2023
f1842ec
update babel config
federicocarboni Dec 23, 2023
1071894
update readme
federicocarboni Dec 23, 2023
b0fa742
ci: test architecture option
federicocarboni Dec 23, 2023
ab5f405
mention version 3 changes
federicocarboni Dec 23, 2023
2b67a30
lint and format
federicocarboni Dec 23, 2023
e4757b7
ci: fix arm64 tests
federicocarboni Dec 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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