This document alongside [Releasing.md](RELEASING.md) primarily cover our internal build process for release builds, if you are an external contributor please refer to [Contributing.md](CONTRIBUTING.md) for building instructions.
This document alongside [Releasing.md](RELEASING.md) primarily covers our internal build process for release builds, if you are an external contributor please refer to [Contributing.md](CONTRIBUTING.md) for building instructions.
## Automated
Automatic building of session binaries is done using github actions. Windows and linux binaries will build right out of the box but there are some extra steps needed for Mac OS
### Mac OS
<details>
<summary>Mac</summary>
The build script for Mac OS requires you to have a valid `Developer ID Application` certificate. Without this the build script cannot sign and notarize the mac binary which is needed for Catalina 10.15 and above.
If you would like to disable this then comment out `"afterSign": "build/notarize.js",` in package.json.
If you would like to disable this then comment out `"afterSign": "build/notarize.js",` in [package.json](./package.json).
You will also need an [App-specific password](https://support.apple.com/en-al/HT204397) for the apple account you wish to notarize with
@ -19,7 +20,7 @@ Once you have your `Developer ID Application` you need to export it into a `.p12
We need to Base64 encode this file, so run the following command:
- Value: The password that was set when the certificate was exported.
- Name: `MAC_CERTIFICATE_PASSWORD`
- Value: The password that was set when the certificate was exported.
3. Apple ID
- Name: `SIGNING_APPLE_ID`
- Value: The apple id (email) to use for signing
- Name: `SIGNING_APPLE_ID`
- Value: The apple id (email) to use for signing
4. Apple Password
- Name: `SIGNING_APP_PASSWORD`
- Value: The app-specific password that was generated for the apple id
- Name: `SIGNING_APP_PASSWORD`
- Value: The app-specific password that was generated for the apple id
5. Team ID (Optional)
- Name: `SIGNING_TEAM_ID`
- Value: The apple team id if you're sigining the application for a team
- Name: `SIGNING_TEAM_ID`
- Value: The apple team id if you're signing the application for a team
## Manual
</details>
### Node version
## Manual
You will need node `18.15.0`.
This can be done by using [nvm](https://github.com/nvm-sh/nvm) and running `nvm use` or you can install it manually.
Once nvm is installed, just run `nvm install` to install the version from the `.nvmrc` file and then `nvm use` to use it.
Follow the instructions in [Contributing.md](CONTRIBUTING.md) to set up your development environment.
### Prerequisites
<details>
<summary>Linux</summary>
Here are the steps to build the app for Linux:
The [rpm](https://rpm.org) package is required for running the build-release script on Linux. Run the appropriate command to install the `rpm` package:
```
sudo apt-get install python2 git-lfs
git lfs install
# install nvm by following their github README
nvm install # install the current node version used in this project
nvm use # use the current node version used in this project
npm install -g yarn # install yarn globally for this node version
yarn install --frozen-lockfile # install all dependencies of this project
yarn build-everything # transpile and assemble files
yarn start-prod # start the app on production mode (currently this is the only one supported)
```shell
sudo pacman -S rpm # Arch
```
</details>
<details>
<summary>Windows</summary>
Building on windows should work straight out of the box, but if it fails then you will need to run the following:
@ -89,61 +72,35 @@ npm config set msvs_version 2015
<details>
<summary>Mac</summary>
If you are going (and only if) to distribute the binary then make sure you have a `Developer ID Application` certificate in your keychain.
If you are going (and only if) to distribute the binary then make sure you have a `Developer ID Application` certificate in your keychain. Without this the build script cannot sign and notarize the mac binary which is needed for Catalina 10.15 and above.
You will also need to generate an [app specific password](https://support.apple.com/HT204397) for your Apple ID.
You will also need an [App-specific password](https://support.apple.com/en-al/HT204397) for the apple account you wish to notarize with
# the script above prints at the end a few lines you have to run in your terminal
</details>
https://git-lfs.github.com/ # visit this page, download and install git-lfs
### Building
git lfs install # once git lfs is installed, you have to run this command too
Once your development environment is set up, here are the steps to build the application:
nvm install # install the current node version used in this project
nvm use # use the current node version used in this project
npm install -g yarn # install yarn globally for this node version
```shell
yarn install --frozen-lockfile # install all dependencies of this project
yarn build-everything # transpile and assemble files
yarn start-prod # start the app on production mode (currently this is the only one supported)
```
</details>
### Commands
The `rpm` package is required for running the build-release script. Run the appropriate command to install the `rpm` package:
```sh
sudo pacman -S rpm # Arch
```
```sh
sudo apt install rpm # Ubuntu/Debian
```
Run the following to build the binaries for your specific system OS.
```
npm install yarn --no-save
yarn install --frozen-lockfile
yarn build-everything
yarn build-release
```
The binaries will be placed inside the `release/` folder.
On linux, you can change in package.json `"target": ["deb"],` to any of the [electron-builder targets](https://www.electron.build/linux#target) to build for another target.
<details>
<summary>Linux</summary>
You can change in [package.json](./package.json) `"target": ["deb"],` to any of the [electron-builder targets](https://www.electron.build/linux#target) to build for another target.
If you update the app icon, you also need to update all those file generated from it and based on https://www.electron.build/icons.html.
The current source file is build/session_icon_source_1024px.png
The current source file is [build/session_icon_source_1024px.png](./session_icon_source_1024px.png)
### Linux
Build binaries on github actions, get the zip with the deb+appImage, extract it, all the icons are in a `.icons-set` folder, and you can copy paste them into [build/icons](./icons/).
### macOS
Use https://cloudconvert.com/png-to-icns to get an `.icns` file from the 1024px.png source file. Save as `icon-mac.icns`.
### Windows
-> macOS: use https://cloudconvert.com/png-to-icns to get .icns from the 1024px.png source file => save as icon-mac.icns
-> windows: use https://cloudconvert.com/png-to-ico to get .ico from the 1024px.png source file => save as icon.ico
-> linux: build binaries on github actions, get the zip with the deb+appImage, extract it, all the icons are in a .icons-set folder, and you can copy paste them into build/icons
Use https://cloudconvert.com/png-to-ico to get an `.ico` file from the 1024px.png source file. Save as `icon.ico`.