ci: Remove Node.JS requirement

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-01-14 09:31:41 +01:00
parent a627054e2f
commit a72eba6ded
6 changed files with 23 additions and 245 deletions

View file

@ -6,40 +6,24 @@ jobs:
windows: windows:
strategy: strategy:
matrix: matrix:
os: [windows-2016, windows-2019] os: windows-2019
include: include:
- os: windows-2016
generator_32: "Visual Studio 15 2017"
generator_64: "Visual Studio 15 2017"
sysversion: "10.0.17763.0"
- os: windows-2019 - os: windows-2019
generator_32: "Visual Studio 16 2019"
generator_64: "Visual Studio 16 2019"
sysversion: "10.0.18362.0" sysversion: "10.0.18362.0"
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: "Clone Repository" - name: "Clone Repository"
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: Install Node.JS 10.x - name: "Configure Project"
uses: actions/setup-node@v1
with:
node-version: 10
- name: Configure & Compile
shell: bash
env:
CMAKE_GENERATOR_32: ${{ matrix.generator_32 }}
CMAKE_GENERATOR_64: ${{ matrix.generator_64 }}
CMAKE_SYSTEM_VERSION: ${{ matrix.sysversion }}
run: node ./ci/builder.js
- name: Package
shell: bash
env:
CMAKE_GENERATOR_32: ${{ matrix.generator_32 }}
CMAKE_GENERATOR_64: ${{ matrix.generator_64 }}
run: | run: |
mkdir build/package cmake -H"." -B"build/temp" -G"Visual Studio 16 2019" -A"x64" -T"host=x64" -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_PACKAGE_NAME=StreamFX -DCMAKE_INSTALL_PREFIX="build/distrib" -DCMAKE_PACKAGE_PREFIX="build/package" -DOBS_DOWNLOAD=true
ls build/ - name: "Build Project"
node ./ci/packager.js run: |
cmake -H. -B"build/temp" --config RelWithDebInfo
- name: "Package Project"
run: |
cmake -H. -B"build/temp" --config RelWithDebInfo --target PACKAGE_7Z
cmake -H. -B"build/temp" --config RelWithDebInfo --target PACKAGE_ZIP
- name: "Package Installer (Prereqs)" - name: "Package Installer (Prereqs)"
run: | run: |
curl "-kL" "https://cdn.xaymar.com/ci/innosetup-6.0.3.exe" "-f" "--retry" "5" "-o" "inno.exe" curl "-kL" "https://cdn.xaymar.com/ci/innosetup-6.0.3.exe" "-f" "--retry" "5" "-o" "inno.exe"

View file

@ -1,93 +0,0 @@
"use strict";
const process = require('process');
const runner = require('./runner.js');
let env = process.env;
let x32_steps = [];
let x64_steps = [];
if ((process.platform == "win32") || (process.platform == "win64")) {
// Windows
let extra_conf = [
`-DCMAKE_SYSTEM_VERSION=${process.env.CMAKE_SYSTEM_VERSION}`,
`-DCMAKE_PACKAGE_NAME=StreamFX`,
'-DCMAKE_INSTALL_PREFIX="build/distrib"',
'-DCMAKE_PACKAGE_PREFIX="build/package"',
'-DOBS_DOWNLOAD=true',
];
let extra_build = [
];
if(process.env.APPVEYOR) {
extra_build.concat(['--', '/logger:"C:\\Program Files\\AppVeyor\\BuildAgent\\Appveyor.MSBuildLogger.dll"']);
}
if ((process.env.CMAKE_GENERATOR_32 !== undefined) && (process.env.CMAKE_GENERATOR_32 !== "")) {
x32_steps.push(
[ 'cmake', [
'-H.', '-Bbuild/32',
`-G"${process.env.CMAKE_GENERATOR_32}"`, '-AWin32', '-T"host=x64"',
].concat(extra_conf), env ]
);
x32_steps.push(
[ 'cmake', [
'--build', 'build/32',
'--config', 'RelWithDebInfo',
'--target', 'INSTALL'
].concat(extra_build), env ]
);
}
if ((process.env.CMAKE_GENERATOR_64 !== undefined) && (process.env.CMAKE_GENERATOR_64 !== "")) {
x64_steps.push(
[ 'cmake', [
'-H.', '-Bbuild/64',
`-G"${process.env.CMAKE_GENERATOR_64}"`, '-Ax64', '-T"host=x64"',
].concat(extra_conf), env ]
);
x64_steps.push(
[ 'cmake', [
'--build', 'build/64',
'--config', 'RelWithDebInfo',
'--target', 'INSTALL'
].concat(extra_build), env ]
);
}
} else {
// Unix
}
function runRunners(runnerArray, name) {
return new Promise(async (resolve, reject) => {
let local = runnerArray.reverse();
while (local.length > 0) {
try {
let task = local.pop();
let work = new runner(name, task[0], task[1], task[2]);
await work.run();
} catch (e) {
reject(e);
return;
}
}
resolve(0);
});
}
let promises = [];
promises.push(runRunners(x32_steps, "32-Bit"));
promises.push(runRunners(x64_steps, "64-Bit"));
Promise.all(promises).then(
res => {
process.exit(0);
},
err => {
console.log(err);
process.exit(1);
}
).catch(err => {
console.log(err);
process.exit(1);
})

View file

@ -1,69 +0,0 @@
"use strict";
const process = require('process');
const runner = require('./runner.js');
let env = process.env;
let steps = [];
if ((process.env.CMAKE_GENERATOR_64 !== undefined) && (process.env.CMAKE_GENERATOR_64 !== "")) {
steps.push(
[ 'cmake', [
'--build', 'build/64',
'--config', 'RelWithDebInfo',
'--target', 'PACKAGE_7Z'
], env ]
);
steps.push(
[ 'cmake', [
'--build', 'build/64',
'--config', 'RelWithDebInfo',
'--target', 'PACKAGE_ZIP'
], env ]
);
} else if ((process.env.CMAKE_GENERATOR_32 !== undefined) && (process.env.CMAKE_GENERATOR_32 !== "")) {
steps.push(
[ 'cmake', [
'--build', 'build/32',
'--config', 'RelWithDebInfo',
'--target', 'PACKAGE_7Z'
], env ]
);
steps.push(
[ 'cmake', [
'--build', 'build/32',
'--config', 'RelWithDebInfo',
'--target', 'PACKAGE_ZIP'
], env ]
);
}
function runRunners(runnerArray, name) {
return new Promise(async (resolve, reject) => {
let local = runnerArray.reverse();
while (local.length > 0) {
try {
let task = local.pop();
let work = new runner(name, task[0], task[1], task[2]);
await work.run();
} catch (e) {
reject(e);
return;
}
}
resolve(0);
});
}
let promises = [];
promises.push(runRunners(steps, "32-Bit"));
Promise.all(promises).then(
res => {
process.exit(0);
},
err => {
console.log(err);
process.exit(1);
}
)

View file

@ -1,50 +0,0 @@
"use strict";
const process = require('process');
const cp = require('child_process');
class Runner {
constructor(name, cmd, args, env) {
this.name = name;
this.cmd = cmd;
if (args == undefined)
args = [];
this.args = args;
if (env == undefined)
env = process.env;
this.env = env;
}
run() {
let self = this;
return new Promise(function(resolve, reject) {
self.proc = cp.spawn(
self.cmd, self.args, {
windowsVerbatimArguments: true,
windowsHide: true,
env: self.env,
}
);
self.proc.stdout.on('data', (data) => {
process.stdout.write(`[${self.name}:Out] ${data}`);
});
self.proc.stderr.on('data', (data) => {
process.stderr.write(`[${self.name}:Err] ${data}`);
});
self.proc.on('exit', (code, signal) => {
if (code != 0) {
reject(code);
return;
}
resolve(code);
return;
});
});
}
execute() {
return this.run();
}
}
module.exports = Runner;

View file

@ -63,7 +63,7 @@ enum class keyframe_type { SECONDS, FRAMES };
std::shared_ptr<ffmpeg_manager> encoder::ffmpeg::ffmpeg_manager::_instance; std::shared_ptr<ffmpeg_manager> encoder::ffmpeg::ffmpeg_manager::_instance;
ffmpeg_manager::ffmpeg_manager() ffmpeg_manager::ffmpeg_manager() : _factories(), _handlers(), _debug_handler()
{ {
// Handlers // Handlers
_debug_handler = ::std::make_shared<handler::debug_handler>(); _debug_handler = ::std::make_shared<handler::debug_handler>();
@ -71,6 +71,8 @@ ffmpeg_manager::ffmpeg_manager()
register_handler("h264_nvenc", ::std::make_shared<handler::nvenc_h264_handler>()); register_handler("h264_nvenc", ::std::make_shared<handler::nvenc_h264_handler>());
register_handler("hevc_nvenc", ::std::make_shared<handler::nvenc_hevc_handler>()); register_handler("hevc_nvenc", ::std::make_shared<handler::nvenc_hevc_handler>());
// Encoders
/*
void* iterator = nullptr; void* iterator = nullptr;
const AVCodec* codec = nullptr; const AVCodec* codec = nullptr;
for (codec = av_codec_iterate(&iterator); codec != nullptr; codec = av_codec_iterate(&iterator)) { for (codec = av_codec_iterate(&iterator); codec != nullptr; codec = av_codec_iterate(&iterator)) {
@ -85,6 +87,7 @@ ffmpeg_manager::ffmpeg_manager()
} }
} }
} }
*/
} }
ffmpeg_manager::~ffmpeg_manager() ffmpeg_manager::~ffmpeg_manager()
@ -92,9 +95,12 @@ ffmpeg_manager::~ffmpeg_manager()
_factories.clear(); _factories.clear();
} }
void ffmpeg_manager::register_handler(std::string const codec, std::shared_ptr<handler::handler> const handler) {} void ffmpeg_manager::register_handler(std::string codec, std::shared_ptr<handler::handler> handler)
{
_handlers.try_emplace(codec, handler);
}
std::shared_ptr<handler::handler> const ffmpeg_manager::get_handler(std::string const codec) std::shared_ptr<handler::handler> ffmpeg_manager::get_handler(std::string codec)
{ {
auto fnd = _handlers.find(codec); auto fnd = _handlers.find(codec);
if (fnd != _handlers.end()) if (fnd != _handlers.end())
@ -106,7 +112,7 @@ std::shared_ptr<handler::handler> const ffmpeg_manager::get_handler(std::string
#endif #endif
} }
bool ffmpeg_manager::has_handler(std::string const codec) bool ffmpeg_manager::has_handler(std::string codec)
{ {
return (_handlers.find(codec) != _handlers.end()); return (_handlers.find(codec) != _handlers.end());
} }

View file

@ -99,11 +99,11 @@ namespace encoder::ffmpeg {
ffmpeg_manager(); ffmpeg_manager();
~ffmpeg_manager(); ~ffmpeg_manager();
void register_handler(std::string const codec, std::shared_ptr<handler::handler> const handler); void register_handler(std::string codec, std::shared_ptr<handler::handler> handler);
std::shared_ptr<handler::handler> const get_handler(std::string const codec); std::shared_ptr<handler::handler> get_handler(std::string codec);
bool has_handler(std::string const codec); bool has_handler(std::string codec);
}; };
struct ffmpeg_info { struct ffmpeg_info {