-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.js
More file actions
31 lines (25 loc) · 746 Bytes
/
index.js
File metadata and controls
31 lines (25 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const os = require('os');
const core = require('@actions/core');
const {exec} = require('@actions/exec');
const Install = {
linux: async function() {
try {
core.debug("Adding repositories...");
await exec('sudo', ['apt-add-repository', '-y', 'ppa:ubuntu-toolchain-r/test']);
core.debug("Fetching packages...");
await exec('sudo', ['apt-get', '-yq', '--no-install-suggests', '--no-install-recommends', 'install', 'clang', 'libc++-dev', 'libc++abi-dev', 'nasm']);
} catch (error) {
core.setFailed(error.message);
}
}
};
async function main() {
let platform = os.platform();
let install = Install[platform];
if (install) {
await install();
} else {
core.debug(`Nothing to do for ${platform}!`);
}
}
main();