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

Commit

Permalink
Update MAC build.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggbecker committed Feb 20, 2023
1 parent 991bef6 commit a1f50a8
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 43 deletions.
86 changes: 45 additions & 41 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,47 +41,51 @@ jobs:
make -j4
popd
# Disabled
# 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
# 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
# Broken
# - name: Build OSX Image
# run: |
# chmod +x ./build-for-osx.sh
# ./build-for-osx.sh
# REL_TAG=`curl -s "https://github.com/ComplianceAsCode/content/releases/latest" | grep -o 'tag/[v.0-9]*' | awk -F/ '{print $2}'`
# 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
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
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=`curl -s "https://github.com/ComplianceAsCode/content/releases/latest" | grep -o 'tag/[v.0-9]*' | awk -F/ '{print $2}'`
REL_TAG_NUM=`echo ${REL_TAG} | cut -d"v" -f2`
DWN_LINK=https://github.com/ComplianceAsCode/content/releases/download/v0.1.63/scap-security-guide-0.1.63.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
Expand Down
2 changes: 1 addition & 1 deletion build-for-osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set -ex

mkdir -p build-osx/
pushd build-osx/
cmake -D SCAP_WORKBENCH_LOCAL_SCAN_ENABLED=false -D SCAP_AS_RPM_EXECUTABLE="" ../
cmake -D SCAP_WORKBENCH_LOCAL_SCAN_ENABLED=false -D SCAP_AS_RPM_EXECUTABLE="" -DCMAKE_PREFIX_PATH="/usr/local/opt/qt5/lib/cmake/" ../
make -j 4
mkdir -p ./scap-workbench.app/Contents/Frameworks/
cp /usr/local/lib/libpcre.1.dylib ./scap-workbench.app/Contents/Frameworks/
Expand Down
2 changes: 1 addition & 1 deletion osx-create-dmg.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DMG_BACKGROUND_IMG="@CMAKE_SOURCE_DIR@/osx-dmg-background.png"
APP_EXE="@CMAKE_BINARY_DIR@/${APP_NAME}.app/Contents/MacOS/${APP_NAME}"

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

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

0 comments on commit a1f50a8

Please sign in to comment.