2023-03-09 09:36:51 +03:00
# Building AFFiNE Desktop Client App
## Table of Contents
- [Prerequisites ](#prerequisites )
- [Development ](#development )
- [Build ](#build )
- [CI ](#ci )
## Prerequisites
2023-04-04 15:40:07 +03:00
Before you start building AFFiNE Desktop Client Application, please [install Rust toolchain first ](https://www.rust-lang.org/learn/get-started ).
2023-03-09 09:36:51 +03:00
Note that if you encounter any issues with installing Rust and crates, try following [this guide (zh-CN) ](https://course.rs/first-try/slowly-downloading.html ) to set up alternative registries.
## Development
2023-04-04 15:40:07 +03:00
To run AFFiNE Desktop Client Application locally, run the following commands:
2023-03-09 09:36:51 +03:00
```sh
2023-04-04 15:40:07 +03:00
# in repo root
2023-03-21 08:12:42 +03:00
yarn install
2023-04-04 15:40:07 +03:00
yarn dev
2023-03-09 09:36:51 +03:00
2023-04-04 15:40:07 +03:00
# in apps/electron
yarn generate-assets
yarn dev
2023-03-09 09:36:51 +03:00
```
2023-04-04 15:40:07 +03:00
Now you should see the Electron app window popping up shortly.
2023-03-09 09:36:51 +03:00
## Build
2023-04-04 15:40:07 +03:00
To build the desktop client application, run `yarn make` in `apps/electron` .
Note: you may want to comment out `osxSign` and `osxNotarize` in `forge.config.js` to avoid signing and notarizing the app.
2023-03-09 09:36:51 +03:00
Once the build is complete, you can find the paths to the binaries in the terminal output.
```
Finished 2 bundles at:
2023-04-04 15:40:07 +03:00
› Artifacts available at: < affine-repo > /apps/electron/out/make
2023-03-09 09:36:51 +03:00
```
## CI
2023-04-04 15:40:07 +03:00
Please refer to `.github/workflows/release-desktop-app.yml` for the CI workflow. It will:
2023-03-09 09:36:51 +03:00
- build the app for all supported platforms
- upload the artifacts to GitHub Actions