Add script to inject iOS app ID to public/.well-known/apple-app-site-association (#66)

* Add script to inject iOS app ID to public/.well-known/apple-app-site-association

* package.json

* Fix typo

* Fix typo

* Fix build

* Debug

* Updated to use "dist" folder
This commit is contained in:
Rui 2023-10-10 15:58:26 -07:00 committed by GitHub
parent 67ecbd75b4
commit f9e301b3f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View File

@ -33,11 +33,13 @@ jobs:
AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }}
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }}
STATUS_PAGE_SCRIPT_URI: ${{ secrets.STATUS_PAGE_SCRIPT_URI }}
IOS_APP_ID: ${{ secrets.IOS_APP_ID }}
run: |
pnpm run build
pnpm run build:inject-amplitude
pnpm run build:inject-bugsnag
pnpm run build:inject-statuspage
sh scripts/inject-app-deeplinks.sh
- name: Upload to IPFS via web3.storage
uses: dydxprotocol/add-to-web3@v1

View File

@ -10,6 +10,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"build:inject-app-deeplinks": "sh scripts/inject-app-deeplinks.sh",
"build:inject-amplitude": "node scripts/inject-amplitude.js",
"build:inject-bugsnag": "node scripts/inject-bugsnag.js",
"build:inject-statuspage": "node scripts/inject-statuspage.js",

19
scripts/inject-app-deeplinks.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
source="dist/.well-known/apple-app-site-association"
if [ ! -f "$source" ]; then
echo "Error: $source file not found"
exit 1
fi
app_id=$IOS_APP_ID
if [ -z "$app_id" ]; then
echo "Error: IOS_APP_ID is empty"
exit 1
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/{PLACE_YOUR_APP_ID_HERE}/$app_id/g" $source
else
sed -i "s/{PLACE_YOUR_APP_ID_HERE}/$app_id/g" $source
fi