Skip to content

Commit

Permalink
Merge branch 'feature-py3.11'; v12.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pjkundert committed Mar 4, 2024
2 parents 98ba69b + a76e54b commit c01ccd0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
45 changes: 27 additions & 18 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ PKGID ?= Developer ID Installer: Perry Kundert ($(TEAMID))
BUNDLEID ?= ca.kundert.perry.SLIP39
APIISSUER ?= 5f3b4519-83ae-4e01-8d31-f7db26f68290
APIKEY ?= 5H98J7LKPC
APICREDENTIALS ?= ~/.private_keys/AuthKey_$(APIKEY).p8

#PROVISION ?= ~/Documents/Apple/Certificates/SLIP39_Mac_App_Store_Provisioning.provisionprofile
PROVISION ?= ~/Documents/Apple/Certificates/SLIP39_Mac_General_Provisioning.provisionprofile

Expand All @@ -38,12 +40,12 @@ CXFREEZE_EXT ?= win-$(CXFREEZE_ARCH)-$(CXFREEZE_VER)
SIGNTOOL ?= "c:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86\signtool.exe"


# PY[3] is the target Python interpreter; require 3.9+. Detect if it is named python3 or python.
# PY[3] is the target Python interpreter; require 3.11+. Detect if it is named python3 or python.
PY3 ?= $(shell python3 --version >/dev/null 2>&1 && echo python3 || echo python )
VERSION = $(shell $(PY3) -c 'exec(open("slip39/version.py").read()); print( __version__ )')
PLATFORM ?= $(shell $(PY3) -c "import sys; print( sys.platform )" )
ifeq ($(PLATFORM),darwin)
INSTALLER := dmg
INSTALLER := pkg
else ifeq ($(PLATFORM),win32)
INSTALLER := msi
else
Expand Down Expand Up @@ -210,7 +212,7 @@ $(VENV_LOCAL)/$(VENV_NAME):
@rm -rf $@ && $(PY3) -m venv $(VENV_OPTS) $@ \
&& cd $@ && git clone $(GHUB_REPO) -b $(GHUB_BRCH) \
&& . ./bin/activate \
&& make -C $(GHUB_NAME) install-dev install
&& make -C $(GHUB_NAME) install-tests install

# Activate a given VirtualEnv, and go to its python-slip39 installation
# o Creates a custom venv-activate.sh script in the venv, and uses it start
Expand All @@ -237,8 +239,8 @@ dist/slip39-$(VERSION)-py3-none-any.whl: build-check FORCE
install: dist/slip39-$(VERSION)-py3-none-any.whl FORCE
$(PY3) -m pip install --force-reinstall $<[all]

install-dev:
$(PY3) -m pip install --upgrade -r requirements-dev.txt
install-tests:
$(PY3) -m pip install --upgrade -r requirements-tests.txt

# Building / Signing / Notarizing and Uploading the macOS or win32 App
# o TODO: no signed and notarized package yet accepted for upload by macOS App Store
Expand Down Expand Up @@ -303,7 +305,7 @@ dist/slip39-$(VERSION)-win64.msi: build/exe.$(CXFREEZE_EXT)/SLIP-39.exe # signin
#
dist/SLIP-39-$(VERSION).dmg: dist/SLIP-39.app
@echo -e "\n\n*** Creating and signing DMG $@..."
npx create-dmg --overwrite $<
npx create-dmg -v --overwrite --identity "$(PKGID)" $< dist/
mv "SLIP-39 $(VERSION).dmg" "$@"
@echo "Checking signature..."; ./SLIP-39.metadata/check-signature $@

Expand Down Expand Up @@ -428,27 +430,34 @@ dist/SLIP-39-$(VERSION).pkg-verify: dist/SLIP-39-$(VERSION).pkg
#
# macOS Package Notarization
# See: https://oozou.com/blog/scripting-notarization-for-macos-app-distribution-38
# https://developer.apple.com/documentation/technotes/tn3147-migrating-to-the-latest-notarization-tool
# o The .pkg version doesn't work due to incorrect signing keys for the .pkg (unknown reason)
#
# Submits the version's .pkg for notariation, and waits for completion (success or failure).
# - The output contains the Submission ID, required to obtain the JSON notary log
dist/SLIP-39-$(VERSION).pkg.notarization: dist/SLIP-39-$(VERSION).pkg dist/SLIP-39-$(VERSION).pkg-verify
jq -r '.["notarization-upload"]["RequestUUID"]' $@ 2>/dev/null \
|| xcrun altool --notarize-app -f $< \
--primary-bundle-id $(BUNDLEID) \
--team-id $(TEAMID) \
--apiKey $(APIKEY) --apiIssuer $(APIISSUER) \
--output-format json \
grep "Submission ID" $@ 2>/dev/null \
|| xcrun notarytool submit \
--issuer $(APIISSUER) \
--key-id $(APIKEY) \
--key $(APICREDENTIALS) \
--wait \
$< \
> $@

dist/SLIP-39-$(VERSION).pkg.notarization-status: dist/SLIP-39-$(VERSION).pkg.notarization FORCE
[ -s $@ ] && grep "Status: success" $@ \
|| xcrun altool \
--apiKey $(APIKEY) --apiIssuer $(APIISSUER) \
--notarization-info $$( jq -r '.["notarization-upload"]["RequestUUID"]' $< ) \
| tee -a $@
|| xcrun notarytool log \
--issuer $(APIISSUER) \
--key-id $(APIKEY) \
--key $(APICREDENTIALS) \
$$( grep -A1 "Submission ID" < $< | grep "id:" | awk '{print $$2}' ) \
> $@

# Check notarization status 'til Status: success, then staple it to ...pkg, and create ...pkg.valid marker file
dist/SLIP-39-$(VERSION).pkg.valid: dist/SLIP-39-$(VERSION).pkg.notarization-status FORCE
@grep "Status: success" $< || \
( tail -10 $<; echo -e "\n\n!!! App not yet notarized; try again in a few seconds..."; false )
@grep "Ready for distribution" $< || \
( tail -10 $<; echo -e "\n\n!!! App not yet notarized..."; false )
( [ -r $@ ] ) \
&& ( echo -e "\n\n*** Notarization complete; refreshing $@" && touch $@ ) \
|| ( \
Expand Down
2 changes: 1 addition & 1 deletion slip39/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version_info__ = ( 11, 2, 1 )
__version_info__ = ( 12, 0, 0 )
__version__ = '.'.join( map( str, __version_info__ ))

0 comments on commit c01ccd0

Please sign in to comment.