-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Spitz <noella.spitz@ndw2544mac.isis.cclrc.ac.uk> Co-authored-by: Adam Washington <adam.washington@stfc.ac.uk> Co-authored-by: Tristan Youngs <tristan.youngs@stfc.ac.uk>
- Loading branch information
1 parent
4e67ebe
commit 3add928
Showing
12 changed files
with
353 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
name: Build | ||
description: Build on OSX | ||
|
||
inputs: | ||
threading: | ||
default: true | ||
antlrVersion: | ||
default: "4.13.1" | ||
ftglVersion: | ||
default: "2.1.3-rc5" | ||
extraCMakeFlags: | ||
default: "" | ||
cacheOnly: | ||
type: boolean | ||
default: false | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
# | ||
# Setup / Install Dependencies | ||
# | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.pythonVersion }} | ||
|
||
- name: Install Homebrew Dependencies | ||
if: ${{ inputs.cacheOnly }} | ||
shell: bash | ||
run: | | ||
set -ex | ||
brew update-reset | ||
brew install ninja | ||
PACKAGES=(libpng freetype ftgl antlr) | ||
for PACKAGE in "${PACKAGES[@]}" | ||
do | ||
brew fetch --force --bottle-tag=arm64_monterey $PACKAGE | ||
brew install $(brew --cache --bottle-tag=arm64_monterey $PACKAGE) | ||
done | ||
- name: Install Python Dependencies | ||
shell: bash | ||
run: | | ||
pip3 install --user aqtinstall conan==1.58.0 | ||
- name: Retrieve Qt Cache | ||
id: cache-qt | ||
uses: actions/cache@v3 | ||
with: | ||
key: osx-qt-${{ env.qtVersion }} | ||
path: ${{ runner.temp }}/qt | ||
|
||
- name: Install Qt | ||
if: ${{ steps.cache-qt.outputs.cache-hit != 'true' }} | ||
shell: bash | ||
run: | | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
aqt install-qt --outputdir ${{ runner.temp }}/qt mac desktop ${{ env.qtVersion }} | ||
# | ||
# Main Build | ||
# | ||
|
||
- name: Install Conan Dependencies | ||
shell: bash | ||
run: | | ||
set -ex | ||
# Setup paths | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
mkdir build && cd build | ||
conan config set storage.download_cache="${GITHUB_WORKSPACE}/.conancache" | ||
conan install .. --build missing -s arch=armv8 | ||
- name: Build | ||
if: ${{ inputs.cacheOnly == 'false' }} | ||
shell: bash | ||
run: | | ||
set -ex | ||
# Setup paths | ||
# Must specify correct arm64 libs | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
Qt6_DIR=${{ runner.temp }}/qt/${{ env.qtVersion }}/macos/lib/cmake/Qt6 | ||
QT_BASE_DIR=${{ runner.temp }}/qt/${{ env.qtVersion }}/macos | ||
ANTLR_EXE=$(brew --prefix antlr)/antlr-${{ inputs.antlrVersion }}-complete.jar | ||
FTGL_INCLUDE_DIRS=$(brew --prefix ftgl)/include/ | ||
FTGL_LIBRARIES=$(brew --prefix ftgl)/lib/libftgl.2.dylib | ||
CMAKE_PARAMS=( | ||
-DGUI:bool=true | ||
-DMULTI_THREADING:bool=${{ inputs.threading }} | ||
-DJava_JAVA_EXECUTABLE:path=$JAVA_HOME_21_X64/bin/java | ||
-DANTLR_EXECUTABLE:string=$ANTLR_EXE | ||
-DFTGL_INCLUDE_DIRS:path=$FTGL_INCLUDE_DIRS | ||
-DFTGL_LIBRARIES:path=$FTGL_LIBRARIES | ||
-DCMAKE_OSX_ARCHITECTURES:string="arm64" | ||
-DQT_BASE_DIR=$QT_BASE_DIR | ||
) | ||
echo "Detected ANTLR exe as [$ANTLR_EXE]" | ||
echo "JAVA HOME: $JAVA_HOME_21_X64" | ||
# Build | ||
cd build | ||
cmake -G Ninja "${CMAKE_PARAMS[@]}" ${{ inputs.extraCMakeFlags }} ../ | ||
cmake --build . --config Release | ||
cd ../ | ||
# Deploy Conan dependencies for ease | ||
mkdir deploy && cd deploy | ||
conan install .. -g deploy -s arch=armv8 | ||
# Copy over ftgl so it can be shipped with the bundle | ||
mkdir ftgl | ||
cp $(brew --prefix ftgl)/lib/libftgl.2.dylib ftgl | ||
cp $(brew --prefix ftgl)/lib/libftgl.2.1.3.dylib ftgl | ||
- name: Upload Raw Build Artifacts | ||
if: ${{ inputs.cacheOnly == 'false' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: osx-build-artifacts-silicon | ||
path: | | ||
${{ github.workspace }}/build | ||
${{ github.workspace }}/deploy | ||
retention-days: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Package | ||
description: Package OSX artifacts | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.pythonVersion }} | ||
|
||
- name: Retrieve Qt Cache | ||
uses: actions/cache@v3 | ||
with: | ||
key: osx-qt-${{ env.qtVersion }} | ||
path: ${{ runner.temp }}/qt | ||
|
||
- name: Download Raw Build Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: osx-build-artifacts | ||
path: ${{ github.workspace }} | ||
|
||
- name: Install Python Dependencies | ||
shell: bash | ||
run: | | ||
pip3 install --user dmgbuild biplist | ||
- name: Install Custom Dependencies | ||
shell: bash | ||
run: | | ||
set -ex | ||
wget https://raw.githubusercontent.com/disorderedmaterials/scripts/master/prep-dmg | ||
chmod u+x ./prep-dmg | ||
- name: Prepare DMG Dirs | ||
shell: bash | ||
run: | | ||
set -ex | ||
Qt6_ROOT=${{ runner.temp }}/qt/${{ env.qtVersion }}/macos/ | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
# Handle ANTLR & TBB | ||
cp ./deploy/antlr4-cppruntime/lib/libantlr4-runtime.*.dylib /usr/local/lib | ||
cp ./deploy/antlr4-cppruntime/lib/libantlr4-runtime.dylib /usr/local/lib/libantlr4-runtime.dylib | ||
for FILE in ./deploy/onetbb/lib/*.dylib; do | ||
FILENAME=$(basename $FILE) | ||
cp ./deploy/onetbb/lib/$FILENAME /usr/local/lib/$FILENAME | ||
done | ||
install_name_tool -add_rpath "@executable_path/../Frameworks/" build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui | ||
install_name_tool -add_rpath "/usr/local/lib" build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui | ||
./prep-dmg -a Dissolve-GUI -v ${{ env.dissolveVersion }} -b build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui -d ${Qt6_ROOT} -i icon/icon-1024x1024.png -p build/bin/dissolve-gui.app/Contents/Info.plist -L /usr/local/lib | ||
- name: Create Disk Image | ||
shell: bash | ||
run: | | ||
set -ex | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
# Fix icon link | ||
sed -i -e "s/Dissolve.icns/Dissolve-GUI.icns/g" Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Info.plist | ||
# Create DMG | ||
dmgbuild -s ci/osx/dmgbuild-settings.py -D app=./Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app -D icon=./Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Resources/Dissolve-GUI.icns "Dissolve GUI" Dissolve-GUI-${dissolveVersion}.dmg | ||
# Collect artifacts | ||
mkdir packages | ||
mv Dissolve-GUI-${dissolveVersion}.dmg packages/ | ||
- name: Upload Package Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: packages | ||
path: ${{ github.workspace }}/packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Package | ||
description: Package OSX artifacts | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.pythonVersion }} | ||
|
||
- name: Retrieve Qt Cache | ||
uses: actions/cache@v3 | ||
with: | ||
key: osx-qt-${{ env.qtVersion }} | ||
path: ${{ runner.temp }}/qt | ||
|
||
- name: Download Raw Build Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: osx-build-artifacts-silicon | ||
path: ${{ github.workspace }} | ||
|
||
- name: Install Python Dependencies | ||
shell: bash | ||
run: | | ||
pip3 install --user dmgbuild biplist | ||
- name: Install Custom Dependencies | ||
shell: bash | ||
run: | | ||
set -ex | ||
wget https://raw.githubusercontent.com/disorderedmaterials/scripts/master/prep-dmg | ||
chmod u+x ./prep-dmg | ||
- name: Prepare DMG Dirs | ||
shell: bash | ||
run: | | ||
set -ex | ||
Qt6_ROOT=${{ runner.temp }}/qt/${{ env.qtVersion }}/macos/ | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
install_name_tool -add_rpath "@executable_path/../Frameworks/" build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui | ||
# Add homebrew rpath | ||
install_name_tool -add_rpath "/opt/homebrew/lib" build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui | ||
./prep-dmg -a Dissolve-GUI -v ${{ env.dissolveVersion }} -b build/bin/dissolve-gui.app/Contents/MacOS/dissolve-gui -d ${Qt6_ROOT} -i icon/icon-1024x1024.png -p build/bin/dissolve-gui.app/Contents/Info.plist | ||
# Copy dependencies into Frameworks folder in app bundle | ||
cp ./deploy/antlr4-cppruntime/lib/libantlr4-runtime.4.13.1.dylib Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Frameworks/libantlr4-runtime.4.13.1.dylib | ||
cp ./deploy/antlr4-cppruntime/lib/libantlr4-runtime.dylib Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Frameworks/libantlr4-runtime.dylib | ||
cp ./deploy/ftgl/libftgl.2.dylib Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Frameworks/libftgl.2.dylib | ||
cp ./deploy/ftgl/libftgl.2.dylib Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Frameworks/libftgl.2.1.3.dylib | ||
for FILE in ./deploy/onetbb/lib/*.dylib; do | ||
FILENAME=$(basename $FILE) | ||
cp ./deploy/onetbb/lib/$FILENAME Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Frameworks/$FILENAME | ||
done | ||
- name: Create Disk Image | ||
shell: bash | ||
run: | | ||
set -ex | ||
export PATH="$(python3 -m site --user-base)/bin:$PATH" | ||
# Fix icon link | ||
sed -i -e "s/Dissolve.icns/Dissolve-GUI.icns/g" Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Info.plist | ||
# Create DMG | ||
dmgbuild -s ci/osx/dmgbuild-settings.py -D app=./Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app -D icon=./Dissolve-GUI-${dissolveVersion}/Dissolve-GUI.app/Contents/Resources/Dissolve-GUI.icns "Dissolve GUI" Dissolve-GUI-${dissolveVersion}.dmg | ||
# Collect artifacts | ||
mkdir packages | ||
mv Dissolve-GUI-${dissolveVersion}.dmg packages/ | ||
- name: Upload Package Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: packages | ||
path: ${{ github.workspace }}/packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.