bacongravy / notarize-cli

Notarize a macOS app from the command line
ISC License
14 stars 5 forks source link

Keep getting upload failed #10

Open isaacadariku opened 2 years ago

isaacadariku commented 2 years ago

Hello 👋🏽, thanks for the awesome cli 🎉Please I have been trying to use the package from GitHub action, it keep failing to upload build, I switch to my local PC, to try it from my command prompt, same issue. Please what may be the cause of this, find screenshot below of same failure.

GitHub action failure

image

Command prompt failure

image

rallieon commented 2 years ago

@isaacadariku did you ever come up with a solution for this? I'm running into this now.

isaacadariku commented 2 years ago

@isaacadariku did you ever come up with a solution for this? I'm running into this now

@rallieon Yeah I was able to, the issue was apple was rejecting the build, if it's not signed first before uploading. But the package didn't have a way of reporting the feedback from apple.

You will need to sign the build using this run below. Then after that you can go ahead and notarize the build using the snippet below, i.e you will not have to use this package anymore.

- name: Codesign Release Build
        run: /usr/bin/codesign -s "YourDeveloperID" ./$MACOS_APP_RELEASE_PATH/appname.dmg

      - name: Notarize Release Build
        run: |
          xcrun altool --notarize-app \
            --primary-bundle-id "yourAppID" \
            --username "${{ secrets.NOTARIZATION_USERNAME }}" \ //Add to your github secret the notarization account username
            --password "${{ secrets.NOTARIZATION_PASSWORD }}" \ //Add to your github secret the notarization account password
            --asc-provider "yourASCProvider" \
            --file "$MACOS_APP_RELEASE_PATH/appname.dmg"

      # Delay for 1 minute for notarization to be process successfully, before stapling
      - name: Sleep for 3 minutes
        run: sleep 180s
        shell: bash

      - name: "Staple Release Build"
        run: |
          xcrun stapler staple $MACOS_APP_RELEASE_PATH/appname.dmg 

      - name: "Verify Release Build"
        run: |
          spctl --assess -vvv --type install $MACOS_APP_RELEASE_PATH/appname.dmg

       - name: Create Release
rallieon commented 2 years ago

Awesome, I'll give this a try. Thank you!