This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 2.12 KB
/
alpine.yml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Build Alpine Binaries
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
cpggen-Alpine-Build:
runs-on: ubuntu-latest
container: python:3.10-alpine
steps:
- uses: actions/checkout@v3
- name: Install packages
run: |
apk update
apk add py3-pip python3-dev curl wget jq tree cmake make gcc git g++ musl-dev libffi-dev openssl-dev py3-cffi py3-twine py3-wheel py3-setuptools ca-certificates zlib-dev xz nodejs npm bash tar gcompat
- name: Checkout cpggen
uses: actions/checkout@v3
with:
repository: AppThreat/cpggen
path: cpggen
- name: Checkout cdxgen
uses: actions/checkout@v3
with:
repository: CycloneDX/cdxgen
path: cdxgen
- name: Install pyinstaller
run: |
python3 -m pip install setuptools pyinstaller poetry
cd cpggen
poetry config virtualenvs.create false
poetry install --no-cache --without dev
- name: Produce cdxgen pkg
run: |
npm install -g pkg
cd cdxgen
npm install
npx caxa --input . --output "cdxgen" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/bin/cdxgen.js"
chmod +x cdxgen
./cdxgen --version
sha256sum cdxgen > cdxgen.sha256
- name: Binary alpine build
run: |
cd cpggen
curl -LO https://github.com/appthreat/atom/releases/latest/download/atom.zip
pyinstaller cpggen/cli.py --noconfirm --log-level=WARN --nowindow --onefile --name atomgen-musl --add-binary="atom.zip:local_bin" --add-binary="../cdxgen/cdxgen:local_bin" --collect-submodules cpggen --noupx
sha256sum ./dist/atomgen-musl > ./dist/atomgen-musl.sha256
./dist/atomgen-musl --help
./dist/atomgen-musl -i . -o /tmp/cpggen.json
- uses: actions/upload-artifact@v1
if: startsWith(github.ref, 'refs/tags/') != true
with:
path: ./cpggen/dist
name: atomgen-musl
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
cpggen/dist/atomgen-musl
cpggen/dist/atomgen-musl.sha256