Skip to content

Commit 28bea22

Browse files
feat: build for release
1 parent 55fcdfa commit 28bea22

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ author: kamiazya <[email protected]>
44
branding:
55
icon: arrow-down-circle
66
color: gray-dark
7+
inputs:
8+
ubuntu-graphviz-version:
9+
description: |-
10+
Graphviz version on Ubuntu.
11+
required: false
12+
ubuntu-libgraphvizdev-version:
13+
description: |-
14+
libgraphviz-dev version on Ubuntu.
15+
required: false
16+
macos-graphviz-version:
17+
description: |-
18+
Graphviz version on macOS.
19+
required: false
20+
windows-graphviz-version:
21+
description: |-
22+
Graphviz version on Windows.
23+
required: false
24+
725
runs:
826
using: node16
927
main: lib/main.js

lib/GraphvizInstaller.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
33
exports.GraphvizInstaller = void 0;
4+
const core_1 = require("@actions/core");
45
const exec_1 = require("@actions/exec");
56
class GraphvizInstaller {
67
async get() {
@@ -22,22 +23,33 @@ class GraphvizInstaller {
2223
}
2324
}
2425
async brewInstall() {
26+
const graphvizVersion = (0, core_1.getInput)('macos-graphviz-version');
2527
await (0, exec_1.exec)('brew', ['update']);
26-
await (0, exec_1.exec)('brew', ['install', 'graphviz']);
28+
await (0, exec_1.exec)('brew', [
29+
'install',
30+
graphvizVersion ? `graphviz@${graphvizVersion}` : 'graphviz',
31+
]);
2732
}
2833
async getAptInstall() {
34+
const graphvizVersion = (0, core_1.getInput)('ubuntu-graphviz-version');
35+
const libgraphvizdevVersion = (0, core_1.getInput)('ubuntu-libgraphvizdev-version');
2936
await (0, exec_1.exec)('sudo', ['apt-get', 'update']);
3037
await (0, exec_1.exec)('sudo', [
3138
'apt-get',
3239
'install',
33-
'graphviz',
40+
graphvizVersion ? `graphviz=${graphvizVersion}` : 'graphviz',
3441
// https://github.com/pygraphviz/pygraphviz/issues/163#issuecomment-570770201
35-
'libgraphviz-dev',
42+
libgraphvizdevVersion ? `libgraphviz-dev=${libgraphvizdevVersion}` : 'libgraphviz-dev',
3643
'pkg-config',
3744
]);
3845
}
3946
async chocoInstall() {
40-
await (0, exec_1.exec)('choco', ['install', 'graphviz']);
47+
const graphvizVersion = (0, core_1.getInput)('window-graphviz-version');
48+
await (0, exec_1.exec)('choco', [
49+
'install',
50+
'graphviz',
51+
...(graphvizVersion ? [`--version=${graphvizVersion}`] : [])
52+
]);
4153
}
4254
}
4355
exports.GraphvizInstaller = GraphvizInstaller;

0 commit comments

Comments
 (0)