feat: update internal builds and release documentation

pull/3281/head
yougotwill 2 months ago
parent ab4debf9d0
commit b31ad5c083

@ -1,15 +1,16 @@
# Building
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:
```
```shell
base64 -i certificate.p12 -o encoded.txt
```
@ -30,58 +31,40 @@ base64 -i certificate.p12 -o encoded.txt
3. In the left sidebar, click **Secrets**.
4. Add the following secrets:
1. Certificate
- Name: `MAC_CERTIFICATE`
- Value: The encoded Base64 certificate
- Name: `MAC_CERTIFICATE`
- Value: The encoded Base64 certificate
2. Certificate password
- Name: `MAC_CERTIFICATE_PASSWORD`
- 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:
```
npm install --global --production windows-build-tools@4.0.0
npm config set python python2.7
npm config set msvs_version 2015
```shell
sudo apt install rpm # Ubuntu/Debian
```
</details>
@ -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
Then run the following to export the variables
```
```shell
export SIGNING_APPLE_ID=<your apple id>
export SIGNING_APP_PASSWORD=<your app specific password>
export SIGNING_TEAM_ID=<your team id if applicable>
```
Then, to just generate the files and build the app do
```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash # install nvm
# 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.
</details>

@ -4,7 +4,7 @@ Creating a new Session Desktop release is very simple.
1. Bump up the version in `package.json`.
2. Merge all changes required into the `master` branch.
* This will trigger github actions to start building a draft release
- This will trigger github actions to start building a draft release
3. After github actions has finished building. Go to Release page in the repository.
4. Click on the draft release and change the tag target to `master`.
5. Add in release notes.
@ -29,9 +29,9 @@ Flatpak generation is different from the normal build process and thus must be d
1. Clone https://github.com/flathub/network.loki.Session
2. Update `network.loki.Session.metainfo.xml` with the release information
- `<release version="[version]" date="[date]"/>`
- `<release version="[version]" date="[date]"/>`
3. Update `network.loki.Session.json`
- Under `sources`, change the `url` so it points to the latest `deb` and update the `sha256` signature.
- Under `sources`, change the `url` so it points to the latest `deb` and update the `sha256` signature.
4. Create a pull request with the changes
Once that is done, a developer will go in a review them before merging them in which will trigger a build and release into the flathub repo.
Once that is done, a developer will go in a review them before merging them in which will trigger a build and release into the Flathub repo.

@ -1,10 +1,19 @@
APP ICONS
"""""""""
# Building
## Application Icons
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`.

Loading…
Cancel
Save