-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
46 lines (39 loc) · 1.99 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
.PHONY: native mac web server
native:
cargo build --release
mac: mac_bundle
codesign -f -o runtime --timestamp -s - TPS\ Cube.app
mac_release: mac_bundle
codesign -f -o runtime --timestamp -s "Developer ID" TPS\ Cube.app
rm -f TPS\ Cube.zip
zip -r TPS\ Cube.zip TPS\ Cube.app
xcrun notarytool submit TPS\ Cube.zip --wait --keychain-profile "personal"
rm -f TPS\ Cube.zip
sleep 30
xcrun stapler staple TPS\ Cube.app
dmgbuild -s dmgbuild.py TPS\ Cube tpscube.dmg
rm -rf TPS\ Cube.app
codesign --timestamp -s "Developer ID" tpscube.dmg
mac_bundle: native
mkdir -p TPS\ Cube.app/Contents/MacOS
mkdir -p TPS\ Cube.app/Contents/Resources
cp Info.plist TPS\ Cube.app/Contents/
cp target/release/tpscube TPS\ Cube.app/Contents/MacOS/
cp images/icon.icns TPS\ Cube.app/Contents/Resources/
web:
RUSTFLAGS=--cfg=web_sys_unstable_apis cargo build --release --lib --target wasm32-unknown-unknown --no-default-features --features wasm
wasm-bindgen target/wasm32-unknown-unknown/release/tpscube.wasm --out-dir web --no-modules --no-typescript
cat web/manifest.appcache.template | sed s/HASH/`dd if=/dev/urandom bs=1 count=32 | md5 -q`/ > web/manifest.appcache
server: web
cd web && python3 -m http.server
deploy: web
gzip -9 -k -f web/tpscube_bg.wasm
aws s3 cp --profile personal web/index.html s3://tpscube/index.html
aws s3 cp --profile personal web/tpscube.js s3://tpscube/tpscube.js
aws s3 cp --profile personal web/favicon_16x16.png s3://tpscube/favicon_16x16.png
aws s3 cp --profile personal web/favicon_32x32.png s3://tpscube/favicon_32x32.png
aws s3 cp --profile personal web/favicon_128x128.png s3://tpscube/favicon_128x128.png
aws s3 cp --profile personal web/favicon_180x180.png s3://tpscube/favicon_180x180.png
aws s3 cp --profile personal web/manifest.appcache s3://tpscube/manifest.appcache
aws s3 cp --profile personal --content-encoding gzip web/tpscube_bg.wasm.gz s3://tpscube/tpscube_bg.wasm
aws cloudfront create-invalidation --profile personal --distribution-id E1CI0QZD6NW0J0 --paths "/*"