diff --git a/.circleci/config.yml b/.circleci/config.yml index 7de9439f..e277e6cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -261,7 +261,7 @@ jobs: - "~/.cache/electron" - "~/.cache/electron-builder" - save: - filename: "$(jq -r .version package.json)/*.exe" + filename: "$(jq -r .version package.json)/*.zip" build-mac-pr: executor: mac diff --git a/package.json b/package.json index ac243ab1..fb1c7b4d 100644 --- a/package.json +++ b/package.json @@ -46,15 +46,18 @@ "test:unit": "jest", "test:unit-ci": "jest --runInBand", "test:coverage": "jest --coverage", - "package:all": "cross-env NODE_ENV=production npm-run-all check-build-config package:windows package:mac package:mac-universal package:linux", - "package:windows": "cross-env NODE_ENV=production npm-run-all check-build-config build && electron-builder --win --x64 --ia32 --publish=never", + "package:all": "cross-env NODE_ENV=production npm-run-all check-build-config package:windows package:windows-nsis package:mac package:mac-universal package:linux", + "package:windows": "cross-env NODE_ENV=production npm-run-all check-build-config build && electron-builder --win zip --x64 --ia32 --publish=never", + "package:windows-nsis": "cross-env NODE_ENV=production CAN_UPGRADE=true npm-run-all check-build-config build && electron-builder --win zip nsis --x64 --ia32 --publish=never", "package:mac": "cross-env NODE_ENV=production npm-run-all check-build-config build && electron-builder --mac --x64 --arm64 --publish=never", "package:mac-with-universal": "cross-env NODE_ENV=production npm-run-all check-build-config build && 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": "cross-env NODE_ENV=production npm-run-all check-build-config build && electron-builder --linux --x64 --publish=never", + "package:linux": "npm-run-all package:linux-*", + "package:linux-appImage": "cross-env NODE_ENV=production CAN_UPGRADE=true npm-run-all check-build-config build && electron-builder --linux tar.gz appimage --x64 --publish=never", "package:linux-deb": "cross-env NODE_ENV=production npm-run-all check-build-config build && electron-builder --linux tar.gz deb --x64 --publish=never", "package:linux-rpm": "cross-env NODE_ENV=production npm-run-all check-build-config build && electron-builder --linux tar.gz rpm --x64 --publish=never", + "package:linux-targz": "cross-env NODE_ENV=production npm-run-all check-build-config build && electron-builder --linux tar.gz --x64 --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", diff --git a/scripts/Makefile.ps1 b/scripts/Makefile.ps1 index d4dcb7d6..cd89df2c 100644 --- a/scripts/Makefile.ps1 +++ b/scripts/Makefile.ps1 @@ -531,6 +531,8 @@ function Run-BuildElectron { npm run build #npm run build --prefix="$(Get-RootDir)" "$(Get-RootDir)" Print-Info "Packaging nodejs/electron for Windows (running npm run package:windows)..." + # NSIS has the upgrade flag enabled, so it must be done first + npm run package:windows-nsis npm run package:windows #npm run package:windows --prefix="$(Get-RootDir)" "$(Get-RootDir)" } diff --git a/scripts/patch_updater_yml.sh b/scripts/patch_updater_yml.sh index 9584a6c6..2a84baef 100755 --- a/scripts/patch_updater_yml.sh +++ b/scripts/patch_updater_yml.sh @@ -12,7 +12,9 @@ if [ "$RELEASE_VERSION" == "" ]; then fi echo "${RELEASE_VERSION}" -for i in ./release/${RELEASE_VERSION}*.yml; do - VERSION=$VERSION yq eval -i '.files[].url |= strenv(VERSION) + "/" + .' $i -done +if [[ -f ./release/${RELEASE_VERSION}*.yml ]]; then + for i in ./release/${RELEASE_VERSION}*.yml; do + VERSION=$VERSION yq eval -i '.files[].url |= strenv(VERSION) + "/" + .' $i + done +fi diff --git a/webpack.config.base.js b/webpack.config.base.js index 6d55a081..1f947f8a 100644 --- a/webpack.config.base.js +++ b/webpack.config.base.js @@ -17,7 +17,7 @@ const isRelease = process.env.CIRCLE_BRANCH && process.env.CIRCLE_BRANCH.startsW const codeDefinitions = { __HASH_VERSION__: !isRelease && JSON.stringify(VERSION), - __CAN_UPGRADE__: JSON.stringify(true), // we should set this to false when working on a store version. Hardcoding for now. + __CAN_UPGRADE__: JSON.stringify(process.env.CAN_UPGRADE === 'true'), __IS_NIGHTLY_BUILD__: JSON.stringify(process.env.CIRCLE_BRANCH === 'nightly'), __IS_MAC_APP_STORE__: JSON.stringify(process.env.IS_MAC_APP_STORE === 'true'), };