-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ runs: | |
|
||
- name: Extract custom source artifact | ||
if: runner.os != 'Windows' | ||
shell: pwsh | ||
shell: bash | ||
working-directory: . | ||
run: tar -xf ${{ runner.temp }}/custom.tgz | ||
|
||
|
@@ -47,11 +47,8 @@ runs: | |
|
||
- name: Install host dependencies | ||
if: runner.os == 'Linux' | ||
shell: bash --noprofile --norc -eo pipefail -x {0} | ||
run: | | ||
set -ea | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends fakeroot dpkg rpm | ||
shell: bash | ||
run: sudo apt-get install -y --no-install-recommends fakeroot dpkg rpm | ||
|
||
- name: Install host dependencies | ||
if: runner.os == 'macOS' | ||
|
@@ -66,7 +63,7 @@ runs: | |
# https://dev.to/rwwagner90/signing-electron-apps-with-github-actions-4cof | ||
- name: Import Apple code signing certificate | ||
if: runner.os == 'macOS' | ||
shell: bash --noprofile --norc -eo pipefail -x {0} | ||
shell: bash | ||
run: | | ||
KEY_CHAIN=build.keychain | ||
CERTIFICATE_P12=certificate.p12 | ||
|
@@ -102,37 +99,40 @@ runs: | |
encodedString: ${{ fromJSON(inputs.secrets).WINDOWS_SIGNING }} | ||
|
||
- name: Package release | ||
id: package_release | ||
shell: bash --noprofile --norc -eo pipefail -x {0} | ||
shell: bash | ||
# IMPORTANT: before making changes to this step please consult @engineering in balena's chat. | ||
run: | | ||
set -ea | ||
[[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]] && set -x | ||
runner_os="$(echo "${RUNNER_OS}" | tr '[:upper:]' '[:lower:]')" | ||
if [[ '${{ inputs.VERBOSE }}' =~ on|On|Yes|yes|true|True ]]; then | ||
export DEBUG='electron-forge:*,electron-packager,electron-rebuild' | ||
fi | ||
APPLICATION_VERSION="$(jq -r '.version' package.json)" | ||
if [[ $runner_os =~ linux ]]; then | ||
if [[ "${RUNNER_OS}" == Linux ]]; then | ||
BUILD_ARCH=x64 | ||
npm run make -- --arch="${BUILD_ARCH}" | ||
SHA256SUM_BIN=sha256sum | ||
elif [[ $runner_os =~ darwin|macos|osx ]]; then | ||
elif [[ "${RUNNER_OS}" == Darwin ]]; then | ||
BUILD_ARCH=x64,arm64 | ||
npm run make -- --arch="${BUILD_ARCH}" | ||
SHA256SUM_BIN='shasum -a 256' | ||
elif [[ $runner_os =~ windows|win ]]; then | ||
elif [[ "${RUNNER_OS}" == Windows ]]; then | ||
BUILD_ARCH=ia32,x64 | ||
npm run make-debug-win -- --arch="${BUILD_ARCH}" | ||
else | ||
echo "ERROR: unexpected runner OS: ${runner_os}" | ||
echo "ERROR: unexpected runner OS: ${RUNNER_OS}" | ||
exit 1 | ||
fi | ||
# npm link ts-node '@electron-forge/[email protected]' | ||
./node_modules/.bin/electron-forge make --arch="${BUILD_ARCH}" | ||
echo "version=${APPLICATION_VERSION}" >> $GITHUB_OUTPUT | ||
# collect all artifacts from subdirectories under a common top-level directory | ||
if [[ -d dist ]]; then | ||
rm -rf dist/ | ||
fi | ||
mkdir -p dist | ||
find ./out/make -type f \( \ | ||
-iname "*.zip" -o \ | ||
|
@@ -143,6 +143,11 @@ runs: | |
-iname "*Setup.exe" \ | ||
\) -ls -exec cp '{}' dist/ \; | ||
if [[ -n "${SHA256SUM_BIN}" ]]; then | ||
# Compute and save digests. | ||
cd dist/ | ||
${SHA256SUM_BIN} *.* >"SHA256SUMS.${RUNNER_OS}.txt" | ||
fi | ||
env: | ||
# ensure we sign the artifacts | ||
NODE_ENV: production | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters