The generation of the OpenJDK installer depends on an open-source utility tool Packages. The application must be installed before running the installer generation task.
brew install --cask packages
./packagesbuild.sh --major_version 17 --full_version 17.0.3_7 --input_directory /path/to/jdk --output_directory OpenJDK17U-jdk_x64_mac_hotspot_17.0.3_7.pkg --jvm hotspot --architecture x86_64 --type jdk
--sign <certificate name>