diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index 6b0913c249..f900fb9359 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -11,7 +11,7 @@ env: # this is different from MACOSX_DEPLOYMENT_TARGET to prevent build problems # we set MACOSX_DEPLOYMENT_TARGET later MACOS_TARGET: 10.12 - FEATURES: -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DUSE_VTK=ON + FEATURES: -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DUSE_VTK=ON -DUSE_3DCONNEXION=ON CACHE: -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache SCCACHE_GHA_ENABLED: "true" @@ -106,6 +106,18 @@ jobs: repository: openchemistry/avogadroapp path: avogadroapp + - name: Checkout molecules + uses: actions/checkout@v4 + with: + repository: openchemistry/molecules + path: molecules + + - name: Checkout i18n + uses: actions/checkout@v4 + with: + repository: openchemistry/avogadro-i18n + path: avogadro-i18n + - name: Checkout avogadrolibs uses: actions/checkout@v4 with: @@ -122,7 +134,7 @@ jobs: uses: jurplel/install-qt-action@v3 with: cache: True - tools: 'tools_openssl_x64' + tools: 'tools_opensslv3_x64' version: ${{ env.QT_VERSION }} host: 'windows' target: 'desktop' @@ -181,6 +193,15 @@ jobs: 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/work' | awk '{print $1}'`; do + export lib=`echo $libpath | cut -d '/' -f 9`; + echo "Fixing $exe $lib $libpath" + install_name_tool -change $libpath @executable_path/../Frameworks/$lib $exe + done + done - name: Run tests if: matrix.config.os == 'ubuntu-20.04' @@ -234,18 +255,18 @@ jobs: fi # certificate exists fi # password exists - - name: Pack - if: matrix.config.artifact != 0 + - name: Create Mac and Windows Packages + if: matrix.config.os == 'windows-latest' || matrix.config.os == 'macos-latest' shell: bash run: | if [ -z "${P12_PASSWORD}" ]; then unset CODESIGN_IDENTITY # to prevent cpack failing when trying to sign fi cpack ${{ matrix.config.cpack_flags }} + working-directory: ${{ runner.workspace }}/build/avogadroapp env: P12_PASSWORD: ${{ secrets.P12_PASSWORD }} CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} - working-directory: ${{ runner.workspace }}/build/avogadroapp - name: AppImage if: matrix.config.os == 'ubuntu-20.04' && matrix.config.build_type == 'Release' @@ -263,16 +284,11 @@ jobs: 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 diff --git a/.github/workflows/build_m1.yml b/.github/workflows/build_m1.yml index 7f9e31142b..87b4dcaf33 100644 --- a/.github/workflows/build_m1.yml +++ b/.github/workflows/build_m1.yml @@ -6,7 +6,7 @@ env: # 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 + FEATURES: -DUSE_VTK=ON -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DUSE_3DCONNEXION=ON jobs: build: @@ -48,6 +48,12 @@ jobs: repository: openchemistry/avogadroapp path: avogadroapp + - name: Checkout molecules + uses: actions/checkout@v4 + with: + repository: openchemistry/molecules + path: molecules + - name: Checkout avogadrolibs uses: actions/checkout@v4 with: @@ -59,19 +65,10 @@ jobs: repository: openchemistry/avogadro-i18n path: avogadro-i18n - - name: Grab cache files - uses: actions/cache@v3 - with: - path: | - ${{ runner.workspace }}/build/thirdparty - ${{ runner.workspace }}/build/Downloads - key: ${{ matrix.config.name }}-thirdparty - - 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 @@ -87,22 +84,32 @@ jobs: 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`; + 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/work' | awk '{print $1}'`; do - export lib=`echo $libpath | cut -d '/' -f 9`; + 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 @@ -139,39 +146,34 @@ jobs: fi # certificate exists fi # password exists - - name: Pack - if: matrix.config.artifact != 0 + - 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 cpack ${{ matrix.config.cpack_flags }} + working-directory: ${{ runner.workspace }}/build/avogadroapp env: P12_PASSWORD: ${{ secrets.P12_PASSWORD }} CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} - working-directory: ${{ runner.workspace }}/build/avogadroapp - name: Notarize Mac DMG if: runner.os == 'macOS' run: | - pwd - ls -l # check if we have the password and the username if [ -n "${NOTARIZE_PASSWORD}" ] && [ -n "${NOTARIZE_USERNAME}" ]; then - echo "codesign DMG" codesign -s "$CODESIGN_IDENTITY" --timestamp Avogadro2*.dmg - echo "notarizing" 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 }} - NOTARIZE_TEAM: ${{ secrets.AC_TEAM }} continue-on-error: true - working-directory: ${{ runner.workspace }}/build/avogadroapp - name: Upload if: matrix.config.artifact != 0