diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index c44567dd32..219b448306 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -246,17 +246,11 @@ jobs: fi # certificate exists fi # password exists - - name: Pack - if: matrix.config.artifact != 0 + - name: Pack Windows + if: matrix.config.os == 'windows-latest' && matrix.config.build_type == 'Release' 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 }} - env: - P12_PASSWORD: ${{ secrets.P12_PASSWORD }} - CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} working-directory: ${{ runner.workspace }}/build/avogadroapp - name: AppImage @@ -279,12 +273,30 @@ jobs: rm avogadroapp/Avogadro2*Linux.* working-directory: ${{ runner.workspace }}/build - - name: Notarize Mac DMG + - name: Build and Notarize Mac DMG if: runner.os == 'macOS' run: | # check current directory (failing signing) echo `pwd` ls -ld + # if possible, sign the app + if [ -n "${NOTARIZE_PASSWORD}" ] && [ -n "${NOTARIZE_USERNAME}" ]; then + cd prefix + codesign --force --deep -s "$CODESIGN_IDENTITY" --timestamp Avogadro2.app + ditto -c -k --keepParent Avogadro2.app Avogadro2.zip + xcrun notarytool submit Avogadro2.zip --apple-id "$NOTARIZE_USERNAME" --team-id "$NOTARIZE_TEAM" --password "$NOTARIZE_PASSWORD" --verbose --wait + xcrun stapler staple -v Avogadro2.app + cd .. + fi + # get the tag or the current date + VERSION="" + [[ ! -z "${{github.ref_name}}" ]] && VERSION="${{github.ref_name}}" || VERSION=`date -j "+%d-%m-%y"` + # build DMG + brew install create-dmg + VOL="Avogadro2-$VERSION" + DMG="Avogadro2-$VERSION.dmg" + rm -f Avogadro2*.dmg + create-dmg --volname ${VOL} --icon-size 64 --icon "Avogadro2.app" 10 50 --app-drop-link 180 50 --hide-extension Avogadro2.app --window-size 300 50 --window-pos 200 200 --format UDBZ ${DMG} Avogadro2.app # check if we have the password and the username if [ -n "${NOTARIZE_PASSWORD}" ] && [ -n "${NOTARIZE_USERNAME}" ]; then codesign -s "$CODESIGN_IDENTITY" --timestamp Avogadro2*.dmg