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

Enable mac build #302

Open
wants to merge 4 commits into
base: v1-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 49 additions & 43 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
popd

build-fedora:
name: Build on Fedora 33 (Container)
name: Build on Fedora Latest (Container)
runs-on: ubuntu-latest
container:
image: fedora:33
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
Expand All @@ -41,47 +41,53 @@ 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
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: |
REPOSITORY="ComplianceAsCode/content"
chmod +x ./build-for-osx.sh
./build-for-osx.sh
REL_TAG=`wget -q -O- https://api.github.com/repos/${REPOSITORY}/releases/latest | jq -r '.tag_name'`
REL_TAG_NUM=`echo ${REL_TAG} | cut -d"v" -f2`
DWN_LINK="https://github.com/${REPOSITORY}/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
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
Loading