diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index bf764f3bf9..fc61fdf77f 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -288,7 +288,10 @@ jobs: fi # get the tag or the current date VERSION="" - [[ ! -z "${{github.ref_name}}" ]] && VERSION="${{github.ref_name}}" || VERSION=`date -j "+%d-%m-%y"` + echo ${GITHUB_REF} + echo ${GITHUB_REF#refs/*/} + # [[ "${GITHUB_REF#refs/*/}" != "merge" ]] && VERSION="${GITHUB_REF#refs/*/}" || VERSION=`date -j "+%d-%m-%y"` + VERSION=`date -j "+%d-%m-%y"` # build DMG brew install create-dmg VOL="Avogadro2-$VERSION" diff --git a/.github/workflows/build_m1.yml b/.github/workflows/build_m1.yml index 7c09569249..5d1f15f394 100644 --- a/.github/workflows/build_m1.yml +++ b/.github/workflows/build_m1.yml @@ -65,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 @@ -145,39 +136,49 @@ jobs: 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 - cpack ${{ matrix.config.cpack_flags }} - env: - P12_PASSWORD: ${{ secrets.P12_PASSWORD }} - CODESIGN_IDENTITY: ${{ secrets.CODESIGN_ID }} - working-directory: ${{ runner.workspace }}/build/avogadroapp - - - name: Notarize Mac DMG + - name: Build and Notarize Mac DMG if: runner.os == 'macOS' run: | - pwd - ls -l + # 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="" + echo ${GITHUB_REF} + echo ${GITHUB_REF#refs/*/} + # [[ "${GITHUB_REF#refs/*/}" != "merge" ]] && VERSION="${GITHUB_REF#refs/*/}" || VERSION=`date -j "+%d-%m-%y"` + VERSION=`date -j "+%d-%m-%y"` + # build DMG + brew install create-dmg + VOL="Avogadro2-$VERSION" + DMG="Avogadro2-$VERSION.dmg" + echo "VOL: $VOL" + 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} prefix/Avogadro2.app # 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 + mkdir avogadroapp + # move it for upload + mv Avogadro2*.dmg avogadroapp + working-directory: ${{ runner.workspace }}/build 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