From c7b9b678c5efd27d3447b5000e4f16090d3c2311 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 16 Dec 2024 03:20:16 +0100 Subject: [PATCH 1/7] Synchronize workflows Signed-off-by: Matthew J. Milner --- .github/workflows/build_cmake.yml | 318 ------------------ .../{flatpak.yml => build_flatpak.yml} | 2 +- .github/workflows/build_linux.yml | 155 +++++++++ .github/workflows/build_mac.yml | 247 ++++++++++++++ .github/workflows/build_windows.yml | 190 +++++++++++ 5 files changed, 593 insertions(+), 319 deletions(-) delete mode 100644 .github/workflows/build_cmake.yml rename .github/workflows/{flatpak.yml => build_flatpak.yml} (99%) create mode 100644 .github/workflows/build_linux.yml create mode 100644 .github/workflows/build_mac.yml create mode 100644 .github/workflows/build_windows.yml diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml deleted file mode 100644 index 498ad472..00000000 --- a/.github/workflows/build_cmake.yml +++ /dev/null @@ -1,318 +0,0 @@ -name: CMake Build Matrix -# Many thanks to Cristian Adam for examples -# e.g. https://github.com/cristianadam/HelloWorld/blob/master/.github/workflows/build_cmake.yml -# https://cristianadam.eu/20191222/using-github-actions-with-c-plus-plus-and-cmake/ - - -on: [push, pull_request] - -env: - BUILD_TYPE: Release - QT_VERSION: 5.15.2 - # this is different from MACOSX_DEPLOYMENT_TARGET to prevent build problems - # we set MACOSX_DEPLOYMENT_TARGET later - MACOS_TARGET: 10.12 - FEATURES: -DUSE_VTK=ON -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF - -jobs: - build: - name: ${{ matrix.config.name }} - runs-on: ${{ matrix.config.os }} - strategy: - fail-fast: false - matrix: - config: - - { - name: "Ubuntu GCC", artifact: "Ubuntu-Latest.tar.gz", - os: ubuntu-latest, - cc: "gcc", cxx: "g++", - build_type: "Release", - cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF -DCMAKE_BUILD_TYPE=Release", - cpack: "", - } - - { - name: "Ubuntu AppImage", artifact: "Avogadro2.AppImage", - os: ubuntu-20.04, - cc: "gcc", cxx: "g++", - build_type: "Release", - cmake_flags: "-G Ninja -DBUILD_MOLEQUEUE=OFF -DINSTALL_BUNDLE_FILES=ON -DCMAKE_BUILD_TYPE=Release", - cpack: "", - } - - { - name: "macOS Latest Clang", artifact: "macOS.dmg", - os: macos-latest, - cc: "clang", cxx: "clang++", - build_type: "Release", - cmake_flags: "-G Ninja -DBUILD_MOLEQUEUE=OFF", - cpack_flags: "-G DragNDrop", - } - - { - name: "Windows Latest MSVC", artifact: "Win64.exe", - os: windows-latest, - cc: "cl", cxx: "cl", - build_type: "Release", - cmake_flags: "-DBUILD_MOLEQUEUE=OFF", - build_flags: "-j 2", - cpack_flags: "-G NSIS", - ssl_env: "D:\\a\\avogadroapp\\Qt\\Tools\\OpenSSLv3\\Win_x64", - } - - { - name: "Ubuntu Address Sanitizer", artifact: "", - os: ubuntu-20.04, - cc: "gcc", cxx: "g++", - build_type: "asan", - cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF", - cpack: "", - } - - { - name: "Ubuntu Leak Sanitizer", artifact: "", - os: ubuntu-20.04, - cc: "gcc", cxx: "g++", - build_type: "lsan", - cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF", - cpack: "", - } - - { - name: "Ubuntu Thread Sanitizer", artifact: "", - os: ubuntu-20.04, - cc: "gcc", cxx: "g++", - build_type: "tsan", - cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF", - cpack: "", - } - - { - name: "Ubuntu Undefined Behavior Sanitizer", artifact: "", - os: ubuntu-20.04, - cc: "gcc", cxx: "g++", - build_type: "ubsan", - cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF", - cpack: "", - } - - steps: - - - name: Install Dependencies (Linux) - if: runner.os == 'Linux' - run: | - sudo apt-get -qq update - sudo apt-get -qq install ninja-build libeigen3-dev libboost-all-dev libglew-dev libxml2-dev - sudo apt-get -qq install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5x11extras5-dev libqt5svg5-dev - - name: Install Dependencies (macOS) - if: runner.os == 'macOS' - run: | - brew install ninja boost eigen glew open-babel - - name: Install Dependencies (Windows) - if: runner.os == 'Windows' - run: choco install ninja - - - name: Checkout openchemistry - uses: actions/checkout@v4 - with: - repository: openchemistry/openchemistry - submodules: recursive - - - name: Checkout avogadroapp - uses: actions/checkout@v4 - with: - path: avogadroapp - - - name: Checkout avogadrolibs - uses: actions/checkout@v4 - with: - repository: openchemistry/avogadrolibs - path: avogadrolibs - - - name: Cache Qt - id: cache-qt - uses: actions/cache@v4 - with: - path: ../Qt - key: ${{ runner.os }}-QtCache - - - name: Install Qt - uses: jurplel/install-qt-action@v3 - with: - aqtversion: '==3.1.*' - cache: true - version: ${{ env.QT_VERSION }} - - - name: Install OpenSSL (Win64) - if: runner.os == 'Windows' - uses: jurplel/install-qt-action@v3 - with: - aqtversion: '==3.1.*' - cache: true - host: 'windows' - target: 'desktop' - tools-only: 'true' - tools: 'tools_opensslv3_x64' - - - name: Configure MSVC Command Prompt - if: runner.os == 'Windows' - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x64 - - - name: Configure - run: | - if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi - cd "${{ runner.workspace }}/build" - # won't have any effect except on Mac - echo "MACOSX_DEPLOYMENT_TARGET=${{ env.MACOS_TARGET }}" >> $GITHUB_ENV - CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} - shell: bash - - - name: Build - run: | - CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake --build . --config ${{matrix.config.build_type}} ${{matrix.config.build_flags}} - shell: bash - working-directory: ${{ runner.workspace }}/build - - - name: Setup tmate session - if: failure() - uses: mxschmitt/action-tmate@v3 - - - name: Fix Mac plugins - if: runner.os == 'macOS' - working-directory: ${{ runner.workspace }}/build/prefix/lib/openbabel - run: | - for plugin in *.so; do - for libpath in `otool -L ${plugin} | grep '/Users/runner/work' | awk '{print $1}'`; do - export lib=`echo $libpath | cut -d '/' -f 9`; - echo "Fixing $plugin $lib $libpath" - install_name_tool -change $libpath @executable_path/../Frameworks/$lib $plugin - done - done - cd .. # build/prefix/lib - for plugin in libinchi.?.?.?.dylib; do - for libpath in `otool -L ${plugin} | grep '/Users/runner/work' | awk '{print $1}'`; do - export lib=`echo $libpath | cut -d '/' -f 9`; - echo "Fixing $plugin $lib $libpath" - install_name_tool -change $libpath @executable_path/../Frameworks/$lib $plugin - done - done - otool -L libinchi.?.?.?.dylib - cp -p libinchi* ../Avogadro2.app/Contents/Frameworks/ - - - name: Run tests - if: matrix.config.os == 'ubuntu-20.04' - shell: cmake -P {0} - run: | - include(ProcessorCount) - ProcessorCount(N) - set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON") - set(ENV{ASAN_OPTIONS} "new_delete_type_mismatch=0") - execute_process( - COMMAND ctest -j ${N} - WORKING_DIRECTORY ${{ runner.workspace }}/build/avogadrolibs - RESULT_VARIABLE result - ) - if (NOT result EQUAL 0) - message(FATAL_ERROR "Running tests failed!") - endif() - - - name: Install the Apple certificate - # From GitHub docs: https://docs.github.com/en/actions/guides/installing-an-apple-certificate-on-macos-runners-for-xcode-development - if: runner.os == 'macOS' - working-directory: ${{ runner.workspace }}/build - env: - BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} - P12_PASSWORD: ${{ secrets.P12_PASSWORD }} - KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} - NOTARIZE_USERNAME: ${{ secrets.AC_USERNAME }} - NOTARIZE_PASSWORD: ${{ secrets.AC_PASSWORD }} - CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} - PRODUCT_BUNDLE_IDENTIFIER: cc.avogadro - run: | - # create variables - if [ -n "${P12_PASSWORD}" ]; then - CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db - - # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH - - # create temporary keychain if the cert is non-zero - if [ -s $CERTIFICATE_PATH ]; then - security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - - # import certificate to keychain - security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH - - # signing occurs via avogadroapp cpack instructions - fi # certificate exists - fi # password exists - - - name: Pack - if: matrix.config.artifact != 0 - shell: bash - run: | - if [ -z "${P12_PASSWORD}" ]; then - unset CODESIGN_IDENTITY # to prevent cpack failing when trying to sign - fi - if [ -z "${OPENSSL_ROOT_DIR}" ]; then - unset OPENSSL_ROOT_DIR - fi - cpack ${{ matrix.config.cpack_flags }} - env: - P12_PASSWORD: ${{ secrets.P12_PASSWORD }} - CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} - OPENSSL_ROOT_DIR: ${{ matrix.config.ssl_env }} - working-directory: ${{ runner.workspace }}/build/avogadroapp - - - name: AppImage - if: matrix.config.os == 'ubuntu-18.04' - shell: bash - run: | - mkdir appdir - mv prefix appdir/usr - wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" - wget -c -nv "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" - chmod a+x *.AppImage - ./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -extra-plugins=iconengines - # add the custom AppRun - rm appdir/AppRun - cp ../avogadrolibs/avogadrolibs/scripts/AppImage.sh appdir/AppRun - chmod a+x appdir/AppRun - ./appimagetool-x86_64.AppImage appdir - mv Avogadro2*.AppImage avogadroapp # for upload - # remove the cpack files - rm avogadroapp/Avogadro2*Linux.* - working-directory: ${{ runner.workspace }}/build - - - name: Notarize Mac DMG - if: runner.os == 'macOS' - run: | - # check current directory (failing signing) - echo `pwd` - ls -ld - # check if we have the password and the username - if [ -n "${NOTARIZE_PASSWORD}" ] && [ -n "${NOTARIZE_USERNAME}" ]; then - codesign -s "$CODESIGN_IDENTITY" --timestamp Avogadro2*.dmg - npx notarize-cli --file Avogadro2*.dmg - fi - working-directory: ${{ runner.workspace }}/build/avogadroapp - env: - NOTARIZE_USERNAME: ${{ secrets.AC_USERNAME }} - NOTARIZE_PASSWORD: ${{ secrets.AC_PASSWORD }} - CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} - PRODUCT_BUNDLE_IDENTIFIER: cc.avogadro - - - name: Upload - if: matrix.config.artifact != 0 - uses: actions/upload-artifact@v4 - with: - path: ${{ runner.workspace }}/build/avogadroapp/Avogadro2*.* - name: ${{ matrix.config.artifact }} - - - name: Cleanup - if: ${{ always() }} # To ensure this step runs even when earlier steps fail - shell: bash - run: | - ls -la ./ - rm -rf ./* || true - rm -rf ./.??* || true - ls -la ./ diff --git a/.github/workflows/flatpak.yml b/.github/workflows/build_flatpak.yml similarity index 99% rename from .github/workflows/flatpak.yml rename to .github/workflows/build_flatpak.yml index bd8cb679..90266880 100644 --- a/.github/workflows/flatpak.yml +++ b/.github/workflows/build_flatpak.yml @@ -9,7 +9,7 @@ jobs: steps: - name: Install dependencies - run: sudo apt update -qq && sudo apt install -y -qq flatpak flatpak-builder + run: sudo apt update -qq && sudo apt install -y -qq flatpak - name: Configure flatpak run: flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml new file mode 100644 index 00000000..2d4eb883 --- /dev/null +++ b/.github/workflows/build_linux.yml @@ -0,0 +1,155 @@ +name: Linux Build Matrix +# Many thanks to Cristian Adam for examples +# e.g. https://github.com/cristianadam/HelloWorld/blob/master/.github/workflows/build_cmake.yml +# https://cristianadam.eu/20191222/using-github-actions-with-c-plus-plus-and-cmake/ + +on: [push, pull_request] + +env: + QT_VERSION: 6.8.1 + FEATURES: -DUSE_VTK=ON -DBUILD_GPL_PLUGINS=ON -DBUILD_MOLEQUEUE=OFF -DWITH_COORDGEN=OFF -DQT_VERSION=6 + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - { + name: "Ubuntu", artifact: "ubuntu-x86_64.tar.gz", + os: ubuntu-latest, + cc: "gcc", cxx: "g++", + build_type: "Release", + cmake_flags: "-G Ninja", + } + - { + name: "AppImage", artifact: "Avogadro2.AppImage", + os: ubuntu-22.04, + cc: "gcc", cxx: "g++", + build_type: "Release", + cmake_flags: "-G Ninja -DINSTALL_BUNDLE_FILES=ON", + } + - { + name: "Ubuntu Address Sanitizer", artifact: "", + os: ubuntu-latest, + cc: "gcc", cxx: "g++", + build_type: "asan", + cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF -USE_SYSTEM_ZLIB=ON", + } + - { + name: "Ubuntu Undefined Behavior Sanitizer", artifact: "", + os: ubuntu-latest, + cc: "gcc", cxx: "g++", + build_type: "ubsan", + cmake_flags: "-G Ninja -DENABLE_TESTING=ON -DTEST_QTGL=OFF -USE_SYSTEM_ZLIB=ON", + } + + steps: + + - name: Install Dependencies + run: | + sudo apt-get -qq update + sudo apt-get -qq install ninja-build libeigen3-dev libboost-all-dev libglew-dev libxml2-dev + + - name: Checkout openchemistry + uses: actions/checkout@v4 + with: + repository: openchemistry/openchemistry + submodules: recursive + path: openchemistry + + - name: Checkout avogadroapp + uses: actions/checkout@v4 + with: + path: openchemistry/avogadroapp + fetch-depth: 0 + + - name: Checkout avogadrolibs + uses: actions/checkout@v4 + with: + repository: openchemistry/avogadroapp + path: openchemistry/avogadrolibs + fetch-depth: 0 + + - name: Checkout i18n + uses: actions/checkout@v4 + with: + repository: openchemistry/avogadro-i18n + path: openchemistry/avogadro-i18n + + - name: Checkout avogadrogenerators + uses: actions/checkout@v4 + with: + repository: openchemistry/avogenerators + path: openchemistry/avogadrogenerators + + - name: Checkout crystals + uses: actions/checkout@v4 + with: + repository: openchemistry/crystals + path: openchemistry/crystals + + - name: Checkout fragments + uses: actions/checkout@v4 + with: + repository: openchemistry/fragments + path: openchemistry/fragments + + - name: Checkout molecules + uses: actions/checkout@v4 + with: + repository: openchemistry/molecules + path: openchemistry/molecules + + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + version: ${{ env.QT_VERSION }} + + - name: Configure + run: | + if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi + cd "${{ runner.workspace }}/build" + # won't have any effect except on Mac + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} + shell: bash + + - name: Build + run: | + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake --build . --config ${{matrix.config.build_type}} ${{matrix.config.build_flags}} + shell: bash + working-directory: ${{ runner.workspace }}/build + + - name: Run tests + if: matrix.config.os == 'ubuntu-latest' + shell: cmake -P {0} + run: | + include(ProcessorCount) + ProcessorCount(N) + set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON") + set(ENV{ASAN_OPTIONS} "new_delete_type_mismatch=0") + execute_process( + COMMAND ctest -j ${N} + WORKING_DIRECTORY ${{ runner.workspace }}/build/avogadrolibs + RESULT_VARIABLE result + ) + if (NOT result EQUAL 0) + message(FATAL_ERROR "Running tests failed!") + endif() + + - name: Upload + if: matrix.config.artifact != 0 + uses: actions/upload-artifact@v4 + with: + path: ${{ runner.workspace }}/build/avogadroapp/Avogadro2*.* + name: ${{ matrix.config.artifact }} + + - name: Setup tmate session + if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml new file mode 100644 index 00000000..48d6bacf --- /dev/null +++ b/.github/workflows/build_mac.yml @@ -0,0 +1,247 @@ +name: macOS Build Matrix + +on: [push, pull_request, workflow_dispatch] + +env: + # this is different from MACOSX_DEPLOYMENT_TARGET to prevent build problems + # we set MACOSX_DEPLOYMENT_TARGET later + MACOS_TARGET: 12 + QT_VERSION: 5.15.2 + FEATURES: -DUSE_VTK=ON -DBUILD_GPL_PLUGINS=ON -DBUILD_MOLEQUEUE=OFF -DWITH_COORDGEN=OFF + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - { + name: "macOS Intel", artifact: "macOS-x86_64.dmg", + os: macos-latest, + cc: "clang", cxx: "clang++", + build_type: "Release", + cmake_flags: "-G Ninja -DCMAKE_OSX_ARCHITECTURES='x86_64'", + cpack_flags: "-G DragNDrop", + } + - { + name: "macOS Apple Silicon", artifact: "macOS-arm64.dmg", + os: [self-hosted, macOS], + cc: "clang", cxx: "clang++", + build_type: "Release", + cmake_flags: "-G Ninja -DCMAKE_PREFIX_PATH=/opt/homebrew/Cellar/qt@5/5.15.5_1/lib/cmake/Qt5", + cpack_flags: "-G DragNDrop", + } + - { + name: "macOS Qt6", artifact: "", + os: macos-latest, + cc: "clang", cxx: "clang++", + build_type: "Release", + cmake_flags: "-G Ninja -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64'", + cpack_flags: "-G DragNDrop", + env: { + QT_VERSION: 6.8.1, + } + } + + steps: + + - name: Install Dependencies (macOS) + if: runner.os == 'macOS' + run: | + if uname -p | grep -q "arm" ; then + export PATH=/opt/homebrew/bin:$PATH + else # not self-hosted runner + brew install ninja eigen glew + fi + + - name: Checkout openchemistry + uses: actions/checkout@v4 + with: + repository: openchemistry/openchemistry + submodules: recursive + path: openchemistry + + - name: Checkout avogadroapp + uses: actions/checkout@v4 + with: + repository: openchemistry/avogadroapp + path: openchemistry/avogadroapp + fetch-depth: 0 + + - name: Checkout avogadrolibs + uses: actions/checkout@v4 + with: + path: openchemistry/avogadrolibs + fetch-depth: 0 + + - name: Checkout i18n + uses: actions/checkout@v4 + with: + repository: openchemistry/avogadro-i18n + path: openchemistry/avogadro-i18n + + - name: Checkout avogadrogenerators + uses: actions/checkout@v4 + with: + repository: openchemistry/avogenerators + path: openchemistry/avogadrogenerators + + - name: Checkout crystals + uses: actions/checkout@v4 + with: + repository: openchemistry/crystals + path: openchemistry/crystals + + - name: Checkout fragments + uses: actions/checkout@v4 + with: + repository: openchemistry/fragments + path: openchemistry/fragments + + - name: Checkout molecules + uses: actions/checkout@v4 + with: + repository: openchemistry/molecules + path: openchemistry/molecules + + - name: Install Qt + # Only if not self-hosted + if: runner.name != 'macOS Apple Silicon' + uses: jurplel/install-qt-action@v4 + with: + version: ${{ env.QT_VERSION }} + + - name: Configure + run: | + if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi + cd "${{ runner.workspace }}/build" + echo "MACOSX_DEPLOYMENT_TARGET=${{ env.MACOS_TARGET }}" >> $GITHUB_ENV + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} + shell: bash + + - name: Build + run: | + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake --build . --config ${{matrix.config.build_type}} ${{matrix.config.build_flags}} + shell: bash + working-directory: ${{ runner.workspace }}/build + + - name: Fix Mac plugins + if: runner.os == 'macOS' + working-directory: ${{ runner.workspace }}/build/prefix/lib/openbabel + run: | + for plugin in *.so; do + for libpath in `otool -L ${plugin} | grep '/Users/runner' | awk '{print $1}'`; do + export lib=`echo $libpath | cut -d '/' -f 10`; + echo "Fixing $plugin $lib $libpath" + install_name_tool -change $libpath @executable_path/../Frameworks/$lib $plugin + done + done + cd .. # build/prefix/lib + for plugin in libinchi.?.?.?.dylib; do + for libpath in `otool -L ${plugin} | grep '/Users/runner' | awk '{print $1}'`; do + export lib=`echo $libpath | cut -d '/' -f 10`; + echo "Fixing $plugin $lib $libpath" + install_name_tool -change $libpath @executable_path/../Frameworks/$lib $plugin + done + done + otool -L libinchi.?.?.?.dylib + cp -p libinchi* ../Avogadro2.app/Contents/Frameworks/ + # finally, fixup the binaries + #cd ../bin + #for exe in obabel obmm eht_bind genXrdPattern; do + # for libpath in `otool -L ${exe} | grep '/Users/runner' | awk '{print $1}'`; do + # export lib=`echo $libpath | cut -d '/' -f 10`; + # echo "Fixing $exe $lib $libpath" + # install_name_tool -change $libpath @executable_path/../Frameworks/$lib $exe + # done + #done + + + - name: Install the Apple certificate + # From GitHub docs: https://docs.github.com/en/actions/guides/installing-an-apple-certificate-on-macos-runners-for-xcode-development + if: runner.os == 'macOS' + working-directory: ${{ runner.workspace }}/build + env: + BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} + P12_PASSWORD: ${{ secrets.P12_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + NOTARIZE_USERNAME: ${{ secrets.AC_USERNAME }} + NOTARIZE_PASSWORD: ${{ secrets.AC_PASSWORD }} + CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} + PRODUCT_BUNDLE_IDENTIFIER: cc.avogadro + run: | + # create variables + if [ -n "${P12_PASSWORD}" ]; then + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + + # import certificate and provisioning profile from secrets + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH + + # create temporary keychain if the cert is non-zero + if [ -s $CERTIFICATE_PATH ]; then + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + + # signing occurs via avogadroapp cpack instructions + fi # certificate exists + fi # password exists + # remove any previous DMG in case they're still around + rm -f avogadroapp/*.dmg + + - name: Create Mac and Windows Packages + shell: bash + run: | + if [ -z "${P12_PASSWORD}" ]; then + unset CODESIGN_IDENTITY # to prevent cpack failing when trying to sign + fi + [[ ! "${GITHUB_REF}" =~ "tags" ]] && export SNAPSHOT_DATE=`date -j "+%d-%m-%y"` + cpack ${{ matrix.config.cpack_flags }} + working-directory: ${{ runner.workspace }}/build/avogadroapp + env: + P12_PASSWORD: ${{ secrets.P12_PASSWORD }} + CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} + + - name: Notarize Mac DMG + if: runner.os == 'macOS' + run: | + # check if we have the password and the username + if [ -n "${NOTARIZE_PASSWORD}" ] && [ -n "${NOTARIZE_USERNAME}" ]; then + codesign -s "$CODESIGN_IDENTITY" --timestamp Avogadro2*.dmg + xcrun notarytool submit Avogadro2*.dmg --apple-id "$NOTARIZE_USERNAME" --team-id "$NOTARIZE_TEAM" --password "$NOTARIZE_PASSWORD" --verbose --wait + xcrun stapler staple -v Avogadro2*.dmg + fi + working-directory: ${{ runner.workspace }}/build/avogadroapp + env: + NOTARIZE_TEAM: ${{ secrets.AC_TEAM }} + NOTARIZE_USERNAME: ${{ secrets.AC_USERNAME }} + NOTARIZE_PASSWORD: ${{ secrets.AC_PASSWORD }} + CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} + continue-on-error: true + + - name: Upload + if: matrix.config.artifact != 0 + uses: actions/upload-artifact@v4 + with: + path: ${{ runner.workspace }}/build/avogadroapp/Avogadro2*.* + name: ${{ matrix.config.artifact }} + + - name: Cleanup + if: ${{ always() }} # To ensure this step runs even when earlier steps fail + shell: bash + run: | + ls -la ./ + rm -rf ./* || true + rm -rf ./.??* || true + ls -la ./ diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml new file mode 100644 index 00000000..6cd0dc85 --- /dev/null +++ b/.github/workflows/build_windows.yml @@ -0,0 +1,190 @@ +name: Windows Build Matrix +# Many thanks to Cristian Adam for examples +# e.g. https://github.com/cristianadam/HelloWorld/blob/master/.github/workflows/build_cmake.yml +# https://cristianadam.eu/20191222/using-github-actions-with-c-plus-plus-and-cmake/ + +# This workflow will build and sign on Windows +# .. since SignPath requires only a Windows build in the action +# .. to successfully sign + +on: [push, pull_request, workflow_dispatch] + +env: + QT_VERSION: 5.15.2 + FEATURES: -DUSE_VTK=ON -DBUILD_GPL_PLUGINS=ON -DBUILD_MOLEQUEUE=OFF -DWITH_COORDGEN=OFF + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - { + name: "Windows", artifact: "windows-x86_64.exe", + os: windows-latest, + cc: "cl", cxx: "cl", + build_type: "Release", + cmake_flags: "", + build_flags: "", + cpack_flags: "-G NSIS", + } + - { + name: "Windows Qt6", artifact: "", + os: windows-latest, + cc: "cl", cxx: "cl", + build_type: "Release", + cmake_flags: "", + build_flags: "", + cpack_flags: "-G NSIS", + env: { + QT_VERSION: 6.8.1, + } + } + + steps: + + - name: Install Dependencies (Windows) + if: runner.os == 'Windows' + run: choco install ninja + + - name: Checkout openchemistry + uses: actions/checkout@v4 + with: + repository: openchemistry/openchemistry + submodules: recursive + path: openchemistry + + - name: Checkout avogadroapp + uses: actions/checkout@v4 + with: + repository: openchemistry/avogadroapp + path: openchemistry/avogadroapp + fetch-depth: 0 + + - name: Checkout avogadrolibs + uses: actions/checkout@v4 + with: + path: openchemistry/avogadrolibs + fetch-depth: 0 + + - name: Checkout i18n + uses: actions/checkout@v4 + with: + repository: openchemistry/avogadro-i18n + path: openchemistry/avogadro-i18n + + - name: Checkout avogadrogenerators + uses: actions/checkout@v4 + with: + repository: openchemistry/avogenerators + path: openchemistry/avogadrogenerators + + - name: Checkout crystals + uses: actions/checkout@v4 + with: + repository: openchemistry/crystals + path: openchemistry/crystals + + - name: Checkout fragments + uses: actions/checkout@v4 + with: + repository: openchemistry/fragments + path: openchemistry/fragments + + - name: Checkout molecules + uses: actions/checkout@v4 + with: + repository: openchemistry/molecules + path: openchemistry/molecules + + - name: Install Qt + uses: jurplel/install-qt-action@v4 + with: + aqtversion: '==3.1.*' + cache: true + version: ${{ env.QT_VERSION }} + + - name: Configure MSVC Command Prompt + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + + - name: Grab cache files + uses: actions/cache@v4 + if: runner.os != 'Windows' + with: + path: | + ${{ runner.workspace }}/build/Downloads + key: ${{ matrix.config.name }}-downloads + + - name: Configure + run: | + if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi + cd "${{ runner.workspace }}/build" + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} + shell: bash + + - name: Build + run: | + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake --build . --config ${{matrix.config.build_type}} ${{matrix.config.build_flags}} + shell: bash + working-directory: ${{ runner.workspace }}/build + + - name: Create Windows Package + if: matrix.config.os == 'windows-latest' + shell: bash + run: | + [[ ! "${GITHUB_REF}" =~ "tags" ]] && export SNAPSHOT_DATE=`date -j "+%d-%m-%y"` + cpack ${{ matrix.config.cpack_flags }} + working-directory: ${{ runner.workspace }}/build/avogadroapp + continue-on-error: true + env: + OPENSSL_ROOT_DIR: ${{ matrix.config.ssl_env }} + + - name: Upload + if: matrix.config.artifact != 0 + id: upload-artifact + uses: actions/upload-artifact@v4 + with: + path: ${{ runner.workspace }}/build/avogadroapp/Avogadro*.* + name: ${{ matrix.config.artifact }} + + - name: Sign Windows release + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') + uses: signpath/github-action-submit-signing-request@v1 + with: + api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' + organization-id: '${{ secrets.SIGNPATH_ORG_ID }}' + project-slug: 'avogadrolibs' + signing-policy-slug: 'release-signing' + github-artifact-id: '${{ steps.upload-artifact.outputs.artifact-id }}' + wait-for-completion: true + output-artifact-directory: '../build/' + + - name: Upload + if: matrix.config.artifact != 0 + id: upload-signed-artifact + uses: actions/upload-artifact@v4 + with: + path: ${{ runner.workspace }}/build/Avogadro2*.* + name: 'Win64-signed.exe' + + - name: Setup tmate session + if: failure() + uses: mxschmitt/action-tmate@v3 + + - name: Cleanup + if: ${{ always() }} # To ensure this step runs even when earlier steps fail + shell: bash + run: | + ls -la ./ + rm -rf ./* || true + rm -rf ./.??* || true + ls -la ./ From 7badb078515a22a792845ece16f34d7294618c1f Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 16 Dec 2024 03:32:28 +0100 Subject: [PATCH 2/7] Fix macOS checkouts, add cleanup step to Linux Signed-off-by: Matthew J. Milner --- .github/workflows/build_linux.yml | 9 +++++++++ .github/workflows/build_mac.yml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 2d4eb883..f0da7434 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -153,3 +153,12 @@ jobs: - name: Setup tmate session if: ${{ failure() }} uses: mxschmitt/action-tmate@v3 + + - name: Cleanup + if: ${{ always() }} # To ensure this step runs even when earlier steps fail + shell: bash + run: | + ls -la ./ + rm -rf ./* || true + rm -rf ./.??* || true + ls -la ./ diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml index 48d6bacf..a2efc0a0 100644 --- a/.github/workflows/build_mac.yml +++ b/.github/workflows/build_mac.yml @@ -70,13 +70,13 @@ jobs: - name: Checkout avogadroapp uses: actions/checkout@v4 with: - repository: openchemistry/avogadroapp path: openchemistry/avogadroapp fetch-depth: 0 - name: Checkout avogadrolibs uses: actions/checkout@v4 with: + repository: openchemistry/avogadrolibs path: openchemistry/avogadrolibs fetch-depth: 0 From c745425f82dc5701b0321bcc57b45c0b41df93eb Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 16 Dec 2024 03:37:53 +0100 Subject: [PATCH 3/7] Remove fetch depth limits Signed-off-by: Matthew J. Milner --- .github/workflows/build_linux.yml | 2 -- .github/workflows/build_mac.yml | 2 -- .github/workflows/build_windows.yml | 2 -- 3 files changed, 6 deletions(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index f0da7434..7524297a 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -68,14 +68,12 @@ jobs: uses: actions/checkout@v4 with: path: openchemistry/avogadroapp - fetch-depth: 0 - name: Checkout avogadrolibs uses: actions/checkout@v4 with: repository: openchemistry/avogadroapp path: openchemistry/avogadrolibs - fetch-depth: 0 - name: Checkout i18n uses: actions/checkout@v4 diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml index a2efc0a0..c80b7144 100644 --- a/.github/workflows/build_mac.yml +++ b/.github/workflows/build_mac.yml @@ -71,14 +71,12 @@ jobs: uses: actions/checkout@v4 with: path: openchemistry/avogadroapp - fetch-depth: 0 - name: Checkout avogadrolibs uses: actions/checkout@v4 with: repository: openchemistry/avogadrolibs path: openchemistry/avogadrolibs - fetch-depth: 0 - name: Checkout i18n uses: actions/checkout@v4 diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 6cd0dc85..31e26656 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -65,13 +65,11 @@ jobs: with: repository: openchemistry/avogadroapp path: openchemistry/avogadroapp - fetch-depth: 0 - name: Checkout avogadrolibs uses: actions/checkout@v4 with: path: openchemistry/avogadrolibs - fetch-depth: 0 - name: Checkout i18n uses: actions/checkout@v4 From 73baf50132bb49c735a46342ab954841d4670134 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 16 Dec 2024 03:52:28 +0100 Subject: [PATCH 4/7] Use correct path for configure step Signed-off-by: Matthew J. Milner --- .github/workflows/build_linux.yml | 2 +- .github/workflows/build_mac.yml | 2 +- .github/workflows/build_windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 7524297a..c3cc6d9c 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -115,7 +115,7 @@ jobs: if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi cd "${{ runner.workspace }}/build" # won't have any effect except on Mac - CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake "${{ runner.workspace }}/openchemistry" ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} shell: bash - name: Build diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml index c80b7144..75ec1835 100644 --- a/.github/workflows/build_mac.yml +++ b/.github/workflows/build_mac.yml @@ -120,7 +120,7 @@ jobs: if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi cd "${{ runner.workspace }}/build" echo "MACOSX_DEPLOYMENT_TARGET=${{ env.MACOS_TARGET }}" >> $GITHUB_ENV - CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake "${{ runner.workspace }}/openchemistry" ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} shell: bash - name: Build diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 31e26656..4cf7370a 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -126,7 +126,7 @@ jobs: run: | if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi cd "${{ runner.workspace }}/build" - CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake "${{ runner.workspace }}/openchemistry" ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} shell: bash - name: Build From a901f8764901b38bb2d7a6ef7f3fdae995499e44 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 16 Dec 2024 04:12:02 +0100 Subject: [PATCH 5/7] Try another path Signed-off-by: Matthew J. Milner --- .github/workflows/build_linux.yml | 2 +- .github/workflows/build_mac.yml | 2 +- .github/workflows/build_windows.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index c3cc6d9c..35486a34 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -115,7 +115,7 @@ jobs: if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi cd "${{ runner.workspace }}/build" # won't have any effect except on Mac - CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake "${{ runner.workspace }}/openchemistry" ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE/openchemistry ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} shell: bash - name: Build diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml index 75ec1835..307475f5 100644 --- a/.github/workflows/build_mac.yml +++ b/.github/workflows/build_mac.yml @@ -120,7 +120,7 @@ jobs: if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi cd "${{ runner.workspace }}/build" echo "MACOSX_DEPLOYMENT_TARGET=${{ env.MACOS_TARGET }}" >> $GITHUB_ENV - CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake "${{ runner.workspace }}/openchemistry" ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE/openchemistry ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} shell: bash - name: Build diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 4cf7370a..cf5cb151 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -126,7 +126,7 @@ jobs: run: | if [ ! -d "${{ runner.workspace }}/build" ]; then mkdir "${{ runner.workspace }}/build"; fi cd "${{ runner.workspace }}/build" - CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake "${{ runner.workspace }}/openchemistry" ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} + CC=${{matrix.config.cc}} CXX=${{matrix.config.cxx}} cmake $GITHUB_WORKSPACE/openchemistry ${{env.FEATURES}} -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_flags}} shell: bash - name: Build From 53c78fdb290415ac73f4f20c83cdf2b2ad881c33 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 16 Dec 2024 14:41:20 +0100 Subject: [PATCH 6/7] Fix conditionals in mac workflow Signed-off-by: Matthew J. Milner --- .github/workflows/build_mac.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml index 307475f5..fe6effb2 100644 --- a/.github/workflows/build_mac.yml +++ b/.github/workflows/build_mac.yml @@ -51,14 +51,13 @@ jobs: steps: - - name: Install Dependencies (macOS) - if: runner.os == 'macOS' - run: | - if uname -p | grep -q "arm" ; then - export PATH=/opt/homebrew/bin:$PATH - else # not self-hosted runner - brew install ninja eigen glew - fi + - name: Install Dependencies + if: matrix.config.name != 'macOS Apple Silicon' + run: brew install ninja eigen glew + + - name: Set PATH (self-hosted) + if: matrix.config.name == 'macOS Apple Silicon' + run: export PATH=/opt/homebrew/bin:$PATH - name: Checkout openchemistry uses: actions/checkout@v4 @@ -110,7 +109,7 @@ jobs: - name: Install Qt # Only if not self-hosted - if: runner.name != 'macOS Apple Silicon' + if: matrix.config.name != 'macOS Apple Silicon' uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }} @@ -130,7 +129,6 @@ jobs: working-directory: ${{ runner.workspace }}/build - name: Fix Mac plugins - if: runner.os == 'macOS' working-directory: ${{ runner.workspace }}/build/prefix/lib/openbabel run: | for plugin in *.so; do @@ -163,7 +161,6 @@ jobs: - name: Install the Apple certificate # From GitHub docs: https://docs.github.com/en/actions/guides/installing-an-apple-certificate-on-macos-runners-for-xcode-development - if: runner.os == 'macOS' working-directory: ${{ runner.workspace }}/build env: BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} @@ -212,7 +209,6 @@ jobs: CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} - name: Notarize Mac DMG - if: runner.os == 'macOS' run: | # check if we have the password and the username if [ -n "${NOTARIZE_PASSWORD}" ] && [ -n "${NOTARIZE_USERNAME}" ]; then From 1fa2c124f1ad93414352622339703cdb4ce57dc6 Mon Sep 17 00:00:00 2001 From: "Matthew J. Milner" Date: Mon, 16 Dec 2024 14:57:34 +0100 Subject: [PATCH 7/7] Switch to GitHub Apple Silicon runner Signed-off-by: Matthew J. Milner --- .github/workflows/build_mac.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml index fe6effb2..4faa2008 100644 --- a/.github/workflows/build_mac.yml +++ b/.github/workflows/build_mac.yml @@ -23,7 +23,7 @@ jobs: config: - { name: "macOS Intel", artifact: "macOS-x86_64.dmg", - os: macos-latest, + os: macos-13, cc: "clang", cxx: "clang++", build_type: "Release", cmake_flags: "-G Ninja -DCMAKE_OSX_ARCHITECTURES='x86_64'", @@ -31,10 +31,10 @@ jobs: } - { name: "macOS Apple Silicon", artifact: "macOS-arm64.dmg", - os: [self-hosted, macOS], + os: macos-latest, cc: "clang", cxx: "clang++", build_type: "Release", - cmake_flags: "-G Ninja -DCMAKE_PREFIX_PATH=/opt/homebrew/Cellar/qt@5/5.15.5_1/lib/cmake/Qt5", + cmake_flags: "-G Ninja -DCMAKE_OSX_ARCHITECTURES='arm64'", cpack_flags: "-G DragNDrop", } - { @@ -52,12 +52,7 @@ jobs: steps: - name: Install Dependencies - if: matrix.config.name != 'macOS Apple Silicon' run: brew install ninja eigen glew - - - name: Set PATH (self-hosted) - if: matrix.config.name == 'macOS Apple Silicon' - run: export PATH=/opt/homebrew/bin:$PATH - name: Checkout openchemistry uses: actions/checkout@v4 @@ -108,8 +103,6 @@ jobs: path: openchemistry/molecules - name: Install Qt - # Only if not self-hosted - if: matrix.config.name != 'macOS Apple Silicon' uses: jurplel/install-qt-action@v4 with: version: ${{ env.QT_VERSION }}