Build Deploy - Satellite-im/Core-PWA GitHub Wiki

Web Version

Build the project with dotenv yarn build

This deposits a built version in the /dist folder that you can host on your own static hosting provider.

Native Apps, Manual Builds

Native Apps not supported and broken in Alpha Release

We use Capacitor to help build native apps. Current targets are:

  • Android (apk)
  • Windows (Electron x64)
  • Mac (Electron x64, arm64)
  • Linux (Electron, Appimage for x64 and arm64)

The first time you build, you will need to clone down the submodules:

git submodule update --init --recursive

Android

Native Apps not supported and broken in Alpha Release

To build the android version of the app, you need to have android studio installed on your system. You will need to add some things to the submodule you downloaded. To set git to not track them, run:

git config submodule.android.ignore all

Open Android Studio and pull up the Project Structure Dialog (on mac this is cmd + ;. This will give you the SDK and JDK location you will need in a moment.

In your text editor, add the JDK location to a file called local.properties in the android build folder. You may have to make this. For me, this file contains one line: sdk.dir=/Users/<username>/Library/Android/sdk Now in gradle.properties, add the line: org.gradle.java.home=/Users/<username>/Library/Java/JavaVirtualMachines/corretto-1.8.0_302/Contents/Home

You need JAVA)HOME, ANDROID_HOME, and ANDROID_SDK_ROOT in your path. Before running the build command, make sure those exist. Something like:

export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home
export ANDROID_HOME=/Users/$USER/Library/Android/sdk
export ANDROID_SDK_ROOT=/Users/$USER/Library/Android/sdk

Now to build the android version, run: yarn android-generate

This builds the project, copies the new dist into the android folder, and then syncs the newly built web version with the android project.

You can find the generated APK at: /android/app/build/outputs/apk/debug/app-debug.apk

Desktop

Native Apps not supported and broken in Alpha Release

On Linux you need wine installed to build windows

You cannot build macOS dmg's from anything except a mac source

First Time -

Copy the .env file into the electron folder, and do a dotenv yarn to install dependencies in the electron folder.

Windows Codesigning

Follow the instructions here to be able to sign the code.

Bump the version number to match the tag

In the electron folder, update the version number in the package.json file to match the tag number

dotenv yarn electron-windows dotenv yarn electron-mac dotenv yarn electron-linux

The builds are deposited into the /electron/dist folder

Grab the dmg, exe, and appimage files. Block maps will be used in the future for delta updates but aren't used on a new install.

Native Apps, Automated Build

Native Apps not supported and broken in Alpha Release

We use Github Actions to generate the native builds. On the main branch (or your main branch in your fork), click Releases > Draft New Release

Click New Tag, type in your new tag name and select + create new tag, leave the target as the main branch (main has to be hardcoded in the changelog tool).

Set your release title (we like to use "Satellite-" and click Publish Release. A release usually takes about 20 minutes and you can check the status in the Actions tab.

Creating a Release on Dev

  1. Navigate to the project on Github > Click 'Releases'.
  2. Click 'Draft a new release' in the top right.
  3. In the dropdown for 'Choose a tag', type in what you want your tag name to be. At the time of this documentation, we were creating tag '0.1.1'. Then select 'Create new tag: on publish'.
  4. Leave your target as 'dev'
  5. Set your release title as 'Satellite-<tag-name, eg 0.1.1>', for example 'Satellite-0.1.1'
  6. Click publish release
  7. Update package.json to manually make the version match release

The changelog generation takes a few minutes to complete

Netlify takes a few minutes to build. Once it is done, you can verify the release went ok.

Promoting the release to Main/Prod

  1. Create a pull request on Github
  2. Squash and Merge. Name it based on the release.
⚠️ **GitHub.com Fallback** ⚠️