Prerequisites
In order to generate a macOS installer for Apache NetBeans you will need the following prerequisites:
- An Apache Apple Developer ID Certificate
See here for more details: https://infra.apache.org/digicert-use.html
And an example of the JIRA ticket you need to join: https://issues.apache.org/jira/browse/INFRA-20302 - Swift https://www.apple.com/swift/
Elements of the macOS installer require Swift installed on the computer generating the installer. - An app specific password associated with your Apache Apple Developer account, in order to notorize the installer before distributing it.
See the following for more information:
https://support.apple.com/en-us/HT204397
https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow#3087734
Steps for Building
For the code snippets, you will need to update the following values according to the version of Apache NetBeans you are creating the installer for
XX.X = Version of Apache NetBeans generating the installer for, i.e. 12.4
vcX = Voting Candidate number
YYMMDD = The date the installer is being generated
- Download both the `dist` and `distpreparation` folders from Jenkins, and unzip it in a directory of your choice.
Apache NetBeans is built on the Apache Jenkins: https://ci-builds.apache.org/job/Netbeans/job/netbeans-TLP/job/netbeans/ Based on the version your generating an installer for ensure you download the correct files for the release/job as outlined in the main Apache NetBeans Release vote thread. Update the permissions of the `installermac.sh` script which will be used to create the installer
$ chmod 777 distpreparation/netbeans/XX.X/vcX/installer/installermac.sh
Generate the installer
$ distpreparation/netbeans/XX.X/vcX/installer/installermac.sh dist/netbeans/XX.X/vcX/netbeans-XX.X-bin.zip XX.X YYMMDD certificate.txt
certificate.txt is a file containing your Apple Developer ID Certificate
Test the Installer locally
In order to test the installer works locally you will need to first remove files created during the previous step, once this is removed you can install Apache NetBeans as normal from the newly created installer:
rm -rf distpreparation/netbeans/XX.X/vcX/installer/nbbuild/installer/mac/newbuild/netBeans/nbide/build
Installers will be generated under dist/bundles
Notorize & Staple Installer
xcrun altool --notarize-app --primary-bundle-id "org.apache.netbeans-XX.X" -u "AC_USERNAME" -p "@keychain:AC_PASSWORD" --file Apache-NetBeans-XX.X-bin-macosx.dmg
Notarising the application can take a few minutes, you can check the progress of the notorization process via (where UUID is the UUID provided when you started the notarization process):
$ xcrun altool --notarization-info <UUID> -u "AC_USERNAME" -p "@keychain:AC_PASSWORD""AC_USERNAME" = Your Apache Apple Developer username, for example: johnmcdonnell@apache.org
Once the notarisation process is complete, you need staple this to your distribution:
xcrun stapler staple Apache-NetBeans-XX.X-bin-macosx.dmg
- Sign installers & upload to SVN & start vote thread
Same steps as required for the Windows and Linux installers