Skip to content

Commit

Permalink
changed to a dmg style package in macos
Browse files Browse the repository at this point in the history
  • Loading branch information
himwho committed May 21, 2024
1 parent 4a9fee3 commit 880418e
Showing 1 changed file with 22 additions and 48 deletions.
70 changes: 22 additions & 48 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,54 +55,28 @@ jobs:
shell: bash
run: cmake --build . --config $BUILD_TYPE

- name: Package (macos)
if: runner.os == 'MacOS'
working-directory: ${{runner.workspace}}/build
shell: bash
env:
DIST_DIR: ${{runner.workspace}}/build/M1-Notepad_artefacts/Release
INSTALL_DIR: /Library/Audio/Plug-Ins
AAX_INSTALL_DIR: /Library/Application\ Support/Avid/Audio/Plug-Ins
BUNDLE_ID: ${{ env.BUNDLE_ID }}
VERSION: ${{ env.VERSION }}
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_INSTALLER_CERT: ${{ secrets.MACOS_INSTALLER_CERT }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
run: |
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
echo $MACOS_INSTALLER_CERT | base64 --decode > installer.p12
RANDOM_PWD=`date | md5`
security create-keychain -p ${RANDOM_PWD} build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p ${RANDOM_PWD} build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security import installer.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/productbuild
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k ${RANDOM_PWD} build.keychain
/usr/bin/codesign --timestamp --force --deep -s "Developer ID Application" ${DIST_DIR}/AU/M1-Notepad.component -v
/usr/bin/codesign --timestamp --force --deep -s "Developer ID Application" ${DIST_DIR}/VST3/M1-Notepad.vst3 -v
/usr/bin/codesign --timestamp --force --deep -s "Developer ID Application" ${DIST_DIR}/AAX/M1-Notepad.aaxplugin -v
pkgbuild --identifier ${BUNDLE_ID}.au --version ${VERSION} --component ${DIST_DIR}/AU/M1-Notepad.component \
--install-location "${INSTALL_DIR}/Components" ${DIST_DIR}/M1-Notepad.au.pkg
pkgbuild --identifier ${BUNDLE_ID}.vst3 --version ${VERSION} --component ${DIST_DIR}/VST3/M1-Notepad.vst3 \
--install-location "${INSTALL_DIR}/VST3" ${DIST_DIR}/M1-Notepad.vst3.pkg
pkgbuild --identifier ${BUNDLE_ID}.aaxplugin --version ${VERSION} --component ${DIST_DIR}/AAX/M1-Notepad.aaxplugin \
--install-location "${AAX_INSTALL_DIR}" ${DIST_DIR}/M1-Notepad.aaxplugin.pkg
productbuild --synthesize \
--package "${DIST_DIR}/M1-Notepad.au.pkg" \
--package "${DIST_DIR}/M1-Notepad.vst3.pkg" \
--package "${DIST_DIR}/M1-Notepad.aaxplugin.pkg" \
distribution.xml
productbuild --sign "Developer ID Installer" --distribution distribution.xml --package-path ${DIST_DIR} ${DIST_DIR}/M1-Notepad.pkg
- name: Notarize (macos)
if: runner.os == 'MacOS'
uses: GuillaumeFalourd/notary-tools@v1
with:
product-path: "${{runner.workspace}}/build/M1-Notepad_artefacts/Release/M1-Notepad.pkg"
apple_id: ${{ secrets.APPLE_USERNAME }}
password: ${{ secrets.ALTOOL_APPPASS }}
team_id: ${{ secrets.APPLE_TEAM_CODE }}
staple: 'true'

- name: Create DMG, Notarize and Staple (macOS)
if: ${{ matrix.name == 'macOS' }}
run: |
# workaround for https://github.com/LinusU/node-appdmg/issues/234
python3 -m pip install setuptools --break-system-packages
npm install -g appdmg
mkdir -p packaging/dmg
# Create directories for the dmg symlinks
sudo mkdir -m 755 -p /Library/Audio/Plug-Ins/Components && sudo mkdir -m 755 -p /Library/Audio/Plug-Ins/VST3 && sudo mkdir -m 755 -p /Library/Application\ Support/Avid/Audio/Plug-Ins
ln -s /Library/Audio/Plug-Ins/Components "packaging/dmg/Your Mac's Component folder"
ln -s /Library/Audio/Plug-Ins/VST3 "packaging/dmg/Your Mac's VST3 folder"
ln -s /Library/Application\ Support/Avid/Audio/Plug-Ins "packaging/dmg/Your Mac's AAX folder"
mv ${DIST_DIR}/VST3/M1-Notepad.vst3 packaging/dmg
mv "${DIST_DIR}/AU/M1-Notepad.component" packaging/dmg
mv "${DIST_DIR}/AAX/M1-Notepad.aaxplugin" packaging/dmg
# Run appdmg to create the .dmg
cd packaging && appdmg dmg.json "M1-Notepad.dmg"
xcrun notarytool submit "M1-Notepad.dmg" --apple-id ${{ secrets.APPLE_USERNAME }} --password ${{ secrets.ALTOOL_APPPASS }} --team-id ${{ secrets.APPLE_TEAM_CODE }} --wait
xcrun stapler staple "M1-Notepad.dmg"
- name: InnoSetup Installer (windows)
if: runner.os == 'Windows'
Expand Down

0 comments on commit 880418e

Please sign in to comment.