diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 63ecbe1e1..ffa84598e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,7 +94,7 @@ jobs: - { name: print ./app files, shell: bash, run: ./scripts/ci/list-fs-content.sh ./app } - { name: build, if: runner.os == 'Windows', run: ./scripts/ci/github/package-app.ps1 } - { name: build, if: runner.os == 'Linux', run: ./scripts/ci/github/package-app-linux.sh } - - { name: build, if: matrix.os == 'macos-10.15', run: ./scripts/ci/github/package-app-osx.sh, env: { ARTIFACT_NAME_POSTFIX: "-catalina" } } + - { name: build, if: matrix.os == 'macos-10.15', run: ./scripts/ci/github/package-app-osx.sh, env: { MACOSX_DEPLOYMENT_TARGET: "10.13" } } - name: upload e2e/spectron output if: ${{ always() }} uses: actions/upload-artifact@v2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5f1b0f824..000000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -# TODO improve artifacts sharing between the jobs, keep track of the following issues: -# - https://github.com/travis-ci/travis-ci/issues/7590 -# - https://travis-ci.community/t/using-unified-cache-control-cache-identity/1531 - -branches: { only: [ master ] } -node_js: 16 -language: node_js -cache: false -env: - - PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 -anchors: - macos-common: &macos-common - os: osx - osx_image: xcode9.4 - macos-build-app: &macos-build-app - script: ./scripts/ci/travis/build-osx.sh - after_failure: - - tar -cvf e2e-logs.tar ./output/e2e - - yarn scripts/transfer upload e2e-logs.tar -install: - - npm install --global yarn - - npx envinfo - - yarn install --pure-lockfile - - yarn cache clean -notifications: { email: { on_success: never, on_failure: change } } -jobs: - include: - - stage: "build proton clients" - <<: *macos-common - cache: { yarn: false, npm: false, directories: [ "./output/git/backup", "./app/assets/db-search-monaco-editor" ] } - script: ./scripts/ci/prepare-webclients.sh - workspaces: { create: { name: "macos-webclients-artifact", paths: [ "./output/git/backup", "./app/assets/db-search-monaco-editor" ] } } - - stage: "build app package" - <<: *macos-common - <<: *macos-build-app - osx_image: xcode9.4 - workspaces: { use: [ "macos-webclients-artifact" ] } diff --git a/README.md b/README.md index b208d32c9..3c981552c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ ElectronMail is an [Electron](https://electronjs.org)-based unofficial desktop c It is written in [TypeScript](http://www.typescriptlang.org) and uses [Angular](https://angular.io). [![GitHub Actions CI](https://img.shields.io/github/workflow/status/vladimiry/ElectronMail/GitHub%20Actions%20CI?branch=master&style=flat-square&logo=github&label=GitHub%20Actions%20CI)](https://github.com/vladimiry/ElectronMail/actions) -[![Travis CI](https://img.shields.io/travis/com/vladimiry/ElectronMail.svg?branch=master&style=flat-square&logo=travis&label=Travis+CI)](https://travis-ci.com/github/vladimiry/ElectronMail) [![License](https://img.shields.io/github/license/vladimiry/ElectronMail.svg?style=flat-square&label=License)](https://github.com/vladimiry/ElectronMail/blob/master/LICENSE) [![GitHub top language](https://img.shields.io/github/languages/top/vladimiry/ElectronMail.svg?style=flat-square&label=TypeScript)](https://github.com/vladimiry/ElectronMail/search?l=typescript) diff --git a/electron-builder.yml b/electron-builder.yml index 5d1153284..f5a4cdc1b 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -1,5 +1,5 @@ appId: 'github.com/vladimiry/ElectronMail' -artifactName: ${name}-${version}-${os}-${arch}${env.ARTIFACT_NAME_POSTFIX}.${ext} +artifactName: ${name}-${version}-${os}-${arch}.${ext} productName: 'ElectronMail' publish: {provider: github, releaseType: draft, vPrefixedTagName: true} forceCodeSigning: false diff --git a/package.json b/package.json index fdcf8deab..41277ea2a 100644 --- a/package.json +++ b/package.json @@ -66,17 +66,15 @@ "assets:webclient": "yarn assets:webclient:base ./app", "assets:webclient:dev": "yarn assets:webclient:base ./app-dev", "assets:webclient:base": "yarn ts-node:shortcut ./scripts/prepare-webclient/index.ts", - "electron-builder:install-app-deps": "electron-builder install-app-deps --arch=x64", - "electron-builder:dir": "electron-builder --x64 --dir", - "electron-builder:dist": "cross-env TS_NODE_FILES=true npm exec --package=ts-node --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- ts-node ./scripts/electron-builder/run-with-default-evn-vars.ts --x64 --publish never", - "electron-builder:dist:linux:appimage": "cross-env TS_NODE_FILES=true npm exec --package=ts-node --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- ts-node ./scripts/electron-builder/build-appimage.ts", - "electron-builder:dist:linux:appimage:do": "cross-env TS_NODE_FILES=true npm exec --package=ts-node --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- ts-node ./scripts/electron-builder/run-with-default-evn-vars.ts --x64 --publish never --linux appimage", - "electron-builder:dist:linux:snap": "cross-env TS_NODE_FILES=true npm exec --package=ts-node --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- ts-node ./scripts/electron-builder/build-snap.ts", - "electron-builder:dist:linux:snap:do": "cross-env TS_NODE_FILES=true npm exec --package=ts-node --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- ts-node ./scripts/electron-builder/run-with-default-evn-vars.ts --x64 --publish never --linux snap", - "electron-builder:dist:linux:deb": "cross-env TS_NODE_FILES=true npm exec --package=ts-node --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- ts-node ./scripts/electron-builder/run-with-default-evn-vars.ts --x64 --publish never --linux deb", - "electron-builder:dist:linux:freebsd": "cross-env TS_NODE_FILES=true npm exec --package=ts-node --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- ts-node ./scripts/electron-builder/run-with-default-evn-vars.ts --x64 --publish never --linux freebsd", - "electron-builder:dist:linux:pacman": "cross-env TS_NODE_FILES=true npm exec --package=ts-node --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- ts-node ./scripts/electron-builder/run-with-default-evn-vars.ts --x64 --publish never --linux pacman", - "electron-builder:dist:linux:rpm": "cross-env TS_NODE_FILES=true npm exec --package=ts-node --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- ts-node ./scripts/electron-builder/run-with-default-evn-vars.ts --x64 --publish never --linux rpm", + "electron-builder:dist": "npm run electron-builder:shortcut -- --x64 --publish never", + "electron-builder:dist:linux:appimage": "yarn ts-node:shortcut ./scripts/electron-builder/build-appimage.ts", + "electron-builder:dist:linux:appimage:do": "npm run electron-builder:shortcut -- --x64 --publish never --linux appimage", + "electron-builder:dist:linux:snap": "yarn ts-node:shortcut ./scripts/electron-builder/build-snap.ts", + "electron-builder:dist:linux:snap:do": "npm run electron-builder:shortcut -- --x64 --publish never --linux snap", + "electron-builder:dist:linux:deb": "npm run electron-builder:shortcut -- --x64 --publish never --linux deb", + "electron-builder:dist:linux:freebsd": "npm run electron-builder:shortcut -- --x64 --publish never --linux freebsd", + "electron-builder:dist:linux:pacman": "npm run electron-builder:shortcut -- --x64 --publish never --linux pacman", + "electron-builder:dist:linux:rpm": "npm run electron-builder:shortcut -- --x64 --publish never --linux rpm", "lint": "npm-run-all scripts/code-generation/electron-main lint:code", "lint:code": "npm-run-all lint:ts:eslint", "lint:ts:base:eslint": "eslint", @@ -91,6 +89,7 @@ "scripts/dist-packages/upload": "yarn ts-node:shortcut ./scripts/dist-packages/upload.ts ./dist ./output", "scripts/download-tray-icon-font": "yarn ts-node:shortcut ./scripts/download-tray-icon-font.ts", "scripts/transfer": "yarn ts-node:shortcut ./scripts/transfer/index.ts", + "electron-builder:shortcut": "npm exec --package=electron-builder -- electron-builder", "ts-node:shortcut": "cross-env TS_NODE_FILES=true npm exec --package=ts-node --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- ts-node", "webpack:shortcut": "cross-env TS_NODE_FILES=true TS_NODE_PROJECT=./webpack-configs/tsconfig.json npm exec --package=webpack-cli --node-options=\"--require tsconfig-paths/register --loader ts-node/esm --experimental-json-modules\" -- webpack" }, diff --git a/scripts/ci/travis/build-osx.sh b/scripts/ci/travis/build-osx.sh deleted file mode 100755 index edfefbce8..000000000 --- a/scripts/ci/travis/build-osx.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -set -ev - -npm exec --package=npm-run-all -- npm-run-all lint build assets - -npm run prepare:remove:prebuild-install -npm run clean:prebuilds -npm exec --package=electron-builder -- electron-builder install-app-deps --arch=x64 - -yarn test:e2e - -# preventing "No output has been received in the last 10m0s" error occurring on travis-ci -# see https://github.com/travis-ci/travis-ci/issues/4190#issuecomment-353342526 -# output something every 9 minutes (540 seconds) to prevent Travis killing the job -while sleep 540; do echo "=====[ $SECONDS seconds still running ]====="; done & -yarn build:electron-builder-hooks -npm run electron-builder:dist -# killing background sleep loop -kill %1 - -yarn scripts/dist-packages/print-hashes - -# preventing "No output has been received in the last 10m0s" error occurring on travis-ci -# see https://github.com/travis-ci/travis-ci/issues/4190#issuecomment-353342526 -# output something every 9 minutes (540 seconds) to prevent Travis killing the job -while sleep 540; do echo "=====[ $SECONDS seconds still running ]====="; done & -yarn scripts/dist-packages/upload -# killing background sleep loop -kill %1 diff --git a/scripts/const.ts b/scripts/const.ts index 516ed7517..ed2cc9ff7 100644 --- a/scripts/const.ts +++ b/scripts/const.ts @@ -1,8 +1,5 @@ -// TODO resolve "ARTIFACT_NAME_POSTFIX" value programmatically from "electron-builder.yml" import path from "path"; -export const ARTIFACT_NAME_POSTFIX_ENV_VAR_NAME = "ARTIFACT_NAME_POSTFIX"; - export const CWD_ABSOLUTE_DIR = path.resolve(process.cwd()); export const OUTPUT_ABSOLUTE_DIR = path.join(CWD_ABSOLUTE_DIR, "./output"); diff --git a/scripts/electron-builder/run-with-default-evn-vars.ts b/scripts/electron-builder/run-with-default-evn-vars.ts deleted file mode 100644 index 8c071dac8..000000000 --- a/scripts/electron-builder/run-with-default-evn-vars.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {ARTIFACT_NAME_POSTFIX_ENV_VAR_NAME} from "scripts/const"; -import {catchTopLeventAsync, execShell} from "scripts/lib"; - -// https://nodejs.org/en/knowledge/command-line/how-to-parse-command-line-arguments/ -const [ - /* node binary */, - /* script file */, - ...args -] = process.argv; - -catchTopLeventAsync(async () => { - await execShell( - [ - "npm", - [ - "exec", "--package=electron-builder", "--", "electron-builder", - ...args, - ], - { - env: { - ...process.env, - [ARTIFACT_NAME_POSTFIX_ENV_VAR_NAME]: process.env[ARTIFACT_NAME_POSTFIX_ENV_VAR_NAME] ?? "", - }, - }, - ], - {printEnvWhitelist: [ARTIFACT_NAME_POSTFIX_ENV_VAR_NAME]}, - ); -});