Skip to content
This repository was archived by the owner on Sep 27, 2024. It is now read-only.

Commit d914b37

Browse files
committed
Enable mac build
1 parent 991bef6 commit d914b37

File tree

3 files changed

+47
-43
lines changed

3 files changed

+47
-43
lines changed

.github/workflows/build.yaml

+45-41
Original file line numberDiff line numberDiff line change
@@ -41,47 +41,51 @@ jobs:
4141
make -j4
4242
popd
4343
44-
# Disabled
45-
# build-macos:
46-
# name: Build on MacOS X Latest
47-
# runs-on: macos-latest
48-
# steps:
49-
# - uses: actions/checkout@v2
50-
# - name: Install Deps
51-
# run: |
52-
# brew install jq
53-
# brew install qt5
54-
# brew install asciidoc
55-
# brew install pkg-config
56-
# brew install doxygen
57-
# brew install opendbx
58-
# brew install popt
59-
# brew install swig
60-
# brew install upx
61-
# brew install libxmlsec1
62-
# npm install -g appdmg
63-
# echo "/usr/local/opt/qt/bin" >> $GITHUB_PATH
64-
# echo "Qt5_DIR=/usr/local/opt/qt5/lib/cmake/Qt5" >> $GITHUB_ENV
65-
# - name: Build OpenSCAP
66-
# run: |
67-
# git clone --depth 1 https://github.com/openscap/openscap.git
68-
# pushd openscap/build
69-
# cmake -DENABLE_PROBES=FALSE ../
70-
# make -j4
71-
# make install
72-
# popd
73-
# Broken
74-
# - name: Build OSX Image
75-
# run: |
76-
# chmod +x ./build-for-osx.sh
77-
# ./build-for-osx.sh
78-
# REL_TAG=`curl -s "https://github.com/ComplianceAsCode/content/releases/latest" | grep -o 'tag/[v.0-9]*' | awk -F/ '{print $2}'`
79-
# REL_TAG_NUM=`echo ${REL_TAG} | cut -d"v" -f2`
80-
# DWN_LINK=https://github.com/ComplianceAsCode/content/releases/download/${REL_TAG}/scap-security-guide-${REL_TAG_NUM}.zip
81-
# if [ -z "${DWN_LINK}" ]; then echo 'Could not get the ZIP URL! It is empty!'; exit 1; fi
82-
# wget "${DWN_LINK}" -O ssg.zip
83-
# 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/
84-
# cd build-osx && bash osx-create-dmg.sh
44+
build-macos:
45+
name: Build on MacOS X Latest
46+
runs-on: macos-latest
47+
steps:
48+
- uses: actions/checkout@v2
49+
- name: Install Deps
50+
run: |
51+
brew install jq
52+
brew install qt5
53+
brew install asciidoc
54+
brew install pkg-config
55+
brew install doxygen
56+
brew install opendbx
57+
brew install popt
58+
brew install swig
59+
brew install upx
60+
brew install libxmlsec1
61+
npm install -g appdmg
62+
echo "/usr/local/opt/qt/bin" >> $GITHUB_PATH
63+
echo "Qt5_DIR=/usr/local/opt/qt5/lib/cmake/Qt5" >> $GITHUB_ENV
64+
- name: Build OpenSCAP
65+
run: |
66+
git clone --depth 1 https://github.com/openscap/openscap.git
67+
pushd openscap/build
68+
cmake -DENABLE_PROBES=FALSE ../
69+
make -j4
70+
make install
71+
popd
72+
- name: Build OSX Image
73+
run: |
74+
chmod +x ./build-for-osx.sh
75+
./build-for-osx.sh
76+
REL_TAG=`curl -s "https://github.com/ComplianceAsCode/content/releases/latest" | grep -o 'tag/[v.0-9]*' | awk -F/ '{print $2}'`
77+
REL_TAG_NUM=`echo ${REL_TAG} | cut -d"v" -f2`
78+
DWN_LINK=https://github.com/ComplianceAsCode/content/releases/download/v0.1.63/scap-security-guide-0.1.63.zip
79+
if [ -z "${DWN_LINK}" ]; then echo 'Could not get the ZIP URL! It is empty!'; exit 1; fi
80+
wget "${DWN_LINK}" -O ssg.zip
81+
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/
82+
cd build-osx && bash osx-create-dmg.sh
83+
- name: Upload OSX Image
84+
uses: actions/upload-artifact@v2
85+
with:
86+
name: scap-workbench-1.2.1.dmg
87+
path: build-osx/scap-workbench-1.2.1.dmg
88+
8589
# We don't do automatic releases, do we?
8690
# - name: Release
8791
# uses: softprops/action-gh-release@v1

build-for-osx.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ set -ex
22

33
mkdir -p build-osx/
44
pushd build-osx/
5-
cmake -D SCAP_WORKBENCH_LOCAL_SCAN_ENABLED=false -D SCAP_AS_RPM_EXECUTABLE="" ../
5+
cmake -D SCAP_WORKBENCH_LOCAL_SCAN_ENABLED=false -D SCAP_AS_RPM_EXECUTABLE="" -DCMAKE_PREFIX_PATH="/usr/local/opt/qt5/lib/cmake/" ../
66
make -j 4
77
mkdir -p ./scap-workbench.app/Contents/Frameworks/
88
cp /usr/local/lib/libpcre.1.dylib ./scap-workbench.app/Contents/Frameworks/

osx-create-dmg.sh.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ DMG_BACKGROUND_IMG="@CMAKE_SOURCE_DIR@/osx-dmg-background.png"
1515
APP_EXE="@CMAKE_BINARY_DIR@/${APP_NAME}.app/Contents/MacOS/${APP_NAME}"
1616

1717
# make sure Qt frameworks are included
18-
macdeployqt @CMAKE_BINARY_DIR@/${APP_NAME}.app
18+
/usr/local/opt/qt5/bin/macdeployqt @CMAKE_BINARY_DIR@/${APP_NAME}.app
1919

2020
VOL_NAME="${APP_NAME}-${VERSION}" # volume name will be "SuperCoolApp-1.0.0"
2121
DMG_TMP="${VOL_NAME}-temp.dmg"

0 commit comments

Comments
 (0)