Cherry-pick GitHub Actions to 5.3 (#2600)
* feat(ci): CircleCI migration to Github Actions (#2516) * Deprecated trigger-desktop-nightly repo from gitlab * Migrated Nightly builds URLs from CircleCI to S3 * Full CI/CD is handled by Github Actions --------- Co-authored-by: Tasos Boulis <tboulis@hotmail.com> Co-authored-by: Mattermost Build <build@mattermost.com> * fix nightly builds (#2590) * added missing patch version . fix patch action for windows (#2592) * feat(ci): Use workflow_dispatch option for nightly builds in order to trigger them on demand when needed (#2593) * add missing yq for windows (#2594) * Allow MAS build to be repeated more easily (#2595) * fix multiline strings output (#2596) * Add MM_WIN_INSTALLERS for nightly builds (#2599) * Adding extra dependencies to the release flow (#2601) --------- Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com> Co-authored-by: Tasos Boulis <tboulis@hotmail.com> Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
parent
f3ff34870a
commit
16f043d44e
|
@ -1,755 +0,0 @@
|
|||
version: 2.1
|
||||
parameters:
|
||||
run_nightly:
|
||||
default: false
|
||||
type: boolean
|
||||
orbs:
|
||||
win: circleci/windows@5.0.0
|
||||
aws-s3: circleci/aws-s3@2.0.0
|
||||
owasp: entur/owasp@0.0.10
|
||||
|
||||
executors:
|
||||
check-image:
|
||||
working_directory: ~/mattermost-desktop
|
||||
docker:
|
||||
- image: electronuserland/builder:16-wine-chrome
|
||||
environment:
|
||||
TAR_OPTIONS: --no-same-owner
|
||||
wine-chrome:
|
||||
working_directory: ~/mattermost-desktop
|
||||
docker:
|
||||
- image: electronuserland/builder:16-wine-chrome
|
||||
environment:
|
||||
TAR_OPTIONS: --no-same-owner
|
||||
wine-mono:
|
||||
working_directory: ~/mattermost-desktop
|
||||
docker:
|
||||
- image: electronuserland/builder:16-wine-mono
|
||||
mac:
|
||||
working_directory: ~/mattermost-desktop
|
||||
macos:
|
||||
xcode: "13.0.0"
|
||||
aws:
|
||||
working_directory: ~/mattermost-desktop
|
||||
docker:
|
||||
- image: 'circleci/python:2.7'
|
||||
github:
|
||||
working_directory: ~/mattermost-desktop
|
||||
docker:
|
||||
- image: cimg/go:1.19.2
|
||||
commands:
|
||||
notify:
|
||||
description: "notify on release channel"
|
||||
parameters:
|
||||
message:
|
||||
type: string
|
||||
default: "This is the default notification message, someone forgot to add info on what to notify!"
|
||||
username:
|
||||
type: string
|
||||
default: "MattermostRelease"
|
||||
icon:
|
||||
type: string
|
||||
default: "https://mattermost.com/wp-content/uploads/2022/02/icon.png"
|
||||
steps:
|
||||
- run:
|
||||
command: |
|
||||
export VERSION=$(jq -r .version package.json)
|
||||
echo '{}' | jq "{
|
||||
\"username\": \"<< parameters.username >>\",
|
||||
\"icon_url\": \"<< parameters.icon >>\",
|
||||
\"text\": \"[${VERSION}] << parameters.message >>\"
|
||||
}" >> /tmp/webhook-data.json
|
||||
- run:
|
||||
command: |
|
||||
curl -i -H "Content-Type: application/json" -X POST -d @/tmp/webhook-data.json $MATTERMOST_RELEASE_WEBHOOK_URL_DESKTOP || echo "NOFICATION FAILED! check logs as this will succeed intentionally"
|
||||
|
||||
update_base_image:
|
||||
description: "Update base image"
|
||||
parameters:
|
||||
apt_opts:
|
||||
type: string
|
||||
default: ""
|
||||
steps:
|
||||
- run: wget -qO - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key | apt-key add -
|
||||
- run: apt-get update || true && apt-get install -y ca-certificates libxtst-dev libpng++-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu && apt-get update && apt-get -y install << parameters.apt_opts >>
|
||||
- run: wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.20.1/yq_linux_amd64 && chmod a+x /usr/local/bin/yq
|
||||
update_image:
|
||||
description: "Update image"
|
||||
parameters:
|
||||
apt_opts:
|
||||
type: string
|
||||
default: ""
|
||||
steps:
|
||||
- update_base_image:
|
||||
apt_opts: << parameters.apt_opts >>
|
||||
- run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm ci
|
||||
|
||||
win_make:
|
||||
description: "Run mattermost's makefile.ps1 on ./scripts/"
|
||||
parameters:
|
||||
operation:
|
||||
type: string
|
||||
default: ""
|
||||
steps:
|
||||
- run:
|
||||
command: ./scripts/Makefile.ps1 << parameters.operation >>
|
||||
name: << parameters.operation >>
|
||||
shell: powershell
|
||||
build:
|
||||
description: "Building << parameters.os >> app"
|
||||
parameters:
|
||||
os:
|
||||
type: string
|
||||
default: "linux"
|
||||
path:
|
||||
type: string
|
||||
default: "./build/linux"
|
||||
subpath:
|
||||
type: string
|
||||
default: "./linux/"
|
||||
steps:
|
||||
- run:
|
||||
name: npn run
|
||||
command: npm run package:<< parameters.os >>
|
||||
no_output_timeout: 60m
|
||||
- run: bash -x ./scripts/patch_updater_yml.sh
|
||||
- run: mkdir -p << parameters.path >>
|
||||
- run: bash -x ./scripts/cp_artifacts.sh release << parameters.path >>
|
||||
- persist_to_workspace:
|
||||
root: ./build
|
||||
paths:
|
||||
- "./<< parameters.subpath >>/"
|
||||
check:
|
||||
description: "Running automated tests"
|
||||
steps:
|
||||
- run: npm run check-types
|
||||
- run:
|
||||
name: i18n check
|
||||
command: |
|
||||
cp i18n/en.json /tmp/en.json
|
||||
npm run mmjstool -- i18n extract-desktop --desktop-dir .
|
||||
diff /tmp/en.json i18n/en.json
|
||||
rm -rf tmp
|
||||
- run: ELECTRON_DISABLE_SANDBOX=1 npm run test:unit-ci
|
||||
- run: mkdir -p /tmp/test-results
|
||||
- run: cp test-results.xml /tmp/test-results/
|
||||
- store_test_results:
|
||||
path: /tmp/test-results
|
||||
check-windows:
|
||||
description: "Running automated tests"
|
||||
steps:
|
||||
- run: npm run check-types
|
||||
- run:
|
||||
name: i18n check
|
||||
command: |
|
||||
cp .\i18n\en.json $env:TEMP\en.json
|
||||
npm run mmjstool -- i18n extract-desktop --desktop-dir .
|
||||
diff $env:TEMP\en.json .\i18n\en.json
|
||||
rm $env:TEMP\en.json
|
||||
- run: $env:ELECTRON_DISABLE_SANDBOX=1; npm run test:unit
|
||||
- run: mkdir -p $env:TEMP\test-results
|
||||
- run: cp test-results.xml $env:TEMP\test-results\
|
||||
- store_test_results:
|
||||
path: /tmp/test-results
|
||||
save:
|
||||
description: "Save binaries artifacts"
|
||||
parameters:
|
||||
filename:
|
||||
type: string
|
||||
steps:
|
||||
- run:
|
||||
name: Copying artifacts
|
||||
command: |
|
||||
mkdir /tmp/artifacts;
|
||||
cp release/<<parameters.filename>> /tmp/artifacts;
|
||||
- store_artifacts:
|
||||
path: /tmp/artifacts
|
||||
jobs:
|
||||
build-linux:
|
||||
executor: wine-mono
|
||||
steps:
|
||||
- checkout
|
||||
- run: mkdir -p ./build
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- update_image:
|
||||
apt_opts: "--no-install-recommends jq icnsutils graphicsmagick tzdata"
|
||||
- check
|
||||
- build
|
||||
- persist_to_workspace:
|
||||
root: ./build/
|
||||
paths:
|
||||
- "./linux/"
|
||||
- save_cache:
|
||||
key: npm-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }}
|
||||
paths:
|
||||
- "node_modules"
|
||||
- "~/.cache/electron"
|
||||
- "~/.cache/electron-builder"
|
||||
|
||||
build-win-no-installer:
|
||||
executor: win/server-2019
|
||||
steps:
|
||||
- checkout
|
||||
- run: mkdir -p ./build
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- run: |
|
||||
$InstallPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
|
||||
$WorkLoads = '--add Microsoft.VisualStudio.Component.VC.ATL.ARM64'
|
||||
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache')
|
||||
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden -WorkingDirectory "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
|
||||
- run:
|
||||
name: Install yq
|
||||
command: choco install yq --version 4.15.1 -y
|
||||
- run:
|
||||
name: Install nodejs-lts
|
||||
command: nvm off; choco install nodejs-lts -y
|
||||
- run: npm i -g node-gyp; node-gyp install; node-gyp install --devdir="$env:USERPROFILE\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
|
||||
- run: $env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = 1; npm ci
|
||||
- check-windows
|
||||
- build:
|
||||
os: windows
|
||||
path: ./build/win
|
||||
subpath: ./win/
|
||||
- save_cache:
|
||||
key: npm-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }}
|
||||
paths:
|
||||
- "node_modules"
|
||||
- "~/.cache/electron"
|
||||
- "~/.cache/electron-builder"
|
||||
|
||||
build-mac-no-dmg:
|
||||
executor: mac
|
||||
steps:
|
||||
- checkout
|
||||
- run: mkdir -p ./build
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- run: brew install yq
|
||||
- run:
|
||||
name: Update node to v16
|
||||
command: nvm install --lts && nvm use --lts
|
||||
- run: jq '.mac.target=["zip"]' electron-builder.json | jq '.mac.gatekeeperAssess=false' > /tmp/electron-builder.json && cp /tmp/electron-builder.json .
|
||||
- run: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm ci
|
||||
- check
|
||||
- build:
|
||||
os: mac
|
||||
path: ./build/macos
|
||||
subpath: ./macos/
|
||||
- save_cache:
|
||||
key: npm-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }}
|
||||
paths:
|
||||
- "node_modules"
|
||||
- "~/.cache/electron"
|
||||
- "~/.cache/electron-builder"
|
||||
|
||||
msi_installer:
|
||||
executor: win/server-2019
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- run: mkdir -p ./build/
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- run: |
|
||||
$InstallPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
|
||||
$WorkLoads = '--add Microsoft.VisualStudio.Component.VC.ATL.ARM64'
|
||||
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache')
|
||||
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden -WorkingDirectory "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
|
||||
- run:
|
||||
name: Install yq
|
||||
command: choco install yq --version 4.15.1 -y
|
||||
- run:
|
||||
name: Install nodejs-lts
|
||||
command: nvm off; choco install nodejs-lts -y
|
||||
- win_make:
|
||||
operation: optimize
|
||||
- win_make:
|
||||
operation: "install-deps"
|
||||
- check-windows
|
||||
- win_make:
|
||||
operation: "build"
|
||||
- run: bash -x ./scripts/patch_updater_yml.sh
|
||||
- run: mkdir -p ./build/win-release
|
||||
- run: bash -x ./scripts/cp_artifacts.sh release ./build/win-release
|
||||
- persist_to_workspace:
|
||||
root: ./build/
|
||||
paths:
|
||||
- "./win-release/"
|
||||
|
||||
build-windows-pr:
|
||||
executor: win/server-2019
|
||||
steps:
|
||||
- checkout
|
||||
- run: mkdir -p ./build
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- run: |
|
||||
$InstallPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
|
||||
$WorkLoads = '--add Microsoft.VisualStudio.Component.VC.ATL.ARM64'
|
||||
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache')
|
||||
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden -WorkingDirectory "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
|
||||
- run:
|
||||
name: Install yq
|
||||
command: choco install yq --version 4.15.1 -y
|
||||
- run:
|
||||
name: Install nodejs-lts
|
||||
command: nvm off; choco install nodejs-lts -y
|
||||
- run: npm i -g node-gyp; node-gyp install; node-gyp install --devdir="$env:USERPROFILE\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
|
||||
- run: $env:PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = 1; npm ci
|
||||
- build:
|
||||
os: windows
|
||||
path: ./build/win
|
||||
subpath: ./win/
|
||||
- save_cache:
|
||||
key: npm-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }}
|
||||
paths:
|
||||
- "node_modules"
|
||||
- "~/.cache/electron"
|
||||
- "~/.cache/electron-builder"
|
||||
- save:
|
||||
filename: "$(jq -r .version package.json)/*.zip"
|
||||
|
||||
build-mac-pr:
|
||||
executor: mac
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- run: mkdir -p ./build
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- run: brew install yq
|
||||
- run:
|
||||
name: Update node to v16
|
||||
command: nvm install --lts && nvm use --lts
|
||||
- run:
|
||||
name: Installing npm dependencies
|
||||
command: npm ci
|
||||
- build:
|
||||
os: mac
|
||||
path: ./build/macos-release
|
||||
subpath: ./macos-release/
|
||||
- run:
|
||||
name: Get rename without brew as it might fail
|
||||
command: curl -L https://github.com/ap/rename/archive/v1.601.tar.gz --output rename.tgz
|
||||
- run:
|
||||
name: extract rename
|
||||
command: tar -xzf rename.tgz
|
||||
- run:
|
||||
name: rename arm64 to m1
|
||||
command: ./rename-1.601/rename 's/arm64/m1/' ./release/$(jq -r .version package.json)/*
|
||||
- save:
|
||||
filename: "$(jq -r .version package.json)/*.dmg"
|
||||
|
||||
build-linux-pr:
|
||||
executor: wine-mono
|
||||
steps:
|
||||
- checkout
|
||||
- run: mkdir -p ./build
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- update_image:
|
||||
apt_opts: "--no-install-recommends jq icnsutils graphicsmagick tzdata"
|
||||
- build
|
||||
- save_cache:
|
||||
key: npm-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }}
|
||||
paths:
|
||||
- "node_modules"
|
||||
- "~/.cache/electron"
|
||||
- "~/.cache/electron-builder"
|
||||
- save:
|
||||
filename: "$(jq -r .version package.json)/*.tar.gz"
|
||||
|
||||
mac_installer:
|
||||
executor: mac
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- run: mkdir -p ./build
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- run:
|
||||
name: Update node to v16
|
||||
command: nvm install --lts && nvm use --lts
|
||||
- run:
|
||||
name: Install yq
|
||||
command: brew install yq
|
||||
- run:
|
||||
name: Installing npm dependencies
|
||||
command: npm ci
|
||||
- check
|
||||
- build:
|
||||
os: mac-with-universal
|
||||
path: ./build/macos-release
|
||||
subpath: ./macos-release/
|
||||
- run:
|
||||
name: Get rename without brew as it might fail
|
||||
command: curl -L https://github.com/ap/rename/archive/v1.601.tar.gz --output rename.tgz
|
||||
- run:
|
||||
name: extract rename
|
||||
command: tar -xzf rename.tgz
|
||||
- run:
|
||||
name: rename arm64 to m1
|
||||
command: ./rename-1.601/rename 's/arm64/m1/' ./build/macos-release/$(jq -r .version package.json)/*
|
||||
- persist_to_workspace:
|
||||
root: ./build
|
||||
paths:
|
||||
- "./macos-release/"
|
||||
|
||||
mac_app_store_testflight:
|
||||
executor: mac
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- run: mkdir -p ./build
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- run:
|
||||
name: Update node to v16
|
||||
command: nvm install --lts && nvm use --lts
|
||||
- run:
|
||||
name: Install yq
|
||||
command: brew install yq
|
||||
- run:
|
||||
name: Installing npm dependencies
|
||||
command: npm ci
|
||||
- run:
|
||||
name: Copy provisioning profile
|
||||
command: echo $MAS_PROFILE | base64 -D > ./mas.provisionprofile
|
||||
- run:
|
||||
name: Patch version number for MAS
|
||||
command: ./scripts/patch_mas_version.sh
|
||||
- check
|
||||
- run: npm run package:mas
|
||||
- run:
|
||||
name: Don't submit unless it's on a tag or it's the nightly build
|
||||
command: |
|
||||
if [ -z `git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null` ]; then
|
||||
if [ `git rev-parse --abbrev-ref HEAD` != "nightly" ]; then
|
||||
circleci-agent step halt
|
||||
fi
|
||||
fi
|
||||
- run:
|
||||
name: 'Upload to App Store Connect'
|
||||
command: fastlane publish_test path:"$(find . -name \*.pkg -print -quit)"
|
||||
|
||||
store_artifacts:
|
||||
executor: wine-chrome
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- store_artifacts:
|
||||
path: ./build
|
||||
destination: packages
|
||||
- update_base_image:
|
||||
apt_opts: "jq"
|
||||
- run:
|
||||
name: "store url links"
|
||||
command: |
|
||||
echo $(pwd)
|
||||
ls .
|
||||
curl -H "Circle-Token: $CIRCLE_TOKEN" -H "Accept: application/json" -X GET "https://circleci.com/api/v2/project/github/mattermost/desktop/$CIRCLE_BUILD_NUM/artifacts" | jq -r '.items[].url' >> ./build/artifactlist.txt
|
||||
grep -v ".yml" ./build/artifactlist.txt | grep -v "\._" > ./templist.txt
|
||||
echo "##### :tux: Linux" > ./build/linklist.txt
|
||||
grep "linux" ./templist.txt | awk -F/ '{print "- ["$NF"]("$0")"}' >> ./build/linklist.txt
|
||||
echo "##### :apple_logo: macOS" >> ./build/linklist.txt
|
||||
grep "macos" ./templist.txt | awk -F/ '{print "- ["$NF"]("$0")"}' >> ./build/linklist.txt
|
||||
echo "##### :windows: Windows" >> ./build/linklist.txt
|
||||
grep "win" ./templist.txt | awk -F/ '{print "- ["$NF"]("$0")"}' >> ./build/linklist.txt
|
||||
- persist_to_workspace:
|
||||
root: ./build
|
||||
paths:
|
||||
- ./linklist.txt
|
||||
- ./artifactlist.txt
|
||||
|
||||
share_to_channel:
|
||||
executor: wine-chrome
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- update_base_image:
|
||||
apt_opts: "jq"
|
||||
- run: mkdir -p ./links
|
||||
- run: echo "### Nightly builds:\n" > ./links/linklist.txt
|
||||
- run:
|
||||
name: "Get urls for sharing"
|
||||
command: |
|
||||
echo "Links for $(date +"%b-%d-%Y")" >> ./links/linklist.txt
|
||||
cat ./build/linklist.txt >> ./links/linklist.txt
|
||||
- run:
|
||||
command: |
|
||||
linklist=$(<./links/linklist.txt);
|
||||
echo '{}' | jq "{
|
||||
\"username\": \"NightBuilder\",
|
||||
\"icon_url\": \"https://upload.wikimedia.org/wikipedia/commons/1/17/Luna_symbol.png\",
|
||||
\"text\": \"${linklist}\"
|
||||
}" >> /tmp/webhook-data.json
|
||||
- run:
|
||||
command: |
|
||||
curl -i -X POST -H "Content-Type: application/json" -d @/tmp/webhook-data.json $MM_TOKEN || echo "NOFICATION FAILED! check logs as this will succeed intentionally"
|
||||
|
||||
upload_to_s3:
|
||||
executor: aws
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- run:
|
||||
name: "Don't upload if it's not on a tag"
|
||||
command: |
|
||||
if [ -z `git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null` ]; then
|
||||
circleci-agent step halt
|
||||
fi
|
||||
- run:
|
||||
name: "Setup files for aws-s3"
|
||||
command: |
|
||||
mkdir -p ./aws-s3-dist
|
||||
cp -r --backup=numbered ./build/{macos-release,win-release,linux}/* ./aws-s3-dist
|
||||
- aws-s3/copy:
|
||||
from: ./aws-s3-dist/
|
||||
to: s3://releases.mattermost.com/desktop/
|
||||
arguments: --acl public-read --cache-control "no-cache" --recursive
|
||||
|
||||
upload_to_s3_daily:
|
||||
executor: aws
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- run:
|
||||
name: "install renaming utility"
|
||||
command: |
|
||||
sudo apt-get install rename
|
||||
- run:
|
||||
name: "Normalize folder names"
|
||||
command: |
|
||||
mv ./build/macos-release ./build/macos && mv ./build/win-release ./build/win
|
||||
- run:
|
||||
name: "Rename to daily for consistency"
|
||||
command: |
|
||||
rename 's/\d+\.\d+\.\d+\-nightly\.\d+\/mattermost(.+)\d+\.\d+\.\d+\-nightly\.\d+/mattermost$1daily-develop/' ./build/macos/$(jq -r .version package.json)/*
|
||||
rename 's/\d+\.\d+\.\d+\-nightly\.\d+\/mattermost(.+)\d+\.\d+\.\d+\-nightly\.\d+/mattermost$1daily-develop/' ./build/linux/$(jq -r .version package.json)/*
|
||||
rename 's/\d+\.\d+\.\d+\-nightly\.\d+\/mattermost(.+)\d+\.\d+\.\d+\-nightly\.\d+/mattermost$1daily-develop/' ./build/win/$(jq -r .version package.json)/*
|
||||
- aws-s3/copy:
|
||||
from: ./build/
|
||||
to: s3://mattermost-desktop-daily-builds/
|
||||
arguments: --acl public-read --cache-control "no-cache" --recursive
|
||||
|
||||
upload_to_github:
|
||||
executor: github
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: ./build
|
||||
- run:
|
||||
name: "Don't upload if it's not on a tag"
|
||||
command: |
|
||||
if [ -z `git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null` ]; then
|
||||
circleci-agent step halt
|
||||
fi
|
||||
- run:
|
||||
name: "Setup files for ghr"
|
||||
command: |
|
||||
mkdir -p ./ghr-dist
|
||||
find ./build/{macos-release,win-release,linux} -type f -exec cp --backup=numbered -t ./ghr-dist {} +
|
||||
- run:
|
||||
name: "Publish Release on GitHub"
|
||||
command: |
|
||||
go install github.com/tcnksm/ghr@latest
|
||||
VERSION=$(jq -r .version package.json)
|
||||
RELEASE_TITLE="v${VERSION} ($(date -u "+%Y-%m-%d"))"
|
||||
ghr \
|
||||
-t ${GITHUB_TOKEN} \
|
||||
-u ${CIRCLE_PROJECT_USERNAME} \
|
||||
-draft \
|
||||
--body="$(./scripts/generate_release_markdown.sh $VERSION)" \
|
||||
--name="${RELEASE_TITLE}" $( [[ $VERSION =~ "-rc" ]] && printf %s "-prerelease") \
|
||||
-r ${CIRCLE_PROJECT_REPONAME} \
|
||||
-c ${CIRCLE_SHA1} \
|
||||
-delete \
|
||||
v${VERSION} ./ghr-dist
|
||||
|
||||
begin-notification:
|
||||
executor: wine-chrome
|
||||
steps:
|
||||
- checkout
|
||||
- update_image:
|
||||
apt_opts: "--no-install-recommends jq"
|
||||
- notify:
|
||||
message: "Release process for the desktop app has started, it should take about 30 minutes to complete."
|
||||
|
||||
end-notification:
|
||||
executor: wine-chrome
|
||||
steps:
|
||||
- checkout
|
||||
- update_image:
|
||||
apt_opts: "--no-install-recommends jq"
|
||||
- notify:
|
||||
message: "Release process for the desktop app ended, the new release can be found on [GitHub](https://github.com/mattermost/desktop/releases)."
|
||||
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build_and_test:
|
||||
jobs:
|
||||
- begin-notification:
|
||||
context: desktop-notify
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
# only for release and release candidates
|
||||
# release-XX.YY.ZZ
|
||||
# release-XX.YY.ZZ-rc-something
|
||||
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
|
||||
- build-linux:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /^build-pr-.*/
|
||||
- nightly
|
||||
- build-win-no-installer:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
|
||||
- /^build-pr-.*/
|
||||
- nightly
|
||||
|
||||
- build-mac-no-dmg:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
|
||||
- /^build-pr-.*/
|
||||
- nightly
|
||||
|
||||
- msi_installer:
|
||||
context: windows-codesign
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
# only for release and release candidates
|
||||
# release-XX.YY.ZZ
|
||||
# release-XX.YY.ZZ-rc-something
|
||||
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
|
||||
|
||||
- mac_installer:
|
||||
context: codesign-certificates
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
|
||||
|
||||
- mac_app_store_testflight:
|
||||
context: desktop-mac-app-store
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
|
||||
|
||||
- store_artifacts:
|
||||
# for master/PR builds
|
||||
requires:
|
||||
- build-linux
|
||||
- build-win-no-installer
|
||||
- build-mac-no-dmg
|
||||
- mac_installer
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
|
||||
- /^build-pr-.*/
|
||||
- nightly
|
||||
|
||||
- upload_to_s3:
|
||||
# for release builds
|
||||
requires:
|
||||
- msi_installer
|
||||
- mac_installer
|
||||
- build-linux
|
||||
context: mattermost-release-s3
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
|
||||
|
||||
- upload_to_github:
|
||||
requires:
|
||||
- upload_to_s3
|
||||
context: matterbuild-github-token
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
|
||||
- end-notification:
|
||||
requires:
|
||||
- upload_to_github
|
||||
context: desktop-notify
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
# only for release and release candidates
|
||||
# release-XX.YY.ZZ
|
||||
# release-XX.YY.ZZ-rc-something
|
||||
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
|
||||
|
||||
build-for-pr:
|
||||
jobs:
|
||||
- build-windows-pr:
|
||||
context: electron-installer
|
||||
filters:
|
||||
branches:
|
||||
only: /^build-pr-.*/
|
||||
- build-mac-pr:
|
||||
context: codesign-certificates
|
||||
filters:
|
||||
branches:
|
||||
only: /^build-pr-.*/
|
||||
- build-linux-pr:
|
||||
filters:
|
||||
branches:
|
||||
only: /^build-pr-.*/
|
||||
nightly_browser_view:
|
||||
when: << pipeline.parameters.run_nightly >>
|
||||
jobs:
|
||||
- build-linux
|
||||
- msi_installer:
|
||||
context: windows-codesign
|
||||
- mac_installer:
|
||||
context: codesign-certificates
|
||||
- mac_app_store_testflight:
|
||||
context: desktop-mac-app-store
|
||||
- store_artifacts:
|
||||
context: desktop_browserview
|
||||
# for master/PR builds
|
||||
requires:
|
||||
- build-linux
|
||||
- msi_installer
|
||||
- mac_installer
|
||||
- upload_to_s3:
|
||||
context: mattermost-release-s3
|
||||
requires:
|
||||
- build-linux
|
||||
- msi_installer
|
||||
- mac_installer
|
||||
- share_to_channel:
|
||||
context: desktop_browserview
|
||||
requires:
|
||||
- store_artifacts
|
||||
nightly_rainforest:
|
||||
when: << pipeline.parameters.run_nightly >>
|
||||
jobs:
|
||||
- msi_installer:
|
||||
context:
|
||||
- windows-codesign
|
||||
- desktop-rainforest-build
|
||||
- mac_installer:
|
||||
context:
|
||||
- codesign-certificates
|
||||
- desktop-rainforest-build
|
||||
- upload_to_s3_daily:
|
||||
context: mattermost-desktop-daily-s3
|
||||
requires:
|
||||
- msi_installer
|
||||
- mac_installer
|
11
.github/actions/patch-nightly-version/action.yaml
vendored
Normal file
11
.github/actions/patch-nightly-version/action.yaml
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Copyright 2022 Mattermost, Inc.
|
||||
name: "patch-version"
|
||||
description: This action is used to patch package.json version with the nightly build
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: ci/generate-version
|
||||
id: generate-version
|
||||
shell: bash
|
||||
run: go run ${GITHUB_ACTION_PATH}/patch-version.go . # https://github.com/orgs/community/discussions/25910
|
42
.github/actions/patch-nightly-version/patch-version.go
vendored
Normal file
42
.github/actions/patch-nightly-version/patch-version.go
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
args := os.Args[1:]
|
||||
|
||||
packageFileName := fmt.Sprintf("%s/package.json", args[0])
|
||||
packageJson, err := os.Open(packageFileName)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
packageBytes, err := ioutil.ReadAll(packageJson)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
var packageInfo map[string]interface{}
|
||||
json.Unmarshal(packageBytes, &packageInfo)
|
||||
|
||||
originalVersion := fmt.Sprintf("%s", packageInfo["version"])
|
||||
nightlyVersion := fmt.Sprintf("%s-nightly.%s", strings.Split(originalVersion, "-")[0], time.Now().Format("20060102"))
|
||||
packageInfo["version"] = nightlyVersion
|
||||
|
||||
newPackageJson := strings.Replace(string(packageBytes), originalVersion, nightlyVersion, 1)
|
||||
err = ioutil.WriteFile(packageFileName, []byte(newPackageJson), 0644)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
packageJson.Close()
|
||||
fmt.Println("Update package.json with version:", nightlyVersion)
|
||||
}
|
27
.github/actions/test/action.yaml
vendored
Normal file
27
.github/actions/test/action.yaml
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Copyright 2022 Mattermost, Inc.
|
||||
name: "test-ci"
|
||||
description: This action used to run universal tests for all OS
|
||||
|
||||
inputs:
|
||||
shell:
|
||||
description: The shell to run the test
|
||||
required: true
|
||||
default: bash
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: ci/run-check-types
|
||||
run: npm run check-types
|
||||
shell: ${{ inputs.shell }}
|
||||
- name: ci/run-i18n-check
|
||||
shell: ${{ inputs.shell }}
|
||||
run: |
|
||||
npm run mmjstool -- i18n extract-desktop --desktop-dir .
|
||||
git --no-pager diff --exit-code i18n/en.json
|
||||
- name: ci/run-unit-ci
|
||||
shell: ${{ inputs.shell }}
|
||||
env:
|
||||
ELECTRON_DISABLE_SANDBOX: "1"
|
||||
run: |
|
||||
npm run test:unit-ci
|
169
.github/workflows/build-for-pr.yml
vendored
Normal file
169
.github/workflows/build-for-pr.yml
vendored
Normal file
|
@ -0,0 +1,169 @@
|
|||
name: build-for-pr
|
||||
|
||||
on:
|
||||
push:
|
||||
# only for build-pr branches
|
||||
# build-pr-*
|
||||
branches:
|
||||
- build-pr-*
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
TERM: xterm
|
||||
|
||||
jobs:
|
||||
build-linux-for-pr:
|
||||
runs-on: ubuntu-latest-4-cores
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: ci/install-dependencies
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
wget -qO - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key | sudo apt-key add -
|
||||
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.20.1/yq_linux_amd64 && chmod a+x /usr/local/bin/yq
|
||||
sudo apt-get update || true && sudo apt-get install -y ca-certificates libxtst-dev libpng++-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu jq icnsutils graphicsmagick tzdata
|
||||
npm ci
|
||||
- name: ci/build
|
||||
run: |
|
||||
mkdir -p ./build/linux
|
||||
npm run package:linux
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/linux
|
||||
- name: ci/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build-linux
|
||||
path: ./build/linux
|
||||
retention-days: 10 ## No need to keep CI builds more than 10 days
|
||||
|
||||
windows-install-deps:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: ci/cache-node-modules
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-build-node-modules-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-node-modules
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
- name: ci/install-dependencies
|
||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
choco install yq --version 4.15.1 -y
|
||||
npm i -g node-gyp
|
||||
node-gyp install
|
||||
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
|
||||
npm ci --openssl_fips=''
|
||||
|
||||
build-win-for-pr:
|
||||
runs-on: windows-2022
|
||||
needs:
|
||||
- windows-install-deps
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: ci/cache-node-modules
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-build-node-modules-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-node-modules
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
- name: ci/install-node-gyp
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
choco install yq --version 4.15.1 -y
|
||||
npm i -g node-gyp
|
||||
node-gyp install
|
||||
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
|
||||
- name: ci/install-dependencies
|
||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
npm ci --openssl_fips=''
|
||||
- name: ci/build
|
||||
env:
|
||||
MM_WIN_INSTALLERS: 1
|
||||
run: |
|
||||
mkdir -p ./build/win
|
||||
npm run package:windows
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/win
|
||||
- name: ci/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build-windows
|
||||
path: ./build/win
|
||||
retention-days: 10 ## No need to keep CI builds more than 10 days
|
||||
|
||||
build-mac-for-pr:
|
||||
runs-on: macos-12
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: ci/install-dependencies
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
brew install yq
|
||||
jq '.mac.target=["zip"]' electron-builder.json | jq '.mac.gatekeeperAssess=false' > /tmp/electron-builder.json && cp /tmp/electron-builder.json .
|
||||
npm ci
|
||||
- name: ci/build
|
||||
env:
|
||||
APPLEID: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_APPLE_ID }}
|
||||
APPLEIDPASS: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_APPLE_ID_PASS }}
|
||||
CSC_FOR_PULL_REQUEST: true
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_CSC_KEY_PASSWORD }}
|
||||
CSC_LINK: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_CSC_LINK }}
|
||||
run: |
|
||||
mkdir -p ./build/macos
|
||||
npm run package:mac
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/macos/
|
||||
- name: ci/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build-macos
|
||||
path: ./build/macos/
|
||||
retention-days: 10 ## No need to keep CI builds more than 10 days
|
213
.github/workflows/ci.yaml
vendored
Normal file
213
.github/workflows/ci.yaml
vendored
Normal file
|
@ -0,0 +1,213 @@
|
|||
name: ci
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
TERM: xterm
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest-4-cores
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: ci/install-dependencies
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
wget -qO - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key | sudo apt-key add -
|
||||
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.20.1/yq_linux_amd64 && chmod a+x /usr/local/bin/yq
|
||||
sudo apt-get update || true && sudo apt-get install -y ca-certificates libxtst-dev libpng++-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu jq icnsutils graphicsmagick tzdata
|
||||
npm ci
|
||||
- name: ci/test
|
||||
uses: ./.github/actions/test
|
||||
- name: ci/build
|
||||
run: |
|
||||
mkdir -p ./build/linux
|
||||
npm run package:linux
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/linux
|
||||
- name: ci/upload-test-results
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: linux-test-results
|
||||
path: test-results.xml
|
||||
retention-days: 5
|
||||
- name: ci/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build-linux
|
||||
path: ./build/linux
|
||||
retention-days: 10 ## No need to keep CI builds more than 10 days
|
||||
|
||||
windows-install-deps:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: ci/cache-node-modules
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-build-node-modules-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-node-modules
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
- name: ci/install-dependencies
|
||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
choco install yq --version 4.15.1 -y
|
||||
npm i -g node-gyp
|
||||
node-gyp install
|
||||
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
|
||||
npm ci --openssl_fips=''
|
||||
|
||||
build-win-no-installer:
|
||||
runs-on: windows-2022
|
||||
needs:
|
||||
- windows-install-deps
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: ci/cache-node-modules
|
||||
id: cache-node-modules
|
||||
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.os }}-build-node-modules-${{ hashFiles('package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-node-modules
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
- name: ci/install-node-gyp
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
choco install yq --version 4.15.1 -y
|
||||
npm i -g node-gyp
|
||||
node-gyp install
|
||||
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
|
||||
- name: ci/install-dependencies
|
||||
if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
npm ci --openssl_fips=''
|
||||
- name: ci/test
|
||||
uses: ./.github/actions/test
|
||||
- name: ci/build
|
||||
run: |
|
||||
mkdir -p ./build/win
|
||||
npm run package:windows
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/win
|
||||
- name: ci/upload-test-results
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: windows-test-results
|
||||
path: test-results.xml
|
||||
retention-days: 5
|
||||
- name: ci/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build-windows
|
||||
path: ./build/win
|
||||
retention-days: 10 ## No need to keep CI builds more than 10 days
|
||||
|
||||
build-mac-no-dmg:
|
||||
runs-on: macos-12
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: ci/install-dependencies
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
brew install yq
|
||||
jq '.mac.target=["zip"]' electron-builder.json | jq '.mac.gatekeeperAssess=false' > /tmp/electron-builder.json && cp /tmp/electron-builder.json .
|
||||
npm ci
|
||||
- name: ci/test
|
||||
uses: ./.github/actions/test
|
||||
- name: ci/build
|
||||
run: |
|
||||
mkdir -p ./build/macos
|
||||
npm run package:mac
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/macos/
|
||||
- name: ci/upload-test-results
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: macos-test-results
|
||||
path: test-results.xml
|
||||
retention-days: 5
|
||||
- name: ci/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build-macos
|
||||
path: ./build/macos/
|
||||
retention-days: 10 ## No need to keep CI builds more than 10 days
|
||||
|
||||
report-test-results:
|
||||
if: always()
|
||||
needs:
|
||||
- build-mac-no-dmg
|
||||
- build-win-no-installer
|
||||
- build-linux
|
||||
runs-on: ubuntu-22.04
|
||||
permissions:
|
||||
checks: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: ci/download-macos-test-results
|
||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||
with:
|
||||
name: macos-test-results
|
||||
path: macos-test-results
|
||||
- name: ci/download-windows-test-results
|
||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||
with:
|
||||
name: windows-test-results
|
||||
path: windows-test-results
|
||||
- name: ci/download-linux-test-results
|
||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||
with:
|
||||
name: linux-test-results
|
||||
path: linux-test-results
|
||||
- name: ci/publish-results
|
||||
uses: EnricoMi/publish-unit-test-result-action@a3caf02865c0604ad3dc1ecfcc5cdec9c41b7936 # v2.3.0
|
||||
with:
|
||||
comment_mode: failures
|
||||
compare_to_earlier_commit: false
|
||||
junit_files: "**/*.xml"
|
235
.github/workflows/nightly-browser-view.yml
vendored
Normal file
235
.github/workflows/nightly-browser-view.yml
vendored
Normal file
|
@ -0,0 +1,235 @@
|
|||
name: nightly-browser-view
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: 0 4 * * 0-5
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
TERM: xterm
|
||||
MM_WIN_INSTALLERS: 1
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: ci/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: ci/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: nightly/patch-version
|
||||
uses: ./.github/actions/patch-nightly-version
|
||||
- name: ci/install-dependencies
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
wget -qO - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key | sudo apt-key add -
|
||||
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.20.1/yq_linux_amd64 && chmod a+x /usr/local/bin/yq
|
||||
sudo apt-get update || true && sudo apt-get install -y ca-certificates libxtst-dev libpng++-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu jq icnsutils graphicsmagick tzdata
|
||||
npm ci
|
||||
- name: ci/build
|
||||
run: |
|
||||
mkdir -p ./build/linux
|
||||
npm run package:linux
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/linux
|
||||
- name: ci/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build
|
||||
path: ./build
|
||||
retention-days: 5 ## No need to keep them since they are uploaded on S3
|
||||
|
||||
build-msi-installer:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: nightly/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: nightly/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: nightly/patch-version
|
||||
uses: ./.github/actions/patch-nightly-version
|
||||
- name: nightly/optimize
|
||||
shell: powershell
|
||||
run: ./scripts/Makefile.ps1 optimize
|
||||
- name: nightly/install-deps
|
||||
shell: powershell
|
||||
run: |
|
||||
./scripts/Makefile.ps1 install-deps
|
||||
choco install yq --version 4.15.1 -y
|
||||
npm i -g node-gyp
|
||||
node-gyp install
|
||||
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
|
||||
npm ci --openssl_fips=''
|
||||
- name: nightly/test
|
||||
uses: ./.github/actions/test
|
||||
- name: nightly/build
|
||||
shell: powershell
|
||||
env:
|
||||
MM_WIN_INSTALLERS: 1
|
||||
PFX_KEY: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX_KEY }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_KEY_PASSWORD }}
|
||||
PFX: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX }}
|
||||
CSC_LINK: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_LINK }}
|
||||
run: ./scripts/Makefile.ps1 build
|
||||
- name: nightly/package
|
||||
run: |
|
||||
mkdir -p ./build/win-release
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/win-release
|
||||
- name: nightly/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build
|
||||
path: ./build
|
||||
retention-days: 5 ## No need to keep them since they are uploaded on S3
|
||||
|
||||
mac-app-store-preflight:
|
||||
runs-on: macos-12
|
||||
env:
|
||||
MAS_PROFILE: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MAS_PROFILE }}
|
||||
MACOS_API_KEY_ID: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MACOS_API_KEY_ID }}
|
||||
MACOS_API_KEY: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MACOS_API_KEY }}
|
||||
MACOS_API_ISSUER_ID: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MACOS_API_ISSUER_ID }}
|
||||
CSC_FOR_PULL_REQUEST: true
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_CSC_KEY_PASSWORD}}
|
||||
CSC_LINK: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_CSC_LINK }}
|
||||
steps:
|
||||
- name: nightly/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: nightly/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: nightly/patch-version
|
||||
uses: ./.github/actions/patch-nightly-version
|
||||
- name: nightly/install-dependencies
|
||||
run: |
|
||||
brew install yq
|
||||
npm ci
|
||||
- name: nightly/copy-provisioning-profile
|
||||
run: echo $MAS_PROFILE | base64 -D > ./mas.provisionprofile
|
||||
- name: nightly/patch-version-number-for-MAS
|
||||
run: ./scripts/patch_mas_version.sh
|
||||
- name: nightly/test
|
||||
uses: ./.github/actions/test
|
||||
- name: nightly/package
|
||||
run: npm run package:mas
|
||||
- name: nightly/publish
|
||||
run: fastlane publish_test path:"$(find . -name \*.pkg -print -quit)"
|
||||
|
||||
build-mac-installer:
|
||||
runs-on: macos-12
|
||||
needs:
|
||||
- mac-app-store-preflight
|
||||
steps:
|
||||
- name: nightly/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: nightly/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: nightly/patch-version
|
||||
uses: ./.github/actions/patch-nightly-version
|
||||
- name: nightly/install-dependencies
|
||||
run: |
|
||||
brew install yq rename
|
||||
npm ci
|
||||
- name: nightly/test
|
||||
uses: ./.github/actions/test
|
||||
- name: nightly/build
|
||||
env:
|
||||
APPLEID: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_APPLE_ID }}
|
||||
APPLEIDPASS: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_APPLE_ID_PASS }}
|
||||
CSC_FOR_PULL_REQUEST: true
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_CSC_KEY_PASSWORD }}
|
||||
CSC_LINK: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_CSC_LINK }}
|
||||
run: |
|
||||
mkdir -p ./build/macos-release
|
||||
npm run package:mac-with-universal
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/macos-release
|
||||
- name: nightly/rename-arm64-to-m1
|
||||
run: rename 's/arm64/m1/' ./build/macos-release/$(jq -r .version package.json)/*
|
||||
- name: nightly/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build
|
||||
path: ./build
|
||||
retention-days: 5 ## No need to keep them since they are uploaded on S3
|
||||
|
||||
upload-to-s3:
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
links: ${{ steps.generate-linklist.outputs.linklist }}
|
||||
needs:
|
||||
- build-mac-installer
|
||||
- build-msi-installer
|
||||
- build-linux
|
||||
steps:
|
||||
- name: nightly/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: nightly/patch-version
|
||||
uses: ./.github/actions/patch-nightly-version
|
||||
- name: nightly/setup-aws-credentials
|
||||
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
|
||||
with:
|
||||
aws-region: us-east-1
|
||||
aws-access-key-id: ${{ secrets.MM_DESKTOP_RELEASE_AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.MM_DESKTOP_RELEASE_AWS_SECRET_ACCESS_KEY }}
|
||||
- name: nightly/download-builds
|
||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||
- name: nightly/setup-files-for-aws
|
||||
run: |
|
||||
mkdir -p ./aws-s3-dist
|
||||
cp -r --backup=numbered ./build/{macos-release,win-release,linux}/* ./aws-s3-dist
|
||||
- name: nightly/upload-to-s3
|
||||
run: aws s3 cp ./aws-s3-dist/ s3://releases.mattermost.com/desktop/ --acl public-read --cache-control "no-cache" --recursive
|
||||
- name: nightly/generate-linklist
|
||||
id: generate-linklist
|
||||
run: |
|
||||
mkdir -p ./links
|
||||
echo "### Nightly builds:" > ./links/linklist.txt
|
||||
echo "Links for $(date +"%b-%d-%Y")" >> ./links/linklist.txt
|
||||
echo "##### :tux: Linux" >> ./links/linklist.txt
|
||||
for i in `ls ./build/linux/$(jq -r .version package.json)/` ; do echo "- [$i](https://s3.amazonaws.com/releases.mattermost.com/desktop/$(jq -r .version package.json)/$i)" ; done >> ./links/linklist.txt
|
||||
echo "##### :apple_logo: macOS" >> ./links/linklist.txt
|
||||
for i in `ls ./build/macos-release/$(jq -r .version package.json)/` ; do echo "- [$i](https://s3.amazonaws.com/releases.mattermost.com/desktop/$(jq -r .version package.json)/$i)" ; done >> ./links/linklist.txt
|
||||
echo "##### :windows: Windows" >> ./links/linklist.txt
|
||||
for i in `ls ./build/win-release/$(jq -r .version package.json)/` ; do echo "- [$i](https://s3.amazonaws.com/releases.mattermost.com/desktop/$(jq -r .version package.json)/$i)" ; done >> ./links/linklist.txt
|
||||
cat ./links/linklist.txt
|
||||
LINKLIST=$(<./links/linklist.txt)
|
||||
## https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
|
||||
echo 'linklist<<EOF' >> $GITHUB_OUTPUT
|
||||
echo "$LINKLIST" >> $GITHUB_OUTPUT
|
||||
echo 'EOF' >> $GITHUB_OUTPUT
|
||||
|
||||
share-links-to-channel:
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- upload-to-s3
|
||||
steps:
|
||||
- name: nightly/share-links-to-channel
|
||||
run: |
|
||||
jq --null-input \
|
||||
--arg icon_url "https://upload.wikimedia.org/wikipedia/commons/1/17/Luna_symbol.png" \
|
||||
--arg username "NightBuilder" \
|
||||
--arg text "${{ needs.upload-to-s3.outputs.links }}" \
|
||||
'{"username":$username,"icon_url": $icon_url, "text": $text }' > /tmp/webhook-data.json
|
||||
curl -i -X POST -H "Content-Type: application/json" -d @/tmp/webhook-data.json ${{ secrets.MM_DESKTOP_NIGHTLY_WEBHOOK_URL }} || echo "NOFICATION FAILED! check logs as this will succeed intentionally"
|
130
.github/workflows/nightly-rainforest.yml
vendored
Normal file
130
.github/workflows/nightly-rainforest.yml
vendored
Normal file
|
@ -0,0 +1,130 @@
|
|||
name: nightly-rainforest
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: 0 4 * * 0-5
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
TERM: xterm
|
||||
MM_DESKTOP_BUILD_DISABLEGPU: true
|
||||
MM_DESKTOP_BUILD_SKIPONBOARDINGSCREENS: true
|
||||
MM_WIN_INSTALLERS: 1
|
||||
|
||||
jobs:
|
||||
build-msi-installer:
|
||||
runs-on: windows-2022
|
||||
steps:
|
||||
- name: nightly/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: nightly/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: nightly/patch-version
|
||||
uses: ./.github/actions/patch-nightly-version
|
||||
- name: nightly/optimize
|
||||
shell: powershell
|
||||
run: ./scripts/Makefile.ps1 optimize
|
||||
- name: nightly/install-deps
|
||||
shell: powershell
|
||||
run: |
|
||||
./scripts/Makefile.ps1 install-deps
|
||||
choco install yq --version 4.15.1 -y
|
||||
npm i -g node-gyp
|
||||
node-gyp install
|
||||
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
|
||||
npm ci --openssl_fips=''
|
||||
- name: nightly/test
|
||||
uses: ./.github/actions/test
|
||||
- name: nightly/build
|
||||
shell: powershell
|
||||
env:
|
||||
MM_WIN_INSTALLERS: 1
|
||||
PFX_KEY: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX_KEY }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_KEY_PASSWORD }}
|
||||
PFX: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX }}
|
||||
CSC_LINK: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_LINK }}
|
||||
run: ./scripts/Makefile.ps1 build
|
||||
- name: nightly/package
|
||||
run: |
|
||||
mkdir -p ./build/win
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/win
|
||||
- name: nightly/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build
|
||||
path: ./build
|
||||
retention-days: 5 ## No need to keep them since they are uploaded on S3
|
||||
|
||||
build-mac-installer:
|
||||
runs-on: macos-12
|
||||
steps:
|
||||
- name: nightly/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: nightly/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: nightly/patch-version
|
||||
uses: ./.github/actions/patch-nightly-version
|
||||
- name: nightly/install-dependencies
|
||||
run: |
|
||||
brew install yq rename
|
||||
npm ci
|
||||
- name: nightly/test
|
||||
uses: ./.github/actions/test
|
||||
- name: nightly/build
|
||||
env:
|
||||
APPLEID: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_APPLE_ID }}
|
||||
APPLEIDPASS: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_APPLE_ID_PASS }}
|
||||
CSC_FOR_PULL_REQUEST: true
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_CSC_KEY_PASSWORD }}
|
||||
CSC_LINK: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_CSC_LINK }}
|
||||
run: |
|
||||
mkdir -p ./build/macos
|
||||
npm run package:mac-with-universal
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/macos
|
||||
- name: nightly/rename-arm64-to-m1
|
||||
run: rename 's/arm64/m1/' ./build/macos-nightly/$(jq -r .version package.json)/*
|
||||
- name: nightly/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build
|
||||
path: ./build
|
||||
retention-days: 5 ## No need to keep them since they are uploaded on S3
|
||||
|
||||
upload-to-s3-daily:
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- build-mac-installer
|
||||
- build-msi-installer
|
||||
steps:
|
||||
- name: nightly/setup-aws-credentials
|
||||
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
|
||||
with:
|
||||
aws-region: us-east-1
|
||||
aws-access-key-id: ${{ secrets.MM_DESKTOP_DAILY_AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.MM_DESKTOP_DAILY_AWS_SECRET_ACCESS_KEY }}
|
||||
- name: nightly/download-builds
|
||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||
- name: nightly/install-missing-deps
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install rename jq -y
|
||||
- name: nightly/setup-files-for-aws
|
||||
run: |
|
||||
rename 's/\d+\.\d+\.\d+\-nightly\.\d+\/mattermost(.+)\d+\.\d+\.\d+\-nightly\.\d+/mattermost$1daily-develop/' ./build/macos/$(jq -r .version package.json)/*
|
||||
rename 's/\d+\.\d+\.\d+\-nightly\.\d+\/mattermost(.+)\d+\.\d+\.\d+\-nightly\.\d+/mattermost$1daily-develop/' ./build/win/$(jq -r .version package.json)/*
|
||||
- name: nightly/upload-to-s3
|
||||
run: aws s3 cp ./build/ s3://mattermost-desktop-daily-builds/ --acl public-read --cache-control "no-cache" --recursive
|
258
.github/workflows/release.yaml
vendored
Normal file
258
.github/workflows/release.yaml
vendored
Normal file
|
@ -0,0 +1,258 @@
|
|||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
# only for release and release candidates
|
||||
# release-XX.YY.ZZ
|
||||
# release-XX.YY.ZZ-rc-something
|
||||
branches:
|
||||
- release-[0-9]+.[0-9]+
|
||||
- release-[0-9]+.[0-9]+.[0-9]+
|
||||
- release-[0-9]+.[0-9]+-rc-[0-9]+
|
||||
- release-[0-9]+.[0-9]+.[0-9]+-rc-[0-9]+
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
TERM: xterm
|
||||
|
||||
jobs:
|
||||
begin-notification:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: release/notify-channel
|
||||
run: |
|
||||
jq --null-input \
|
||||
--arg icon_url "https://mattermost.com/wp-content/uploads/2022/02/icon.png" \
|
||||
--arg username "MattermostRelease" \
|
||||
--arg text "[$(jq -r .version package.json)] Release process for the desktop app has started, it should take about 30 minutes to complete." \
|
||||
'{"username":$username,"icon_url": $icon_url, "text": $text }' > /tmp/webhook-data.json
|
||||
curl -i -H "Content-Type: application/json" -X POST -d @/tmp/webhook-data.json ${{ secrets.MM_DESKTOP_RELEASE_WEBHOOK_URL }} || echo "NOFICATION FAILED! check logs as this will succeed intentionally"
|
||||
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest-4-cores
|
||||
needs:
|
||||
- begin-notification
|
||||
steps:
|
||||
- name: release/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: release/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: release/install-dependencies
|
||||
env:
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||
run: |
|
||||
wget -qO - https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key | sudo apt-key add -
|
||||
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.20.1/yq_linux_amd64 && chmod a+x /usr/local/bin/yq
|
||||
sudo apt-get update || true && sudo apt-get install -y ca-certificates libxtst-dev libpng++-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu jq icnsutils graphicsmagick tzdata
|
||||
npm ci
|
||||
- name: release/test
|
||||
uses: ./.github/actions/test
|
||||
- name: release/build
|
||||
run: |
|
||||
mkdir -p ./build/linux
|
||||
npm run package:linux
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/linux
|
||||
- name: release/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build
|
||||
path: ./build
|
||||
retention-days: 14 ## No need to keep CI builds more than 14 days
|
||||
|
||||
build-msi-installer:
|
||||
runs-on: windows-2022
|
||||
needs:
|
||||
- begin-notification
|
||||
steps:
|
||||
- name: release/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: release/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: release/optimize
|
||||
shell: powershell
|
||||
run: ./scripts/Makefile.ps1 optimize
|
||||
- name: release/install-deps
|
||||
shell: powershell
|
||||
run: |
|
||||
./scripts/Makefile.ps1 install-deps
|
||||
choco install yq --version 4.15.1 -y
|
||||
npm i -g node-gyp
|
||||
node-gyp install
|
||||
node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers"
|
||||
npm ci --openssl_fips=''
|
||||
- name: release/test
|
||||
uses: ./.github/actions/test
|
||||
- name: release/build
|
||||
shell: powershell
|
||||
env:
|
||||
MM_WIN_INSTALLERS: 1
|
||||
PFX_KEY: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX_KEY }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_KEY_PASSWORD }}
|
||||
PFX: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX }}
|
||||
CSC_LINK: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_LINK }}
|
||||
run: |
|
||||
./scripts/Makefile.ps1 build
|
||||
- name: release/package
|
||||
run: |
|
||||
mkdir -p ./build/win-release
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/win-release
|
||||
- name: release/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build
|
||||
path: ./build
|
||||
retention-days: 14
|
||||
|
||||
build-mac-installer:
|
||||
runs-on: macos-12
|
||||
needs:
|
||||
- mac-app-store-preflight
|
||||
steps:
|
||||
- name: release/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: release/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: release/create-build-folder
|
||||
run: mkdir -p ./build
|
||||
- name: release/install-dependencies
|
||||
run: |
|
||||
brew install yq rename
|
||||
npm ci
|
||||
- name: release/test
|
||||
uses: ./.github/actions/test
|
||||
- name: release/build
|
||||
env:
|
||||
APPLEID: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_APPLE_ID }}
|
||||
APPLEIDPASS: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_APPLE_ID_PASS }}
|
||||
CSC_FOR_PULL_REQUEST: true
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_CSC_KEY_PASSWORD }}
|
||||
CSC_LINK: ${{ secrets.MM_DESKTOP_MAC_INSTALLER_CSC_LINK }}
|
||||
run: |
|
||||
mkdir -p ./build/macos-release
|
||||
npm run package:mac-with-universal
|
||||
bash -x ./scripts/patch_updater_yml.sh
|
||||
bash -x ./scripts/cp_artifacts.sh release ./build/macos-release
|
||||
- name: release/rename-arm64-to-m1
|
||||
run: rename 's/arm64/m1/' ./build/macos-release/$(jq -r .version package.json)/*
|
||||
- name: release/upload-build
|
||||
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
||||
with:
|
||||
name: build
|
||||
path: ./build
|
||||
retention-days: 14
|
||||
|
||||
mac-app-store-preflight:
|
||||
runs-on: macos-12
|
||||
env:
|
||||
MAS_PROFILE: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MAS_PROFILE }}
|
||||
MACOS_API_KEY_ID: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MACOS_API_KEY_ID }}
|
||||
MACOS_API_KEY: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MACOS_API_KEY }}
|
||||
MACOS_API_ISSUER_ID: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_MACOS_API_ISSUER_ID }}
|
||||
CSC_FOR_PULL_REQUEST: true
|
||||
CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_CSC_KEY_PASSWORD}}
|
||||
CSC_LINK: ${{ secrets.MM_DESKTOP_MAC_APP_STORE_CSC_LINK }}
|
||||
needs:
|
||||
- begin-notification
|
||||
steps:
|
||||
- name: release/checkout-repo
|
||||
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
||||
- name: release/setup-node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
|
||||
with:
|
||||
node-version-file: "package.json"
|
||||
cache: "npm"
|
||||
cache-dependency-path: package-lock.json
|
||||
- name: release/install-dependencies
|
||||
run: |
|
||||
brew install yq
|
||||
npm ci
|
||||
- name: release/copy-provisioning-profile
|
||||
run: echo $MAS_PROFILE | base64 -D > ./mas.provisionprofile
|
||||
- name: release/patch-version-number-for-MAS
|
||||
run: ./scripts/patch_mas_version.sh
|
||||
- name: release/test
|
||||
uses: ./.github/actions/test
|
||||
- name: release/package
|
||||
run: npm run package:mas
|
||||
- name: release/publish
|
||||
run: fastlane publish_test path:"$(find . -name \*.pkg -print -quit)"
|
||||
|
||||
upload-to-s3:
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- build-mac-installer
|
||||
- build-msi-installer
|
||||
- build-linux
|
||||
steps:
|
||||
- name: release/setup-aws-credentials
|
||||
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
|
||||
with:
|
||||
aws-region: us-east-1
|
||||
aws-access-key-id: ${{ secrets.MM_DESKTOP_RELEASE_AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.MM_DESKTOP_RELEASE_AWS_SECRET_ACCESS_KEY }}
|
||||
- name: release/download-builds
|
||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||
- name: release/setup-files-for-aws
|
||||
run: |
|
||||
mkdir -p ./aws-s3-dist
|
||||
cp -r --backup=numbered ./build/{macos-release,win-release,linux}/* ./aws-s3-dist
|
||||
- name: release/upload-to-s3
|
||||
run: aws s3 cp ./aws-s3-dist/ s3://releases.mattermost.com/desktop/ --acl public-read --cache-control "no-cache" --recursive
|
||||
|
||||
github-release:
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- upload-to-s3
|
||||
steps:
|
||||
- name: release/download-builds
|
||||
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
|
||||
- name: release/setup-files-for-github-release
|
||||
run: |
|
||||
mkdir -p ./ghr-dist
|
||||
find ./build/{macos-release,win-release,linux} -type f -exec cp --backup=numbered -t ./ghr-dist {} +
|
||||
- name: release/publish-release
|
||||
run: |
|
||||
go install github.com/tcnksm/ghr@latest
|
||||
VERSION=$(jq -r .version package.json)
|
||||
RELEASE_TITLE="v${VERSION} ($(date -u "+%Y-%m-%d"))"
|
||||
ghr \
|
||||
-t ${GITHUB_TOKEN} \
|
||||
-u ${GITHUB_ACTOR} \
|
||||
-draft \
|
||||
--body="$(./scripts/generate_release_markdown.sh $VERSION)" \
|
||||
--name="${RELEASE_TITLE}" $( [[ $VERSION =~ "-rc" ]] && printf %s "-prerelease") \
|
||||
-r ${GITHUB_REPOSITORY} \
|
||||
-c ${GITHUB_SHA} \
|
||||
-delete \
|
||||
v${VERSION} ./ghr-dist
|
||||
|
||||
end-notification:
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- github-release
|
||||
steps:
|
||||
- name: release/notify-channel
|
||||
run: |
|
||||
jq --null-input \
|
||||
--arg icon_url "https://mattermost.com/wp-content/uploads/2022/02/icon.png" \
|
||||
--arg username "MattermostRelease" \
|
||||
--arg text "[$(jq -r .version package.json)] Release process for the desktop app ended, the new release can be found on [GitHub](https://github.com/mattermost/desktop/releases)." \
|
||||
'{"username":$username,"icon_url": $icon_url, "text": $text }' > /tmp/webhook-data.json
|
||||
curl -i -H "Content-Type: application/json" -X POST -d @/tmp/webhook-data.json ${{ secrets.MM_DESKTOP_RELEASE_WEBHOOK_URL }} || echo "NOFICATION FAILED! check logs as this will succeed intentionally"
|
3681
package-lock.json
generated
3681
package-lock.json
generated
File diff suppressed because it is too large
Load diff
476
package.json
476
package.json
|
@ -1,238 +1,238 @@
|
|||
{
|
||||
"name": "mattermost-desktop",
|
||||
"productName": "Mattermost",
|
||||
"version": "5.3.0-rc.4",
|
||||
"description": "Mattermost",
|
||||
"main": "dist/index.js",
|
||||
"author": "Mattermost, Inc. <feedback@mattermost.com>",
|
||||
"license": "Apache-2.0",
|
||||
"desktopName": "Mattermost.Desktop",
|
||||
"homepage": "https://mattermost.com",
|
||||
"engines": {
|
||||
"node": ">=16.16.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/mattermost/desktop.git"
|
||||
},
|
||||
"config": {
|
||||
"target": "23.1.2",
|
||||
"arch": "x64",
|
||||
"target_arch": "x64",
|
||||
"disturl": "https://electronjs.org/headers",
|
||||
"runtime": "electron",
|
||||
"build_from_source": true
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm-run-all build:*",
|
||||
"build:main": "webpack-cli --config webpack.config.main.js",
|
||||
"build:renderer": "webpack-cli --config webpack.config.renderer.js",
|
||||
"build-prod": "cross-env NODE_ENV=production npm-run-all check-build-config build",
|
||||
"build-prod-upgrade": "cross-env NODE_ENV=production CAN_UPGRADE=true npm-run-all check-build-config build",
|
||||
"build-robotjs": "cross-env CL='/std:c++17' electron-rebuild -m ./node_modules/robotjs",
|
||||
"start": "electron dist/ --disable-dev-mode",
|
||||
"restart": "npm run build && npm run start",
|
||||
"storybook": "start-storybook -p 9001 -c src/.storybook",
|
||||
"clean": "rm -rf release/ node_modules/ src/node_modules/ dist/ && find src -name '*_bundle.js' | xargs rm",
|
||||
"clean-install": "npm run clean && npm install",
|
||||
"clean-dist": "rm -rf dist/",
|
||||
"watch": "run-p watch:*",
|
||||
"watch:main": "node scripts/watch_main_and_preload.js",
|
||||
"watch:renderer": "webpack-dev-server --config webpack.config.renderer.js",
|
||||
"test": "npm-run-all lint:js test:unit test:e2e",
|
||||
"test:docker": "node scripts/setup_e2e_docker.js",
|
||||
"test:e2e": "cross-env NODE_ENV=test npm-run-all build build-robotjs test:e2e:build test:e2e:run",
|
||||
"test:e2e:performance": "cross-env NODE_ENV=test PERFORMANCE=true npm-run-all build build-robotjs test:e2e:build-performance test:e2e:run-performance",
|
||||
"test:e2e:nobuild": "cross-env NODE_ENV=test npm-run-all test:e2e:build test:e2e:run",
|
||||
"test:e2e:build": "webpack-cli --config webpack.config.test.js",
|
||||
"test:e2e:build-performance": "webpack-cli --config webpack.config.performance.test.js",
|
||||
"test:e2e:run-performance": "electron-mocha -r @babel/register --reporter json --reporter-option output=./e2e/performance/perf-test-report.json dist/tests/e2e_bundle.js",
|
||||
"test:e2e:run": "electron-mocha -r @babel/register --reporter mochawesome dist/tests/e2e_bundle.js",
|
||||
"test:e2e:send-report": "node ./e2e/save_report.js",
|
||||
"test:unit": "cross-env NODE_ENV=jest jest",
|
||||
"test:unit-ci": "cross-env NODE_ENV=jest jest --runInBand",
|
||||
"test:coverage": "jest --coverage",
|
||||
"package:all": "cross-env NODE_ENV=production npm-run-all package:windows package:windows-nsis package:mac package:mac-with-universal package:linux",
|
||||
"package:windows": "npm-run-all build-prod && electron-builder --win zip --x64 --ia32 --arm64 --publish=never",
|
||||
"package:windows-nsis": "npm-run-all build-prod-upgrade && electron-builder --win zip nsis --x64 --ia32 --arm64 --publish=never",
|
||||
"package:mac": "npm-run-all build-prod && electron-builder --mac --x64 --arm64 --publish=never",
|
||||
"package:mac-with-universal": "npm-run-all build-prod && electron-builder --mac --x64 --arm64 --universal --publish=never",
|
||||
"package:mas": "cross-env NODE_ENV=production IS_MAC_APP_STORE=true npm-run-all check-build-config build && electron-builder --mac mas --universal --publish=never",
|
||||
"package:mas-dev": "cross-env NODE_ENV=production IS_MAC_APP_STORE=true npm-run-all check-build-config build && electron-builder --mac mas-dev --universal --publish=never",
|
||||
"package:linux": "npm-run-all package:linux-all package:linux-appImage",
|
||||
"package:linux-appImage": "npm-run-all build-prod-upgrade package:linux-appImage-x64 package:linux-appImage-arm64",
|
||||
"package:linux-appImage-x64": "electron-builder --linux tar.gz appimage --x64 --publish=never",
|
||||
"package:linux-appImage-arm64": "cross-env CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ electron-builder --linux tar.gz appimage --arm64 --publish=never",
|
||||
"package:linux-all": "npm-run-all build-prod package:linux-all-x64 package:linux-all-arm64",
|
||||
"package:linux-all-x64": "electron-builder --linux tar.gz deb rpm --x64 --publish=never",
|
||||
"package:linux-all-arm64": "cross-env CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ electron-builder --linux tar.gz deb rpm --arm64 --publish=never",
|
||||
"lint:js": "eslint --ignore-path .gitignore --ignore-pattern node_modules --ext .js --ext .jsx --ext .ts --ext .tsx .",
|
||||
"lint:js-quiet": "eslint --ignore-path .gitignore --ignore-pattern node_modules --ext .js --ext .jsx --ext .ts --ext .tsx . --quiet",
|
||||
"fix:js": "eslint --ignore-path .gitignore --ignore-pattern node_modules --quiet --ext .js --ext .jsx --ext .ts --ext .tsx . --fix",
|
||||
"check-build-config": "npm-run-all check-build-config:build check-build-config:run",
|
||||
"check-build-config:build": "babel ./src/common/config/buildConfig.ts -o ./dist/buildConfig.js",
|
||||
"check-build-config:run": "node -r @babel/register scripts/check_build_config.js",
|
||||
"check-types": "tsc",
|
||||
"prune": "ts-prune",
|
||||
"mmjstool": "mmjstool",
|
||||
"i18n-extract": "npm run mmjstool -- i18n extract-desktop",
|
||||
"postinstall": "node scripts/patch_macos_notification_state.js && electron-builder install-app-deps"
|
||||
},
|
||||
"jest": {
|
||||
"clearMocks": true,
|
||||
"moduleDirectories": [
|
||||
"",
|
||||
"node_modules"
|
||||
],
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js",
|
||||
"jsx",
|
||||
"json"
|
||||
],
|
||||
"collectCoverageFrom": [
|
||||
"src/common/**/*.ts",
|
||||
"src/main/**/*.ts"
|
||||
],
|
||||
"testMatch": [
|
||||
"**/src/**/*.test.js"
|
||||
],
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
"/e2e/",
|
||||
"/webpack.config.test.js"
|
||||
],
|
||||
"globals": {
|
||||
"__HASH_VERSION__": "5.0.0",
|
||||
"__CAN_UPGRADE__": false,
|
||||
"__IS_NIGHTLY_BUILD__": false,
|
||||
"__IS_MAC_APP_STORE__": false,
|
||||
"__DISABLE_GPU__": false,
|
||||
"__SKIP_ONBOARDING_SCREENS__": false
|
||||
},
|
||||
"setupFiles": [
|
||||
"./src/jest/jestSetup.js"
|
||||
],
|
||||
"setupFilesAfterEnv": [
|
||||
"./src/jest/jestSetupAfterEnv.js"
|
||||
],
|
||||
"reporters": [
|
||||
"default",
|
||||
[
|
||||
"jest-junit",
|
||||
{
|
||||
"suiteName": "unit tests",
|
||||
"outputName": "test-results.xml",
|
||||
"classNameTemplate": "{classname}-{title}",
|
||||
"titleTemplate": "{classname}-{title}",
|
||||
"ancestorSeparator": "> "
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.17.6",
|
||||
"@babel/core": "7.17.8",
|
||||
"@babel/plugin-proposal-class-properties": "7.16.7",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.17.3",
|
||||
"@babel/preset-env": "7.16.11",
|
||||
"@babel/preset-react": "7.16.7",
|
||||
"@babel/register": "7.17.7",
|
||||
"@bloomberg/record-tuple-polyfill": "^0.0.4",
|
||||
"@electron/fuses": "1.6.0",
|
||||
"@electron/universal": "1.3.1",
|
||||
"@mattermost/compass-icons": "0.1.32",
|
||||
"@storybook/addon-actions": "6.4.20",
|
||||
"@storybook/react": "6.4.20",
|
||||
"@types/auto-launch": "5.0.2",
|
||||
"@types/electron-devtools-installer": "2.2.1",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/react": "17.0.43",
|
||||
"@types/react-beautiful-dnd": "13.0.0",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"@types/valid-url": "1.0.3",
|
||||
"@types/winreg": "1.2.31",
|
||||
"@typescript-eslint/eslint-plugin": "5.18.0",
|
||||
"@typescript-eslint/parser": "5.18.0",
|
||||
"7zip-bin": "5.1.1",
|
||||
"auto-launch": "5.0.5",
|
||||
"aws-sdk": "^2.1190.0",
|
||||
"axios": "0.26.1",
|
||||
"babel-eslint": "10.1.0",
|
||||
"babel-loader": "8.2.4",
|
||||
"bootstrap": "4.6.1",
|
||||
"bootstrap-dark": "1.0.3",
|
||||
"chai": "4.3.6",
|
||||
"classnames": "2.3.1",
|
||||
"copy-webpack-plugin": "10.2.4",
|
||||
"cross-env": "7.0.3",
|
||||
"css-loader": "6.7.1",
|
||||
"electron": "23.1.2",
|
||||
"electron-builder": "23.3.3",
|
||||
"electron-connect": "0.6.3",
|
||||
"electron-context-menu": "3.5.0",
|
||||
"electron-devtools-installer": "3.2.0",
|
||||
"electron-is-dev": "2.0.0",
|
||||
"electron-log": "4.4.8",
|
||||
"electron-mocha": "11.0.2",
|
||||
"electron-notarize": "1.2.1",
|
||||
"electron-rebuild": "3.2.9",
|
||||
"electron-updater": "5.2.1",
|
||||
"eslint": "7.29.0",
|
||||
"eslint-import-resolver-webpack": "0.13.2",
|
||||
"eslint-plugin-babel": "5.3.1",
|
||||
"eslint-plugin-cypress": "2.11.3",
|
||||
"eslint-plugin-header": "3.1.1",
|
||||
"eslint-plugin-import": "2.25.4",
|
||||
"eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#46ad99355644a719bf32082f472048f526605181",
|
||||
"eslint-plugin-no-only-tests": "2.6.0",
|
||||
"eslint-plugin-react": "7.29.4",
|
||||
"eslint-plugin-react-hooks": "4.4.0",
|
||||
"fs-extra": "10.0.1",
|
||||
"jest": "27.5.1",
|
||||
"jest-junit": "13.1.0",
|
||||
"joi": "17.6.0",
|
||||
"mini-css-extract-plugin": "2.6.0",
|
||||
"mmjstool": "github:mattermost/mattermost-utilities#3b4506b0f6b14fbb402f9f8ef932370e459e3773",
|
||||
"mocha-circleci-reporter": "0.0.3",
|
||||
"mochawesome": "7.1.3",
|
||||
"nan": "2.17.0",
|
||||
"node-abi": "3.26.0",
|
||||
"node-jq": "2.3.4",
|
||||
"node-loader": "2.0.0",
|
||||
"npm-run-all": "4.1.5",
|
||||
"playwright": "1.28.1",
|
||||
"pretty-bytes": "6.0.0",
|
||||
"ps-node": "^0.1.6",
|
||||
"react": "16.14.0",
|
||||
"react-beautiful-dnd": "13.1.0",
|
||||
"react-bootstrap": "1.6.4",
|
||||
"react-dom": "16.14.0",
|
||||
"react-intl": "5.20.10",
|
||||
"react-select": "5.2.2",
|
||||
"recursive-readdir": "^2.2.2",
|
||||
"robotjs": "0.6.0",
|
||||
"sass": "1.49.11",
|
||||
"sass-loader": "12.6.0",
|
||||
"semver": "7.3.5",
|
||||
"shebang-loader": "0.0.1",
|
||||
"style-loader": "3.3.1",
|
||||
"ts-prune": "0.10.3",
|
||||
"typescript": "4.6.3",
|
||||
"valid-url": "1.0.9",
|
||||
"webpack": "5.71.0",
|
||||
"webpack-cli": "4.10.0",
|
||||
"webpack-dev-server": "4.8.0",
|
||||
"webpack-merge": "5.8.0",
|
||||
"winreg-utf8": "0.1.1",
|
||||
"yargs": "17.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"macos-notification-state": "2.0.2",
|
||||
"windows-focus-assist": "1.3.0"
|
||||
},
|
||||
"overrides": {
|
||||
"@electron/universal": "1.3.1"
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "mattermost-desktop",
|
||||
"productName": "Mattermost",
|
||||
"version": "5.3.0-rc.4",
|
||||
"description": "Mattermost",
|
||||
"main": "dist/index.js",
|
||||
"author": "Mattermost, Inc. <feedback@mattermost.com>",
|
||||
"license": "Apache-2.0",
|
||||
"desktopName": "Mattermost.Desktop",
|
||||
"homepage": "https://mattermost.com",
|
||||
"engines": {
|
||||
"node": ">=16.16.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/mattermost/desktop.git"
|
||||
},
|
||||
"config": {
|
||||
"target": "23.1.2",
|
||||
"arch": "x64",
|
||||
"target_arch": "x64",
|
||||
"disturl": "https://electronjs.org/headers",
|
||||
"runtime": "electron",
|
||||
"build_from_source": true
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm-run-all build:*",
|
||||
"build:main": "webpack-cli --config webpack.config.main.js",
|
||||
"build:renderer": "webpack-cli --config webpack.config.renderer.js",
|
||||
"build-prod": "cross-env NODE_ENV=production npm-run-all check-build-config build",
|
||||
"build-prod-upgrade": "cross-env NODE_ENV=production CAN_UPGRADE=true npm-run-all check-build-config build",
|
||||
"build-robotjs": "cross-env CL='/std:c++17' electron-rebuild -m ./node_modules/robotjs",
|
||||
"start": "electron dist/ --disable-dev-mode",
|
||||
"restart": "npm run build && npm run start",
|
||||
"storybook": "start-storybook -p 9001 -c src/.storybook",
|
||||
"clean": "rm -rf release/ node_modules/ src/node_modules/ dist/ && find src -name '*_bundle.js' | xargs rm",
|
||||
"clean-install": "npm run clean && npm install",
|
||||
"clean-dist": "rm -rf dist/",
|
||||
"watch": "run-p watch:*",
|
||||
"watch:main": "node scripts/watch_main_and_preload.js",
|
||||
"watch:renderer": "webpack-dev-server --config webpack.config.renderer.js",
|
||||
"test": "npm-run-all lint:js test:unit test:e2e",
|
||||
"test:docker": "node scripts/setup_e2e_docker.js",
|
||||
"test:e2e": "cross-env NODE_ENV=test npm-run-all build build-robotjs test:e2e:build test:e2e:run",
|
||||
"test:e2e:performance": "cross-env NODE_ENV=test PERFORMANCE=true npm-run-all build build-robotjs test:e2e:build-performance test:e2e:run-performance",
|
||||
"test:e2e:nobuild": "cross-env NODE_ENV=test npm-run-all test:e2e:build test:e2e:run",
|
||||
"test:e2e:build": "webpack-cli --config webpack.config.test.js",
|
||||
"test:e2e:build-performance": "webpack-cli --config webpack.config.performance.test.js",
|
||||
"test:e2e:run-performance": "electron-mocha -r @babel/register --reporter json --reporter-option output=./e2e/performance/perf-test-report.json dist/tests/e2e_bundle.js",
|
||||
"test:e2e:run": "electron-mocha -r @babel/register --reporter mochawesome dist/tests/e2e_bundle.js",
|
||||
"test:e2e:send-report": "node ./e2e/save_report.js",
|
||||
"test:unit": "cross-env NODE_ENV=jest jest",
|
||||
"test:unit-ci": "cross-env NODE_ENV=jest jest",
|
||||
"test:coverage": "jest --coverage",
|
||||
"package:all": "cross-env NODE_ENV=production npm-run-all package:windows package:windows-nsis package:mac package:mac-with-universal package:linux",
|
||||
"package:windows": "npm-run-all build-prod && electron-builder --win zip --x64 --ia32 --arm64 --publish=never",
|
||||
"package:windows-nsis": "npm-run-all build-prod-upgrade && electron-builder --win zip nsis --x64 --ia32 --arm64 --publish=never",
|
||||
"package:mac": "npm-run-all build-prod && electron-builder --mac --x64 --arm64 --publish=never",
|
||||
"package:mac-with-universal": "npm-run-all build-prod && electron-builder --mac --x64 --arm64 --universal --publish=never",
|
||||
"package:mas": "cross-env NODE_ENV=production IS_MAC_APP_STORE=true npm-run-all check-build-config build && electron-builder --mac mas --universal --publish=never",
|
||||
"package:mas-dev": "cross-env NODE_ENV=production IS_MAC_APP_STORE=true npm-run-all check-build-config build && electron-builder --mac mas-dev --universal --publish=never",
|
||||
"package:linux": "npm-run-all package:linux-all package:linux-appImage",
|
||||
"package:linux-appImage": "npm-run-all build-prod-upgrade package:linux-appImage-x64 package:linux-appImage-arm64",
|
||||
"package:linux-appImage-x64": "electron-builder --linux tar.gz appimage --x64 --publish=never",
|
||||
"package:linux-appImage-arm64": "cross-env CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ electron-builder --linux tar.gz appimage --arm64 --publish=never",
|
||||
"package:linux-all": "npm-run-all build-prod package:linux-all-x64 package:linux-all-arm64",
|
||||
"package:linux-all-x64": "electron-builder --linux tar.gz deb rpm --x64 --publish=never",
|
||||
"package:linux-all-arm64": "cross-env CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ electron-builder --linux tar.gz deb rpm --arm64 --publish=never",
|
||||
"lint:js": "eslint --ignore-path .gitignore --ignore-pattern node_modules --ext .js --ext .jsx --ext .ts --ext .tsx .",
|
||||
"lint:js-quiet": "eslint --ignore-path .gitignore --ignore-pattern node_modules --ext .js --ext .jsx --ext .ts --ext .tsx . --quiet",
|
||||
"fix:js": "eslint --ignore-path .gitignore --ignore-pattern node_modules --quiet --ext .js --ext .jsx --ext .ts --ext .tsx . --fix",
|
||||
"check-build-config": "npm-run-all check-build-config:build check-build-config:run",
|
||||
"check-build-config:build": "babel ./src/common/config/buildConfig.ts -o ./dist/buildConfig.js",
|
||||
"check-build-config:run": "node -r @babel/register scripts/check_build_config.js",
|
||||
"check-types": "tsc",
|
||||
"prune": "ts-prune",
|
||||
"mmjstool": "mmjstool",
|
||||
"i18n-extract": "npm run mmjstool -- i18n extract-desktop",
|
||||
"postinstall": "node scripts/patch_macos_notification_state.js && electron-builder install-app-deps"
|
||||
},
|
||||
"jest": {
|
||||
"clearMocks": true,
|
||||
"moduleDirectories": [
|
||||
"src",
|
||||
"node_modules"
|
||||
],
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js",
|
||||
"jsx",
|
||||
"json"
|
||||
],
|
||||
"collectCoverageFrom": [
|
||||
"src/common/**/*.ts",
|
||||
"src/main/**/*.ts"
|
||||
],
|
||||
"testMatch": [
|
||||
"**/src/**/*.test.js"
|
||||
],
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
"/e2e/",
|
||||
"/webpack.config.test.js"
|
||||
],
|
||||
"globals": {
|
||||
"__HASH_VERSION__": "5.0.0",
|
||||
"__CAN_UPGRADE__": false,
|
||||
"__IS_NIGHTLY_BUILD__": false,
|
||||
"__IS_MAC_APP_STORE__": false,
|
||||
"__DISABLE_GPU__": false,
|
||||
"__SKIP_ONBOARDING_SCREENS__": false
|
||||
},
|
||||
"setupFiles": [
|
||||
"./src/jest/jestSetup.js"
|
||||
],
|
||||
"setupFilesAfterEnv": [
|
||||
"./src/jest/jestSetupAfterEnv.js"
|
||||
],
|
||||
"reporters": [
|
||||
"default",
|
||||
[
|
||||
"jest-junit",
|
||||
{
|
||||
"suiteName": "unit tests",
|
||||
"outputName": "test-results.xml",
|
||||
"classNameTemplate": "{classname}-{title}",
|
||||
"titleTemplate": "{classname}-{title}",
|
||||
"ancestorSeparator": "> "
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.17.6",
|
||||
"@babel/core": "7.17.8",
|
||||
"@babel/plugin-proposal-class-properties": "7.16.7",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.17.3",
|
||||
"@babel/preset-env": "7.16.11",
|
||||
"@babel/preset-react": "7.16.7",
|
||||
"@babel/register": "7.17.7",
|
||||
"@bloomberg/record-tuple-polyfill": "^0.0.4",
|
||||
"@electron/fuses": "1.6.0",
|
||||
"@electron/universal": "1.3.1",
|
||||
"@mattermost/compass-icons": "0.1.32",
|
||||
"@storybook/addon-actions": "6.4.20",
|
||||
"@storybook/react": "6.4.20",
|
||||
"@types/auto-launch": "5.0.2",
|
||||
"@types/electron-devtools-installer": "2.2.1",
|
||||
"@types/jest": "^29.0.0",
|
||||
"@types/react": "17.0.43",
|
||||
"@types/react-beautiful-dnd": "13.0.0",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"@types/valid-url": "1.0.3",
|
||||
"@types/winreg": "1.2.31",
|
||||
"@typescript-eslint/eslint-plugin": "5.18.0",
|
||||
"@typescript-eslint/parser": "5.18.0",
|
||||
"7zip-bin": "5.1.1",
|
||||
"auto-launch": "5.0.5",
|
||||
"aws-sdk": "^2.1190.0",
|
||||
"axios": "0.26.1",
|
||||
"babel-eslint": "10.1.0",
|
||||
"babel-loader": "8.2.4",
|
||||
"bootstrap": "4.6.1",
|
||||
"bootstrap-dark": "1.0.3",
|
||||
"chai": "4.3.6",
|
||||
"classnames": "2.3.1",
|
||||
"copy-webpack-plugin": "10.2.4",
|
||||
"cross-env": "7.0.3",
|
||||
"css-loader": "6.7.1",
|
||||
"electron": "23.1.2",
|
||||
"electron-builder": "23.3.3",
|
||||
"electron-connect": "0.6.3",
|
||||
"electron-context-menu": "3.5.0",
|
||||
"electron-devtools-installer": "3.2.0",
|
||||
"electron-is-dev": "2.0.0",
|
||||
"electron-log": "4.4.8",
|
||||
"electron-mocha": "11.0.2",
|
||||
"electron-notarize": "1.2.1",
|
||||
"electron-rebuild": "3.2.9",
|
||||
"electron-updater": "5.2.1",
|
||||
"eslint": "7.29.0",
|
||||
"eslint-import-resolver-webpack": "0.13.2",
|
||||
"eslint-plugin-babel": "5.3.1",
|
||||
"eslint-plugin-cypress": "2.11.3",
|
||||
"eslint-plugin-header": "3.1.1",
|
||||
"eslint-plugin-import": "2.25.4",
|
||||
"eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#46ad99355644a719bf32082f472048f526605181",
|
||||
"eslint-plugin-no-only-tests": "2.6.0",
|
||||
"eslint-plugin-react": "7.29.4",
|
||||
"eslint-plugin-react-hooks": "4.4.0",
|
||||
"fs-extra": "10.0.1",
|
||||
"jest": "29.4.1",
|
||||
"jest-junit": "13.1.0",
|
||||
"joi": "17.6.0",
|
||||
"mini-css-extract-plugin": "2.6.0",
|
||||
"mmjstool": "github:mattermost/mattermost-utilities#3b4506b0f6b14fbb402f9f8ef932370e459e3773",
|
||||
"mocha-circleci-reporter": "0.0.3",
|
||||
"mochawesome": "7.1.3",
|
||||
"nan": "2.17.0",
|
||||
"node-abi": "3.26.0",
|
||||
"node-jq": "2.3.4",
|
||||
"node-loader": "2.0.0",
|
||||
"npm-run-all": "4.1.5",
|
||||
"playwright": "1.28.1",
|
||||
"pretty-bytes": "6.0.0",
|
||||
"ps-node": "^0.1.6",
|
||||
"react": "16.14.0",
|
||||
"react-beautiful-dnd": "13.1.0",
|
||||
"react-bootstrap": "1.6.4",
|
||||
"react-dom": "16.14.0",
|
||||
"react-intl": "5.20.10",
|
||||
"react-select": "5.2.2",
|
||||
"recursive-readdir": "^2.2.2",
|
||||
"robotjs": "0.6.0",
|
||||
"sass": "1.49.11",
|
||||
"sass-loader": "12.6.0",
|
||||
"semver": "7.3.5",
|
||||
"shebang-loader": "0.0.1",
|
||||
"style-loader": "3.3.1",
|
||||
"ts-prune": "0.10.3",
|
||||
"typescript": "4.6.3",
|
||||
"valid-url": "1.0.9",
|
||||
"webpack": "5.71.0",
|
||||
"webpack-cli": "4.10.0",
|
||||
"webpack-dev-server": "4.8.0",
|
||||
"webpack-merge": "5.8.0",
|
||||
"winreg-utf8": "0.1.1",
|
||||
"yargs": "17.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"macos-notification-state": "2.0.2",
|
||||
"windows-focus-assist": "1.3.0"
|
||||
},
|
||||
"overrides": {
|
||||
"@electron/universal": "1.3.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,8 @@ if [ "$BUILD_VERSION" == "" ]; then
|
|||
BUILD_VERSION=$STABLE_VERSION
|
||||
fi
|
||||
|
||||
if [ "$CIRCLE_BUILD_NUM" != "" ]; then
|
||||
BUILD_VERSION=$CIRCLE_BUILD_NUM
|
||||
if [ "$GITHUB_RUN_ID" != "" ]; then
|
||||
BUILD_VERSION="${GITHUB_RUN_ID}${GITHUB_RUN_ATTEMPT}"
|
||||
fi
|
||||
|
||||
temp_file="$(mktemp -t electron-builder.json)"
|
||||
|
|
|
@ -15,17 +15,21 @@ import {initialize} from './initialize';
|
|||
import {clearAppCache, getDeeplinkingURL, wasUpdated} from './utils';
|
||||
|
||||
jest.mock('fs', () => ({
|
||||
unlinkSync: jest.fn(),
|
||||
accessSync: jest.fn(),
|
||||
existsSync: jest.fn().mockReturnValue(false),
|
||||
mkdirSync: jest.fn(),
|
||||
readFile: jest.fn(),
|
||||
readFileSync: jest.fn().mockImplementation((text) => text),
|
||||
unlinkSync: jest.fn(),
|
||||
writeFile: jest.fn(),
|
||||
|
||||
writeFileSync: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.mock('path', () => {
|
||||
const original = jest.requireActual('path');
|
||||
return {
|
||||
...original,
|
||||
dirname: jest.fn().mockImplementation((p) => p),
|
||||
resolve: jest.fn(),
|
||||
};
|
||||
});
|
||||
|
@ -33,6 +37,7 @@ jest.mock('path', () => {
|
|||
jest.mock('electron', () => ({
|
||||
app: {
|
||||
on: jest.fn(),
|
||||
handle: jest.fn(),
|
||||
exit: jest.fn(),
|
||||
getPath: jest.fn(),
|
||||
setPath: jest.fn(),
|
||||
|
@ -118,6 +123,9 @@ jest.mock('main/app/utils', () => ({
|
|||
wasUpdated: jest.fn(),
|
||||
initCookieManager: jest.fn(),
|
||||
}));
|
||||
jest.mock('main/appState', () => ({
|
||||
on: jest.fn(),
|
||||
}));
|
||||
jest.mock('main/AppVersionManager', () => ({}));
|
||||
jest.mock('main/authManager', () => ({}));
|
||||
jest.mock('main/AutoLauncher', () => ({
|
||||
|
@ -155,7 +163,16 @@ jest.mock('main/windows/windowManager', () => ({
|
|||
getServerNameByWebContentsId: jest.fn(),
|
||||
getServerURLFromWebContentsId: jest.fn(),
|
||||
}));
|
||||
const originalProcess = process;
|
||||
describe('main/app/initialize', () => {
|
||||
beforeAll(() => {
|
||||
global.process = {
|
||||
...originalProcess,
|
||||
on: jest.fn(),
|
||||
chdir: jest.fn(),
|
||||
cwd: jest.fn().mockImplementation((text) => text),
|
||||
};
|
||||
});
|
||||
beforeEach(() => {
|
||||
parseArgs.mockReturnValue({});
|
||||
Config.once.mockImplementation((event, cb) => {
|
||||
|
@ -175,6 +192,10 @@ describe('main/app/initialize', () => {
|
|||
delete Config.data;
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
global.process = originalProcess;
|
||||
});
|
||||
|
||||
it('should initialize without errors', async () => {
|
||||
await initialize();
|
||||
});
|
||||
|
|
|
@ -116,6 +116,8 @@ describe('main/autoUpdater', () => {
|
|||
|
||||
afterEach(() => {
|
||||
jest.runAllTimers();
|
||||
jest.runOnlyPendingTimers();
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('should add a new timeout', () => {
|
||||
|
@ -153,6 +155,12 @@ describe('main/autoUpdater', () => {
|
|||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jest.runOnlyPendingTimers();
|
||||
jest.clearAllTimers();
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('should show dialog if update is not available', () => {
|
||||
autoUpdater.once.mockImplementation((event, callback) => {
|
||||
if (event === 'update-not-available') {
|
||||
|
|
|
@ -124,6 +124,12 @@ describe('main/views/MattermostView', () => {
|
|||
mattermostView.retryInBackground = () => retryInBackgroundFn;
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jest.runOnlyPendingTimers();
|
||||
jest.clearAllTimers();
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('should do nothing when webcontents are destroyed', () => {
|
||||
const webContents = mattermostView.view.webContents;
|
||||
mattermostView.view.webContents = null;
|
||||
|
@ -180,6 +186,12 @@ describe('main/views/MattermostView', () => {
|
|||
mattermostView.findUnreadState = jest.fn();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jest.runOnlyPendingTimers();
|
||||
jest.clearAllTimers();
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('should reset max retries', () => {
|
||||
mattermostView.maxRetries = 1;
|
||||
mattermostView.loadSuccess('http://server-1.com')();
|
||||
|
@ -198,6 +210,12 @@ describe('main/views/MattermostView', () => {
|
|||
mattermostView.focus = jest.fn();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jest.runOnlyPendingTimers();
|
||||
jest.clearAllTimers();
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('should add browser view to window and set bounds when request is true and view not currently visible', () => {
|
||||
mattermostView.isVisible = false;
|
||||
mattermostView.show(true);
|
||||
|
|
|
@ -72,6 +72,7 @@ export default class CallsWidgetWindow extends EventEmitter {
|
|||
|
||||
this.win.once('ready-to-show', () => this.win.show());
|
||||
this.win.once('show', this.onShow);
|
||||
|
||||
this.win.on('closed', this.onClosed);
|
||||
ipcMain.on(CALLS_WIDGET_RESIZE, this.onResize);
|
||||
ipcMain.on(CALLS_WIDGET_SHARE_SCREEN, this.onShareScreen);
|
||||
|
|
|
@ -234,6 +234,9 @@ describe('main/windows/windowManager', () => {
|
|||
afterEach(() => {
|
||||
jest.runAllTimers();
|
||||
jest.resetAllMocks();
|
||||
jest.runOnlyPendingTimers();
|
||||
jest.clearAllTimers();
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('should update loading screen and team dropdown bounds', () => {
|
||||
|
@ -670,6 +673,12 @@ describe('main/windows/windowManager', () => {
|
|||
Config.teams = [];
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jest.runOnlyPendingTimers();
|
||||
jest.clearAllTimers();
|
||||
jest.useRealTimers();
|
||||
});
|
||||
|
||||
it('should do nothing if cannot find the server', () => {
|
||||
windowManager.switchServer('server-3');
|
||||
expect(getTabViewName).not.toBeCalled();
|
||||
|
|
Loading…
Reference in a new issue