From 6e8e00b6f094fbab63a03063979e9f779575ccf6 Mon Sep 17 00:00:00 2001 From: Paul Puey Date: Mon, 24 Jul 2023 21:12:48 -0700 Subject: [PATCH] Update deploy instructions in readme - Update package.json with additional gitVersionFile script - Update deploy-config.sample.json with new params --- README.md | 47 ++++++++++++++++++++++++++++++++++----- deploy-config.sample.json | 6 ++++- package.json | 3 ++- 3 files changed, 49 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2e2b03991d2..aa3ee8e05b5 100644 --- a/README.md +++ b/README.md @@ -77,8 +77,6 @@ Otherwise, to get an APK, do: ### Build release version of app -First, run `yarn update-version` to copy the `package.json` version into the native project files, and to assign a unique build number. - #### iOS - Open `edge-react-gui/ios/edge.xcworkspace` in Xcode @@ -98,18 +96,41 @@ First, run `yarn update-version` to copy the `package.json` version into the nat --- -## Deploying (macOS Only) +## Deploying (MacOS Only) + +This repo includes several utility scripts that can be used in a CI/CD +environment to build and deploy a release version of the app. The +included `Jenkinsfile` utilizes all the scripts but you are free to +use them in your own CI environment. + +### Update the version file + +Set `BUILD_REPO_URL` to the URL of an empty Git repo that will hold a version +file that will be auto updated to increment the version and build number. Then +run the following to update a local `release-version.json` file + + yarn gitVersionFile + +Update the project files based on the version in `release-version.json` + + yarn updateVersion + + +### Build, sign, and deploy -The included `deploy.js` is a script to automate building, signing, and deploying release builds of Edge. It provides the following: +The included `deploy.ts` is a script to automate building, signing, and deploying release builds of Edge. It provides the following: - Auto sign Android APK with Android keystore files - Auto sign iOS IPA with provisioning profiles +- Build release version of iOS and Android +- Upload iOS IPA and Android APK files to AppCenter for developer testing ### To Use -- Run `yarn update-version` to set up your build number & version. - Set the env var KEYCHAIN_PASSWORD to the keychain password of the current user - Copy the `deploy-config.sample.json` to `deploy-config.json` and edit the parameters accordingly. You'll need a HockeyApp account to get ids and keys +- Download a copy of the Google Bundle tool (https://github.com/google/bundletool/releases) +- Set the `bundleToolPath` in `deploy-config.json` to the path to the bundle tool `.jar` file - Put any Android keystore files into `edge-react-gui/keystores/` - If using Firebase, put your account's `google-services.json` and `GoogleService-Info.plist` into `edge-react-gui/` - Install xcpretty `sudo gem install xcpretty` @@ -121,6 +142,22 @@ yarn deploy edge ios master yarn deploy edge android master ``` +## Fastlane support + +This repo supports utilizing Fastlane to automate updates to iOS Provisioning +Profiles. To use Fastlane, set the following environment variables and run +`yarn deploy` as mentioned above + + BUILD_REPO_URL // Git repo used to store encrypted provisioning + // keys. + // Will be shared with the gitVersionFile.ts script + FASTLANE_USER // Apple ID email + FASTLANE_PASSWORD // Apple ID password + GITHUB_SSH_KEY // (Optional) SSH Key file to use when accessing + // BUILD_REPO_URL + MATCH_KEYCHAIN_PASSWORD // Password to unlock the current users keychain + MATCH_PASSWORD // Password used to encrypt profile information + // before being saved to the BUILD_REPO_URL --- ## Debugging diff --git a/deploy-config.sample.json b/deploy-config.sample.json index d3d0db706fd..cc33639e1e6 100644 --- a/deploy-config.sample.json +++ b/deploy-config.sample.json @@ -1,12 +1,13 @@ { "edge": { "productName": "Edge Wallet", + "xcodeProject": "edge.xcodeproj", "xcodeWorkspace": "edge.xcworkspace", "xcodeScheme": "edge", "androidKeyStore": "edge-release-keystore.jks", "androidKeyStoreAlias": "edge", "androidKeyStorePassword": "xxxxxxxxx", - "androidTask": "assembleRelease", + "androidTask": "bundleRelease", "hockeyAppToken": "xxxxx", "hockeyAppTags": "internal", "bugsnagApiKey": "xxxxxxxxxx", @@ -14,6 +15,9 @@ "appCenterGroupName": "xxxxxxxxxx", "appCenterDistroGroup": "xxxxxxxxxx", "appleDeveloperTeamId": "xxxxxxxxxx", + "appleDeveloperTeamName": "edge", + "bundleId": "co.edgesecure.app", + "bundleToolPath": "/Users/jenkins/bin/bundletool-all-1.11.2.jar", "ios": { "master": { "hockeyAppId": "xxxxxxxxx" diff --git a/package.json b/package.json index 77b49f6dfb1..7409ca48dda 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "fix-java": "cd android; ./format-java.sh", "fix-swift": "swift-format format -i ios/*.swift", "fix": "npm run lint -- --fix && yarn-deduplicate", + "gitVersionFile": "node -r sucrase/register scripts/gitVersionFile.ts", "ios": "react-native run-ios", "lint": "eslint .", "localize": "node -r sucrase/register ./scripts/localizeLanguage.ts; git add ./src/locales/strings", @@ -49,7 +50,7 @@ "start": "react-native start", "test": "jest", "theme": "node -r sucrase/register ./scripts/themeServer.ts", - "update-version": "node -r sucrase/register scripts/updateVersion.ts", + "updateVersion": "node -r sucrase/register scripts/updateVersion.ts", "updot": "EDGE_MODE=development updot", "watch": "npm test -- --watch" },