Skip to content

Commit

Permalink
sadds
Browse files Browse the repository at this point in the history
  • Loading branch information
dfunckt committed Nov 15, 2023
1 parent e145aa7 commit 198c3fd
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 42 deletions.
35 changes: 1 addition & 34 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
32 changes: 32 additions & 0 deletions build/make-all.sh
Original file line number Diff line number Diff line change
@@ -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/ \;
23 changes: 23 additions & 0 deletions build/test-all.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -134,6 +134,7 @@ const config: ForgeConfig = {
],
},
}),
/*
new ResourcePlugin({
env: 'ETCHER_UTIL_BIN_PATH',
path: `out/sidecar/bin/etcher-util${process.platform === 'win32' ? '.exe' : ''}`,
Expand All @@ -142,6 +143,7 @@ const config: ForgeConfig = {
sources: './lib/util/',
},
}),
*/
],
};

Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 198c3fd

Please sign in to comment.