Skip to content

Commit

Permalink
Fix issue postinstaller not run in macos
Browse files Browse the repository at this point in the history
  • Loading branch information
hientominh committed Sep 13, 2024
1 parent 6f0aa4e commit 02fc3e6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:

update-latest-version:
runs-on: ubuntu-latest
if: needs.set-public-provider.outputs.public_provider == 'aws-s3'
needs: [get-update-version, set-public-provider, build-linux-x64, build-macos-x64, build-macos-arm64, build-windows-x64]
steps:
- name: Update latest version
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/template-build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ jobs:
cd engine
productsign --sign "Developer ID Installer: ${{ secrets.DEVELOPER_ID }}" ${{ steps.set-output-params.outputs.package_name }}.pkg ${{ steps.set-output-params.outputs.package_name }}$-signed.pkg
rm ${{ steps.set-output-params.outputs.package_name }}.pkg
mv ${{ steps.set-output-params.outputs.package_name }}$-signed.pkg ${{ steps.set-output-params.outputs.package_name }}.pkg
mv ${{ steps.set-output-params.outputs.package_name }}$-signed.pkg Distribution.pkg
productbuild --synthesize --package Distribution.pkg Distribution.xml
sed -i '' 's/require-scripts="false"/require-scripts="true"/' Distribution.xml
cat Distribution.xml
productbuild --distribution Distribution.xml --sign "Developer ID Installer: ${{ secrets.DEVELOPER_ID }}" --package-path . ${{ steps.set-output-params.outputs.package_name }}.pkg
xcrun notarytool submit ${{ steps.set-output-params.outputs.package_name }}.pkg --apple-id ${{ secrets.APPLE_ID }} --password ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} --team-id ${{ secrets.APPLE_TEAM_ID }} --wait
- name: Package
Expand Down
6 changes: 3 additions & 3 deletions engine/templates/macos/create_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ CONFIGURATION_FILE_NAME=$6
UNINSTALLER_FILE_NAME=$7

mkdir installer
mkdir scripts
mkdir Scripts

cp $SOURCE_BINARY_PATH installer/$DESTINATION_BINARY_NAME

export DESTINATION_BINARY_NAME
cp post-installer.sh scripts/post-installer.sh
cp postinstall Scripts/postinstall
sed -i '' '2s/.*/DESTINATION_BINARY_NAME=\$DESTINATION_BINARY_NAME/' $PACKAGE_NAME/DEBIAN/postinst

export DATA_FOLDER_NAME CONFIGURATION_FILE_NAME UNINSTALLER_FILE_NAME
Expand All @@ -22,4 +22,4 @@ sed -i '' "3s/.*/DATA_FOLDER_NAME=$DATA_FOLDER_NAME/" installer/$UNINSTALLER_FIL
sed -i '' "4s/.*/CONFIGURATION_FILE_NAME=$CONFIGURATION_FILE_NAME/" installer/$UNINSTALLER_FILE_NAME
sed -i '' "5s/.*/UNINSTALLER_FILE_NAME=$UNINSTALLER_FILE_NAME/" installer/$UNINSTALLER_FILE_NAME

pkgbuild --identifier ai.cortexcpp.pkg --version $VERSION --scripts scripts --install-location /usr/local/bin --root ./installer ${PACKAGE_NAME}.pkg
pkgbuild --identifier ai.cortexcpp.pkg --version $VERSION --scripts Scripts --install-location /usr/local/bin --root ./installer ${PACKAGE_NAME}.pkg
File renamed without changes.

0 comments on commit 02fc3e6

Please sign in to comment.