This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
97 lines (94 loc) · 3.14 KB
/
build.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Gating
on:
push:
branches: [ '*' ]
pull_request:
branches: [ master, v1-2 ]
jobs:
build-ubuntu:
name: Build on Ubuntu Latest
runs-on: ubuntu-latest
steps:
- name: Install Deps
uses: mstksg/get-package@master
with:
apt-get: build-essential openssh-client libopenscap-dev libqt5xmlpatterns5-dev ssh-askpass asciidoc libpolkit-agent-1-0
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: |
mkdir -p build
pushd build
cmake ..
make -j4
popd
build-fedora:
name: Build on Fedora Latest (Container)
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Install Deps
run: dnf install -y cmake gcc-c++ openssh-clients util-linux openscap-devel qt5-qtbase-devel qt5-qtxmlpatterns-devel openssh-askpass asciidoc polkit-libs
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: |
mkdir -p build
pushd build
cmake ..
make -j4
popd
build-macos:
name: Build on MacOS X Latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Deps
run: |
brew install jq
brew install qt5
brew install asciidoc
brew install pkg-config
brew install doxygen
brew install opendbx
brew install popt
brew install swig
brew install upx
brew install libxmlsec1
brew install pcre
npm install -g appdmg
echo "/usr/local/opt/qt/bin" >> $GITHUB_PATH
echo "Qt5_DIR=/usr/local/opt/qt5/lib/cmake/Qt5" >> $GITHUB_ENV
- name: Build OpenSCAP
run: |
git clone --depth 1 https://github.com/openscap/openscap.git
pushd openscap/build
cmake -DENABLE_PROBES=FALSE ../
make -j4
make install
popd
- name: Build OSX Image
run: |
chmod +x ./build-for-osx.sh
./build-for-osx.sh
REL_TAG=`wget -q -O- https://api.github.com/repos/ComplianceAsCode/content/releases/latest | jq -r '.tag_name'`
REL_TAG_NUM=`echo ${REL_TAG} | cut -d"v" -f2`
DWN_LINK="https://github.com/ComplianceAsCode/content/releases/download/${REL_TAG}/scap-security-guide-${REL_TAG_NUM}.zip"
if [ -z "${DWN_LINK}" ]; then echo 'Could not get the ZIP URL! It is empty!'; exit 1; fi
wget "${DWN_LINK}" -O ssg.zip
mkdir -p `pwd`/build-osx/scap-workbench.app/Contents/Resources/ssg/ && unzip ssg.zip && cp -a scap-security-guide-*/* `pwd`/build-osx/scap-workbench.app/Contents/Resources/ssg/
cd build-osx && bash osx-create-dmg.sh
- name: Upload OSX Image
uses: actions/upload-artifact@v2
with:
name: scap-workbench-1.2.1.dmg
path: build-osx/scap-workbench-1.2.1.dmg
# We don't do automatic releases, do we?
# - name: Release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: build-osx/scap-workbench-${{ steps.get_version.outputs.VERSION }}.dmg
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}