5
5
workflow_dispatch :
6
6
7
7
jobs :
8
- Depscan-GNU -Build :
8
+ Depscan-Linux -Build :
9
9
runs-on : ubuntu-latest
10
10
steps :
11
11
- uses : actions/checkout@v3
12
- - name : Checkout tools repo
12
+ - name : Checkout dep-scan
13
13
uses : actions/checkout@v3
14
14
with :
15
15
repository : AppThreat/dep-scan
16
16
path : dep-scan
17
+ - name : Checkout cdxgen
18
+ uses : actions/checkout@v3
19
+ with :
20
+ repository : AppThreat/cdxgen
21
+ path : cdxgen
22
+ - name : Checkout cdxgen
23
+ uses : actions/checkout@v3
24
+ with :
25
+ repository : ngcloudsec/cdxgen-plugins-bin
26
+ path : cdxgen-plugins-bin
17
27
- uses : actions/setup-python@v4
18
28
with :
19
29
python-version : ' 3.10'
30
+ - name : Use Node.js
31
+ uses : actions/setup-node@v3
32
+ with :
33
+ node-version : 18.x
34
+ - uses : actions/setup-go@v3
35
+ with :
36
+ go-version : ' ^1.19.1'
37
+ - uses : actions/cache@v3
38
+ with :
39
+ path : |
40
+ ~/.cache/go-build
41
+ ~/go/pkg/mod
42
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
43
+ restore-keys : |
44
+ ${{ runner.os }}-go-
20
45
- name : Install pyinstaller
21
46
run : |
22
47
python3 -m pip install twine setuptools wheel pyinstaller
@@ -26,22 +51,41 @@ jobs:
26
51
tar -xvf upx-4.0.0-amd64_linux.tar.xz
27
52
chmod +x upx-4.0.0-amd64_linux/upx
28
53
sudo cp upx-4.0.0-amd64_linux/upx /usr/local/bin/
29
- - name : Binary gnu build
54
+ - name : Produce cdxgen pkg
55
+ run : |
56
+ sudo npm install -g pkg
57
+ cd cdxgen
58
+ npm install
59
+ pkg -t node18-linux package.json --out-path dist
60
+ chmod +x dist/cdxgen
61
+ ./dist/cdxgen --version
62
+ - name : Build cdxgen plugins
63
+ run : |
64
+ cd cdxgen-plugins-bin
65
+ bash build.sh
66
+ - name : Binary amd64 build
30
67
run : |
31
68
cd dep-scan
32
- pyinstaller depscan/cli.py --noconfirm --log-level=WARN --nowindow --onefile --name depscan --collect-all depscan --upx-dir /usr/local/bin
33
- ./dist/depscan --help
34
- ./dist/depscan -i . -o /tmp/depscan.json
69
+ pyinstaller depscan/cli.py --noconfirm --log-level=WARN --nowindow --onefile --name depscan-linux-amd64 --add-data="vendor:vendor" --add-binary="../cdxgen/dist/cdxgen:local_bin" --add-binary="../cdxgen-plugins-bin/plugins/osquery/osqueryi-linux-amd64:local_bin/osquery" --add-binary="../cdxgen-plugins-bin/plugins/goversion/goversion-linux-amd64:local_bin/goversion" --add-binary="../cdxgen-plugins-bin/plugins/trivy/trivy-cdxgen-linux-amd64:local_bin/trivy" --add-binary="../cdxgen-plugins-bin/plugins/cargo-auditable/cargo-auditable-cdxgen-linux-amd64:local_bin/cargo-auditable" --collect-submodules depscan --upx-dir /usr/local/bin
70
+ sha256sum ./dist/depscan-linux-amd64 > ./dist/depscan-linux-amd64.sha256
71
+ ./dist/depscan-linux-amd64 --help
72
+ ./dist/depscan-linux-amd64 -i . -o /tmp/depscan.json
73
+ - name : BLint
74
+ run : |
75
+ pip3 install blint
76
+ blint -i dist -o /tmp/reports
35
77
env :
36
78
PYTHONIOENCODING : utf-8
37
79
LANG : en_US.utf-8
38
80
- uses : actions/upload-artifact@v1
81
+ if : startsWith(github.ref, 'refs/tags/') != true
39
82
with :
40
83
path : ./dep-scan/dist
41
- name : depscan-linux-gnu
84
+ name : depscan-linux-amd64
42
85
- name : Release
43
86
uses : softprops/action-gh-release@v1
44
87
if : startsWith(github.ref, 'refs/tags/')
45
88
with :
46
89
files : |
47
- dep-scan/dist/depscan
90
+ dep-scan/dist/depscan-linux-amd64
91
+ dep-scan/dist/depscan-linux-amd64.sha256
0 commit comments