diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index 53ff4749fc0..c47035c44fb 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -106,43 +106,10 @@ runs: shell: bash --noprofile --norc -eo pipefail -x {0} run: | set -ea - - [[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x - - runner_os="$(echo "${RUNNER_OS}" | tr '[:upper:]' '[:lower:]')" - + ./build/make-all.sh APPLICATION_VERSION="$(jq -r '.version' package.json)" - - if [[ $runner_os =~ linux ]]; then - BUILD_ARCH=x64 - npm run make -- --arch="${BUILD_ARCH}" - - elif [[ $runner_os =~ darwin|macos|osx ]]; then - BUILD_ARCH=x64,arm64 - npm run make -- --arch="${BUILD_ARCH}" - - elif [[ $runner_os =~ windows|win ]]; then - BUILD_ARCH=ia32,x64 - npm run make-debug-win -- --arch="${BUILD_ARCH}" - - else - echo "ERROR: unexpected runner OS: ${runner_os}" - exit 1 - fi - echo "version=${APPLICATION_VERSION}" >> $GITHUB_OUTPUT - # collect all artifacts from subdirectories under a common top-level directory - mkdir -p dist - find ./out/make -type f \( \ - -iname "*.zip" -o \ - -iname "*.dmg" -o \ - -iname "*.rpm" -o \ - -iname "*.deb" -o \ - -iname "*.AppImage" -o \ - -iname "*Setup.exe" \ - \) -ls -exec cp '{}' dist/ \; - env: # ensure we sign the artifacts NODE_ENV: production diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index e4398e7e0c2..d56bb3b2e7e 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -52,10 +52,8 @@ runs: shell: bash --noprofile --norc -eo pipefail -x {0} run: | set -ea - runner_os="$(echo "${RUNNER_OS}" | tr '[:upper:]' '[:lower:]')" npm ci - npm run package - npm run test-${runner_os} + ./build/test-all.sh env: # https://www.electronjs.org/docs/latest/api/environment-variables ELECTRON_NO_ATTACH_CONSOLE: 'true' diff --git a/build/make-all.sh b/build/make-all.sh new file mode 100755 index 00000000000..de46c3b3a94 --- /dev/null +++ b/build/make-all.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -ea + +if [[ "$VERBOSE" =~ 1|on|On|Yes|yes|true|True ]]; then + set +x + export DEBUG='electron-forge:*,electron-packager,electron-rebuild' +fi + +case "$(uname -s)" in + "Linux") + npm run make -- --arch=x64 + ;; + "Darwin") + npm run make -- --arch=x64,arm64 + ;; + "Windows"*|"MINGW"*|"MSYS"*) + #"@powershell -Command $env:DEBUG='electron-forge:*,electron-packager,electron-rebuild,electron-windows-installer:main';npm run make" + npm run make -- --arch=ia32,x64 + ;; +esac + +# collect all artifacts from subdirectories under a common top-level directory +mkdir -p dist +find ./out/make -type f \( \ + -iname "*.zip" -o \ + -iname "*.dmg" -o \ + -iname "*.rpm" -o \ + -iname "*.deb" -o \ + -iname "*.AppImage" -o \ + -iname "*Setup.exe" \ +\) -ls -exec cp '{}' dist/ \; diff --git a/build/test-all.sh b/build/test-all.sh new file mode 100755 index 00000000000..1c235fe9588 --- /dev/null +++ b/build/test-all.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -ea + +if [[ "$VERBOSE" =~ 1|on|On|Yes|yes|true|True ]]; then + set +x + export DEBUG='electron-forge:*,electron-packager,electron-rebuild' +fi + +npm run package +npm run lint + +case "$(uname -s)" in + "Linux") + xvfb-run --auto-servernum npm run test-gui && xvfb-run --auto-servernum npm run test-shared + ;; + "Darwin") + npm run test-gui && npm run test-shared + ;; + "Windows"*|"MINGW"*|"MSYS"*) + npm run test-gui && npm run test-shared + ;; +esac diff --git a/forge.config.ts b/forge.config.ts index 217a4c104ee..734c5a947f3 100644 --- a/forge.config.ts +++ b/forge.config.ts @@ -7,7 +7,7 @@ import { MakerDMG } from '@electron-forge/maker-dmg'; import { MakerAppImage } from '@reforged/maker-appimage'; import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives'; import { WebpackPlugin } from '@electron-forge/plugin-webpack'; -import { ResourcePlugin } from 'electron-forge-resource-plugin'; +// import { ResourcePlugin } from 'electron-forge-resource-plugin'; import { mainConfig, rendererConfig } from './webpack.config'; @@ -134,6 +134,7 @@ const config: ForgeConfig = { ], }, }), + /* new ResourcePlugin({ env: 'ETCHER_UTIL_BIN_PATH', path: `out/sidecar/bin/etcher-util${process.platform === 'win32' ? '.exe' : ''}`, @@ -142,6 +143,7 @@ const config: ForgeConfig = { sources: './lib/util/', }, }), + */ ], }; diff --git a/package.json b/package.json index 67802ce2527..1eba27d5aa4 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,7 @@ "lint": "npm run lint-ts && npm run lint-css", "test-gui": "electron-mocha --recursive --reporter spec --window-config tests/gui/window-config.json --require ts-node/register/transpile-only --require-main tests/gui/allow-renderer-process-reuse.ts --full-trace --no-sandbox --renderer tests/gui/**/*.ts", "test-shared": "electron-mocha --recursive --reporter spec --require ts-node/register/transpile-only --require-main tests/gui/allow-renderer-process-reuse.ts --full-trace --no-sandbox tests/shared/**/*.ts", - "test-windows": "npm run lint && npm run test-gui && npm run test-shared", - "test-macos": "npm run lint && npm run test-gui && npm run test-shared", - "test-linux": "npm run lint && xvfb-run --auto-servernum npm run test-gui && xvfb-run --auto-servernum npm run test-shared", - "test": "echo npm run test-{linux,windows,macos}", + "test": "build/test-all.sh", "package": "electron-forge package", "start": "electron-forge start", "make": "electron-forge make"