[MM-18552] Autoupdater (#1714)

* wip

* background download

* various fixes

* wip

* wokring autoupgrade

* fix menu

* fix windows

* cleanup

* add publishername

* fix messages and titles

* Test updates

* Moved module and added functionality to click icon to install (instead of just download)

* Add auto update setting, update on close app if downloaded

* Tests, changes for security fixes, update version number

* Update E2E tests

* Lint fix

* Update to latest electron-updater

* Revert to stable electron-builder (only needed to update electron-updater)

* Fix package-lock

* skip flaky test

* Update package

* Fix E2E test

* Fixes for enabling/disabled autoupdater

* Fixed GPO definitions

* [MM-38300] Set localhost as the test server

* blank

* Switch to s3 bucket for testing

* Update icons to match spec

* Add menu items for download/update actions

* Type and test fixes

* Fix notification circle

* Fix macOS app not restarting on Restart/Update

* Update dialog box titles

* Turn off file system check for Linux

* Changes to support deployments

* Testing autoupdater deployments to s3

* disable tests for now

* asfrehwf

* fine no windows WHATEVER

* remove windows again

* Try universal all in one

* pffftttngggguhhhh

* make sure it's working

* Missed artifacts script

* Modify destination as well

* one more time!

* Update yml files

* Oops

* add yq manually

* oof

* Fix the script to work properly

* Fix release script

* Fix script again so it runs in time

* Build version 2

* Revert build specific changes

* Lint override

* Fix build apps for PR builds

* One more change

* Add file generation for .deb repo

* Deb repo test

* skip tests for now

* Fix artifact push

* Persist after repo creation

* Put tests back

* Fix unit tests

* Enable mac generated builds temp

* Temporarily disable tests

* Fix issue where notification doesn't pop dialog box

* Try version 2 again

* Put the version back

* Attempting to debug mac app path issue

* Fix issue where Mac app will quarantine itself after first update

* Lock versions of yq

* Fix yq for mac

* As usual, Mac is difficult :P

* Add quotes to anti-quarantine command

* Change to spawn to avoid command injection

* Oops

* Nightly deployment changes (#2005)

* Test nightly deploy

* I fixed a some things

* aaaaaaaaa

* Restore old bucket

* Added progress indicator via tooltip

* Ship nightly builds to main S3 bucket

* PR feedback

* Fix a couple security exploits

* Fix opacity on light mode button

* Use large app icon

* Resize icon for Windows

* Resize icon for Mac

* Update to electron-updater final

* Remove Mac support and deb repo

* Typo

* Remove deb script

* Remove checksum function

* Removed autoUpdateSettingsPath

* Update URL

Co-authored-by: = <=>
Co-authored-by: Devin Binnie <devin.binnie@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Devin Binnie <52460000+devinbinnie@users.noreply.github.com>
This commit is contained in:
Guillermo Vayá
2022-03-08 17:38:38 +01:00
committed by GitHub
parent 0ab6a1f80f
commit d2435a561c
56 changed files with 2323 additions and 1502 deletions

View File

@@ -72,7 +72,7 @@ commands:
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 && 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:
@@ -112,6 +112,7 @@ commands:
name: npn run
command: npm run package:<< parameters.os >>
no_output_timeout: 30m
- 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:
@@ -159,6 +160,10 @@ jobs:
- update_image:
apt_opts: "--no-install-recommends jq icnsutils graphicsmagick tzdata"
- build
- persist_to_workspace:
root: ./build/
paths:
- "./linux/"
- save_cache:
key: npm-{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
@@ -219,6 +224,9 @@ jobs:
- run:
name: Update node to v16
command: choco install nodejs --version 16.8.0
- run:
name: Install yq
command: choco install yq --version 4.15.1
- win_make:
operation: optimize
- win_make:
@@ -255,7 +263,7 @@ jobs:
- "~/.cache/electron"
- "~/.cache/electron-builder"
- save:
filename: "*.exe"
filename: "$(jq -r .version package.json)/*.exe"
build-mac-pr:
executor: mac
@@ -265,6 +273,7 @@ jobs:
- run: mkdir -p ./build
- attach_workspace:
at: ./build
- run: brew install yq
- run:
name: Update node to v16
command: brew upgrade node || true
@@ -289,7 +298,7 @@ jobs:
paths:
- "./macos-release/"
- save:
filename: "*.dmg"
filename: "$(jq -r .version package.json)/*.dmg"
build-linux-pr:
executor: wine-mono
@@ -308,7 +317,7 @@ jobs:
- "~/.cache/electron"
- "~/.cache/electron-builder"
- save:
filename: "*.tar.gz"
filename: "$(jq -r .version package.json)/*.tar.gz"
mac_installer:
executor: mac
@@ -321,15 +330,14 @@ jobs:
- run:
name: Update node to v16
command: brew upgrade node || true
- run:
name: Install yq
command: brew install yq
- run:
name: Installing npm dependencies
command: npm ci
- build:
os: mac-universal
path: ./build/macos-release
subpath: ./macos-release/
- build:
os: mac
os: mac-with-universal
path: ./build/macos-release
subpath: ./macos-release/
- run:
@@ -420,7 +428,7 @@ jobs:
cp --backup=numbered ./build/{macos-release,win-release,linux}/* ./aws-s3-dist
- aws-s3/copy:
from: ./aws-s3-dist/
to: s3://releases.mattermost.com/desktop/$(jq -r .version package.json)/
to: s3://releases.mattermost.com/desktop/
arguments: --acl public-read --cache-control "no-cache" --recursive
upload_to_s3_daily:
@@ -430,21 +438,12 @@ jobs:
- attach_workspace:
at: ./build
- run:
name: "install renaming utility"
name: "Setup files for aws-s3"
command: |
sudo apt-get install rename
- run:
name: "Normalize folder names"
command: |
mv ./build/macos-release ./build/macos
- run:
name: "Rename to daily for consistency"
command: |
rename 's/\d+\.\d+\.\d+/daily/' ./build/macos/*
rename 's/\d+\.\d+\.\d+/daily/' ./build/linux/*
rename 's/\d+\.\d+\.\d+/daily/' ./build/win/*
mkdir -p ./aws-s3-dist
cp -r --backup=numbered ./build/{macos-release,win,linux}/* ./aws-s3-dist
- aws-s3/copy:
from: ./build/
from: ./aws-s3-dist/
to: s3://mattermost-desktop-daily-builds/
arguments: --acl public-read --cache-control "no-cache" --recursive
@@ -561,10 +560,10 @@ workflows:
requires:
- check
context: codesign-certificates
filters:
branches:
only:
- /^release-\d+(\.\d+){1,2}(-rc.*)?/
# filters:
# branches:
# only:
# - /^release-\d+(\.\d+){1,2}(-rc.*)?/
- store_artifacts:
# for master/PR builds
@@ -641,8 +640,8 @@ workflows:
- build-linux
- build-win-no-installer
- mac_installer
- upload_to_s3_daily:
context: mattermost-desktop-daily-s3
- upload_to_s3:
context: mattermost-release-s3
requires:
- build-linux
- build-win-no-installer