Skip to content

Commit

Permalink
- Use 3rd party notarize action
Browse files Browse the repository at this point in the history
- Notarize pkg
  • Loading branch information
ParticleG committed Jul 15, 2022
1 parent bbc919e commit 9a84185
Showing 1 changed file with 20 additions and 31 deletions.
51 changes: 20 additions & 31 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,36 +289,12 @@ runs:
-exportPath ./ \
-exportOptionsPlist ./love/platform/xcode/macosx/macos-copy-app.plist
- name: Notarize application bundle
shell: python3 {0}
run: |
import json
import os
import subprocess
temp_filename = './forNotarize.zip'
os.system(
'ditto -c -k --sequesterRsrc --keepParent '
'./${{ inputs.product-name }}.app ' +
temp_filename
)
result = json.loads(
subprocess.run(
'xcrun notarytool submit ' + temp_filename +
' --output-format json --wait'
' --apple-id "${{ inputs.account-username }}"'
' --password "${{ inputs.account-password }}"'
' --team-id "${{ inputs.team-id }}"',
stdout=subprocess.PIPE,
shell=True
).stdout.decode('utf-8')
)
print(result)
if result['status'] == 'Accepted':
os.system('xcrun stapler staple ./${{ inputs.product-name }}.app')
os.remove(temp_filename)
else:
print('Notarization failed: ' + result['message'])
exit(1)
uses: cocoalibs/xcode-notarization-action@v1
with:
app-path: "./${{ inputs.product-name }}.app"
apple-id: "${{ inputs.account-username }}"
password: "${{ inputs.account-password }}"
team-id: "${{ inputs.team-id }}"
- name: Ensure output folder
shell: bash
run: |
Expand All @@ -333,7 +309,20 @@ runs:
security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_FILENAME
identity=$(security find-identity -v | grep -o 'Developer ID Installer[^"]*')
productbuild --component ./${{ inputs.product-name }}.app /Applications ./${{ inputs.product-name }}_unsigned.pkg
productsign --sign "$identity" ./${{ inputs.product-name }}_unsigned.pkg ${{ inputs.output-folder }}/${{ inputs.product-name }}.pkg
productsign --sign "$identity" ./${{ inputs.product-name }}_unsigned.pkg ./${{ inputs.product-name }}.pkg
- name: Notarize installer pkg
if: "${{ inputs.developer-id-installer-base64 != '' && inputs.developer-id-installer-password != '' }}"
uses: cocoalibs/xcode-notarization-action@v1
with:
app-path: "./${{ inputs.product-name }}.pkg"
apple-id: "${{ inputs.account-username }}"
password: "${{ inputs.account-password }}"
team-id: "${{ inputs.team-id }}"
- name: Move installer pkg
if: "${{ inputs.developer-id-installer-base64 != '' && inputs.developer-id-installer-password != '' }}"
shell: bash
run: |
mv ./${{ inputs.product-name }}.pkg ${{ inputs.output-folder }}/${{ inputs.product-name }}.pkg
- name: Create dmg file
if: "${{ inputs.dmg-background-path != '' && inputs.dmg-icon-position != '' && inputs.dmg-icon-size != '' && inputs.dmg-link-position != '' && inputs.dmg-text-size != '' && inputs.dmg-volume-icon-path != '' && inputs.dmg-volume-name != '' && inputs.dmg-window-position != '' && inputs.dmg-window-size != '' }}"
shell: bash
Expand Down

0 comments on commit 9a84185

Please sign in to comment.