Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
80 lines
3.1 KiB
Markdown
80 lines
3.1 KiB
Markdown
---
|
|
title: "Package and release"
|
|
sidebar_position: 4
|
|
---
|
|
|
|
## Build
|
|
|
|
You can build the Desktop App by running the following command:
|
|
|
|
```text
|
|
npm run build
|
|
```
|
|
|
|
You can build the Desktop App for development and watch for changes in the main process with this command:
|
|
|
|
```text
|
|
npm run watch
|
|
```
|
|
|
|
Our application uses `webpack` to bundle the scripts together for the main and renderer process.
|
|
There are bundles generated for each page used the renderer process, and one bundle for the main process.
|
|
A bundle is also generated for the E2E tests when needed.
|
|
|
|
You can predefine certain variables in the app before building, by editing the build config under `src/common/config/buildConfig.ts`. For example, you can predefine servers, or disable server management.
|
|
|
|
## Package
|
|
|
|
Our app uses `electron-builder` to package the app into a distributable format for release.
|
|
You can find the configuration for the builder in the `electron-builder.json` file in the root directory.
|
|
|
|
You can run the packager using this command:
|
|
|
|
```text
|
|
npm run package:<os>
|
|
```
|
|
|
|
where **\<os\>** is one of the following values: `windows, mac, mac-with-universal, mas, linux`
|
|
|
|
All of the above values will generate builds for `x64` and `arm64` architectures:
|
|
- `windows`: `exe`, `zip` and `msi` formats
|
|
- `mac`: `dmg` and `zip` formats
|
|
- `mac-with-universal`: universal binary for all architectures - `dmg`
|
|
- `mas`: universal Mac App Store-compliant build
|
|
- `linux`: `deb`, `rpm` and `tar.gz` formats
|
|
|
|
You can build for more specific targets using the commands [here](/developers/contribute/more-info/desktop/build-commands#packaging)
|
|
|
|
#### After pack script
|
|
|
|
We include an `afterPack` script to run functions after the application is built into a binary. This is a good place to inject code and make any modifications to the binary after build.
|
|
|
|
#### Code sign
|
|
|
|
In order to generate signed builds of the application for Windows and macOS, you'll need a certificate file for each of the operating systems.
|
|
|
|
These files are under control of Mattermost and aren't generally distributed, but you can obtain your own certificate and sign the app yourself if necessary.
|
|
|
|
For macOS, you'll need a valid `Mac Developer` or `Developer ID Application` certificate from the Apple Developer Program.
|
|
|
|
For Windows, you'll need a valid code signing certificate.
|
|
|
|
More information on Code Signing can be found here: https://www.electron.build/code-signing
|
|
|
|
## Release
|
|
|
|
Releasing a new version of the Desktop App can be done by running the shell script `release.sh` under the `scripts/` folder.
|
|
It will increment the version number in `package.json` for you, create a tag and generate a commit for you. It will also give you the `git` command to run to push all these changes to your repository.
|
|
|
|
It has the following options:
|
|
```
|
|
// generates a patch version release candidate, will increment x of v0.0.x (so v5.0.1 becomes v5.0.2-rc1)
|
|
$ ./scripts/release.sh patch
|
|
|
|
// generates a release candidate version, on top of a current release candidate (so v5.0.2-rc1 becomes v5.0.2-rc2)
|
|
$ ./scripts/release.sh rc
|
|
|
|
// generates a final version, on top of a current release candidate (so v5.0.2-rc2 becomes v5.0.2)
|
|
$ ./scripts/release.sh final
|
|
```
|