Skip to content

Commit

Permalink
Update build script and requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
dingwen07 committed May 22, 2024
1 parent 274e47d commit f05b686
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
36 changes: 34 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
#!/bin/bash
/opt/homebrew/bin/trash ./build ./dist
/opt/homebrew/bin/trash ./test/AutoArchive.app
# Apple Developer variables
APPLE_ID=$(op read "op://Private/z4sp6gvcgzeejgvf6mufvqwrme/username")
APP_PASSWORD=$(op read "op://Private/z4sp6gvcgzeejgvf6mufvqwrme/App Password/App Password")
TEAM_ID=$(op read "op://Personal/z4sp6gvcgzeejgvf6mufvqwrme/Developer/Team ID")


# if not exist ./test, create it
if [ ! -d "./test" ]; then
mkdir ./test
fi
trash ./build ./dist
trash ./test/AutoArchive.app
trash ./dist/AutoArchive.zip

source ./venv/bin/activate

python3 setup.py py2app

# codesign
CODESIGN_VARS="--deep --force --verify --verbose --timestamp --options runtime"
# find .so under ./dist/AutoArchive.app/
find ./dist/AutoArchive.app/ -name "*.so" -exec codesign $CODESIGN_VARS -s "$TEAM_ID" {} \;
codesign $CODESIGN_VARS -s "$TEAM_ID" ./dist/AutoArchive.app

/usr/bin/ditto -c -k --keepParent ./dist/AutoArchive.app ./dist/AutoArchive.zip
cp -R ./dist/AutoArchive.app ./test/AutoArchive.app

# notarization
read -p "Press enter to submit for Notarization"

xcrun notarytool submit --apple-id $APPLE_ID --password $APP_PASSWORD --team-id $TEAM_ID --wait ./dist/AutoArchive.zip

read -p "Press enter to Staple"

xcrun stapler staple ./dist/AutoArchive.app
spctl -vvv --assess --type exec ./dist/AutoArchive.app

trash ./dist/AutoArchive.zip
/usr/bin/ditto -c -k --keepParent ./dist/AutoArchive.app ./dist/AutoArchive.zip
7 changes: 2 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
modulegraph~=0.19.6
py2app~=0.28.6
macholib~=1.16.3
setuptools~=69.0.3
altgraph~=0.17.4
py2app~=0.28.7
setuptools<70.0.0

0 comments on commit f05b686

Please sign in to comment.