diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 249b383..27bce51 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,7 +9,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [windows-latest, ubuntu-latest, macos-latest] + os: [windows-latest, ubuntu-latest, macos-latest, ubuntu-22.04-arm] fail-fast: false steps: - name: Expose GitHub Runtime diff --git a/build/Build.csproj b/build/Build.csproj index 646f1ad..ac29f1b 100644 --- a/build/Build.csproj +++ b/build/Build.csproj @@ -22,6 +22,7 @@ + @@ -34,4 +35,4 @@ - \ No newline at end of file + diff --git a/build/BuildLinuxTask.cs b/build/BuildLinuxTask.cs index dc43469..cf4b39d 100644 --- a/build/BuildLinuxTask.cs +++ b/build/BuildLinuxTask.cs @@ -10,10 +10,11 @@ public sealed class BuildLinuxTask : FrostingTask public override void Run(BuildContext context) { // Absolute path to the artifact directory is needed for flags since they don't allow relative path + var arch = RuntimeInformation.OSArchitecture; var artifactDir = context.MakeAbsolute(new DirectoryPath(context.ArtifactsDir)); - var dependencyDir = context.MakeAbsolute(new DirectoryPath($"{context.ArtifactsDir}/../dependencies-linux-x64")); + var dependencyDir = context.MakeAbsolute(new DirectoryPath($"{context.ArtifactsDir}/../dependencies-linux-{(arch == Architecture.Arm64 ? "arm64" : "x64")}")); var prefixFlag = $"--prefix=\"{dependencyDir}\""; - var hostFlag = "--host=\"x86_64-linux-gnu\""; + var hostFlag = arch == Architecture.Arm64 ? "--host=\"aarch64-linux-gnu\"" : "--host=\"x86_64-linux-gnu\""; var binDirFlag = $"--bindir=\"{artifactDir}\""; var envVariables = new Dictionary @@ -85,7 +86,8 @@ private static string GetFFMpegConfigureFlags(BuildContext context) { var ignoreCommentsAndNewLines = (string line) => !string.IsNullOrWhiteSpace(line) && !line.StartsWith('#'); var configureFlags = context.FileReadLines("ffprobe.config").Where(ignoreCommentsAndNewLines); - var osConfigureFlags = context.FileReadLines($"ffprobe.linux-x64.config").Where(ignoreCommentsAndNewLines); + var osConfigFile = RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "ffprobe.linux-arm64.config" : "ffprobe.linux-x64.config"; + var osConfigureFlags = context.FileReadLines(osConfigFile).Where(ignoreCommentsAndNewLines); return string.Join(' ', configureFlags) + " " + string.Join(' ', osConfigureFlags); } } diff --git a/ffprobe.linux-arm64.config b/ffprobe.linux-arm64.config new file mode 100644 index 0000000..05e90e6 --- /dev/null +++ b/ffprobe.linux-arm64.config @@ -0,0 +1,10 @@ +######################################################################################################################## +### Toolchain Options +######################################################################################################################## +--arch=aarch64 +--target-os=linux + +######################################################################################################################## +### Optimization Options +######################################################################################################################## +--enable-neon