diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..ab2b5754 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,32 @@ +## Type of change +- [ ] Bug fix +- [ ] New feature development +- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) +- [ ] Build/deploy pipeline (DevOps) +- [ ] Other + +## Objective + + + + +## Code changes + + + +* **file.ext:** Description of what was changed and why + +## Screenshots + + + + +## Testing requirements + + + + +## Before you submit +- [ ] I have checked for **linting** errors (`npm run lint`) (required) +- [ ] This change requires a **documentation update** (notify the documentation team) +- [ ] This change has particular **deployment requirements** (notify the DevOps team) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5259d9d..656afde5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,9 @@ jobs: outputs: package_version: ${{ steps.retrieve-version.outputs.package_version }} build_number: ${{ steps.increment-version.outputs.build_number }} + safari_ref: ${{ steps.safari-ref.outputs.safari_ref }} + rc_branch_exists: ${{ steps.branch-check.outputs.rc_branch_exists }} + hotfix_branch_exists: ${{ steps.branch-check.outputs.hotfix_branch_exists }} steps: - name: Checkout repo uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 @@ -40,13 +43,42 @@ jobs: PKG_VERSION=$(jq -r .version src/package.json) echo "::set-output name=package_version::$PKG_VERSION" - - name: Increment version + - name: Increment Version id: increment-version run: | BUILD_NUMBER=$(expr 500 + $GITHUB_RUN_NUMBER) echo "Setting build number to $BUILD_NUMBER" echo "::set-output name=build_number::$BUILD_NUMBER" + - name: Get Safari Branch Ref + id: safari-ref + run: | + SAFARI_REF=master + + if [ "$GITHUB_REF" = "hotfix" ]; then + SAFARI_REF=hotfix + elif [ "$GITHUB_REF" = "rc" ]; then + SAFARI_REF=rc + fi + + echo "Setting Safari Extension ref to $SAFARI_REF" + echo "::set-output name=safari_ref::$SAFARI_REF" + + - name: Check if special branches exist + id: branch-check + run: | + if [[ $(git ls-remote --heads origin rc) ]]; then + echo "::set-output name=rc_branch_exists::1" + else + echo "::set-output name=rc_branch_exists::0" + fi + + if [[ $(git ls-remote --heads origin hotfix) ]]; then + echo "::set-output name=hotfix_branch_exists::1" + else + echo "::set-output name=hotfix_branch_exists::0" + fi + linux: name: Linux Build @@ -200,9 +232,6 @@ jobs: run: npm run lint - name: Build & Sign (dev) - run: | - npm run build - npm run pack:win env: ELECTRON_BUILDER_SIGN: 1 SIGNING_VAULT_URL: ${{ secrets.SIGNING_VAULT_URL }} @@ -210,6 +239,9 @@ jobs: SIGNING_TENANT_ID: ${{ secrets.SIGNING_TENANT_ID }} SIGNING_CLIENT_SECRET: ${{ secrets.SIGNING_CLIENT_SECRET }} SIGNING_CERT_NAME: ${{ secrets.SIGNING_CERT_NAME }} + run: | + npm run build + npm run pack:win - name: Rename appx files for store shell: pwsh @@ -227,7 +259,7 @@ jobs: Copy-Item -Path ./stores/chocolatey -Destination ./dist/chocolatey -Recurse Copy-Item -Path ./dist/nsis-web/Bitwarden-Installer-${{ env._PACKAGE_VERSION }}.exe -Destination ./dist/chocolatey - $checksum = checksum -t sha256 ./dist/chocoloatey/Bitwarden-Installer-${{ env._PACKAGE_VERSION }}.exe + $checksum = checksum -t sha256 ./dist/chocolatey/Bitwarden-Installer-${{ env._PACKAGE_VERSION }}.exe $chocoInstall = "./dist/chocolatey/tools/chocolateyinstall.ps1" (Get-Content $chocoInstall).replace('__version__', "$env:_PACKAGE_VERSION").replace('__checksum__', $checksum) | Set-Content $chocoInstall choco pack ./dist/chocolatey/bitwarden.nuspec --version "$env:_PACKAGE_VERSION" --out ./dist/chocolatey @@ -326,7 +358,7 @@ jobs: macos-build: name: MacOS Build - runs-on: macos-10.15 + runs-on: macos-11 needs: setup env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} @@ -465,6 +497,7 @@ jobs: with: repository: 'bitwarden/browser' path: 'dist-safari/browser' + ref: ${{ needs.setup.outputs.safari_ref }} - name: Build Safari extension shell: pwsh @@ -473,7 +506,7 @@ jobs: macos-package-github: name: MacOS Package GitHub Release Assets - runs-on: macos-10.15 + runs-on: macos-11 needs: [setup, macos-build] env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} @@ -612,7 +645,7 @@ jobs: with: repository: 'bitwarden/browser' path: 'dist-safari/browser' - ref: ${{ github.ref }} + ref: ${{ needs.setup.outputs.safari_ref }} - name: Build Safari extension if: steps.safari-cache.outputs.cache-hit != 'true' @@ -624,31 +657,31 @@ jobs: run: ./scripts/safari-build.ps1 -copyonly - name: Build application (dist) - run: | - npm run pack:mac env: APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + run: | + npm run pack:mac - name: Upload .zip artifact uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3 with: - name: Bitwarden-${{ env._PACKAGE_VERSION }}-mac.zip - path: ./dist/Bitwarden-${{ env._PACKAGE_VERSION }}-mac.zip + name: Bitwarden-${{ env._PACKAGE_VERSION }}-universal-mac.zip + path: ./dist/Bitwarden-${{ env._PACKAGE_VERSION }}-universal-mac.zip if-no-files-found: error - name: Upload .dmg artifact uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3 with: - name: Bitwarden-${{ env._PACKAGE_VERSION }}.dmg - path: ./dist/Bitwarden-${{ env._PACKAGE_VERSION }}.dmg + name: Bitwarden-${{ env._PACKAGE_VERSION }}-universal.dmg + path: ./dist/Bitwarden-${{ env._PACKAGE_VERSION }}-universal.dmg if-no-files-found: error - name: Upload .dmg blockmap artifact uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3 with: - name: Bitwarden-${{ env._PACKAGE_VERSION }}.dmg.blockmap - path: ./dist/Bitwarden-${{ env._PACKAGE_VERSION }}.dmg.blockmap + name: Bitwarden-${{ env._PACKAGE_VERSION }}-universal.dmg.blockmap + path: ./dist/Bitwarden-${{ env._PACKAGE_VERSION }}-universal.dmg.blockmap if-no-files-found: error - name: Upload latest auto-update artifact @@ -661,7 +694,7 @@ jobs: macos-package-mas: name: MacOS Package Prod Release Asset - runs-on: macos-10.15 + runs-on: macos-11 needs: [setup, macos-build] env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} @@ -800,7 +833,7 @@ jobs: with: repository: 'bitwarden/browser' path: 'dist-safari/browser' - ref: ${{ github.ref }} + ref: ${{ needs.setup.outputs.safari_ref }} - name: Build Safari extension if: steps.safari-cache.outputs.cache-hit != 'true' @@ -817,8 +850,6 @@ jobs: env: APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} - SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/ - SDK_DIR: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/ - name: Upload .pkg artifact uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.3 @@ -827,11 +858,23 @@ jobs: path: ./dist/mas-universal/Bitwarden-${{ env._PACKAGE_VERSION }}-universal.pkg if-no-files-found: error + - name: Deploy to TestFlight + env: + APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }} + APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} + if: | + (github.ref == 'refs/heads/master' + && needs.setup.outputs.rc_branch_exists == 0 + && needs.setup.outputs.hotfix_branch_exists == 0) + || (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0) + || github.ref == 'refs/heads/hotfix' + run: npm run upload:mas + macos-package-dev: name: MacOS Package Dev Release Asset if: false # We need to look into how code signing works for dev - runs-on: macos-10.15 + runs-on: macos-11 needs: [setup, macos-build] env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} @@ -970,6 +1013,7 @@ jobs: with: repository: 'bitwarden/browser' path: 'dist-safari/browser' + ref: ${{ needs.setup.outputs.safari_ref }} - name: Build Safari extension if: steps.safari-cache.outputs.cache-hit != 'true' @@ -986,8 +1030,6 @@ jobs: env: APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} - SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/ - SDK_DIR: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/ - name: Zip masdev asset working-directory: ./dist/mas-dev-universal @@ -1002,6 +1044,45 @@ jobs: if-no-files-found: error + crowdin-push: + name: Crowdin Push + if: github.ref == 'refs/heads/master' + needs: + - linux + - windows + - macos-package-github + - macos-package-mas + runs-on: ubuntu-20.04 + env: + _CROWDIN_PROJECT_ID: "299360" + steps: + - name: Checkout repo + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 + + - name: Login to Azure + uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a + with: + creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} + + - name: Retrieve secrets + id: retrieve-secrets + uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403 + with: + keyvault: "bitwarden-prod-kv" + secrets: "crowdin-api-token" + + - name: Upload Sources + uses: crowdin/github-action@e39093fd75daae7859c68eded4b43d42ec78d8ea # v1.3.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} + with: + config: crowdin.yml + crowdin_branch_name: master + upload_sources: true + upload_translations: false + + check-failures: name: Check for failures if: always() @@ -1014,6 +1095,7 @@ jobs: - macos-build - macos-package-github - macos-package-mas + - crowdin-push steps: - name: Check if any job failed if: ${{ (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/rc') }} @@ -1025,6 +1107,7 @@ jobs: MACOS_BUILD_STATUS: ${{ needs.macos-build.result }} MACOS_PKG_GITHUB_STATUS: ${{ needs.macos-package-github.result }} MACOS_PKG_MAS_STATUS: ${{ needs.macos-package-mas.result }} + CROWDIN_PUSH_STATUS: ${{ needs.crowdin-push.result }} run: | if [ "$CLOC_STATUS" = "failure" ]; then exit 1 @@ -1040,6 +1123,8 @@ jobs: exit 1 elif [ "$MACOS_PKG_MAS_STATUS" = "failure" ]; then exit 1 + elif [ "$CROWDIN_PUSH_STATUS" = "failure" ]; then + exit 1 fi - name: Login to Azure - Prod Subscription diff --git a/.github/workflows/crowndin-sync.yml b/.github/workflows/crowndin-pull.yml similarity index 97% rename from .github/workflows/crowndin-sync.yml rename to .github/workflows/crowndin-pull.yml index c86203af..55d0c8ee 100644 --- a/.github/workflows/crowndin-sync.yml +++ b/.github/workflows/crowndin-pull.yml @@ -4,8 +4,8 @@ name: Crowdin Sync on: workflow_dispatch: inputs: {} -# schedule: -# - cron: '0 0 * * *' + schedule: + - cron: '0 0 * * 5' jobs: crowdin-sync: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 89017312..97897d9d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,20 +10,19 @@ jobs: runs-on: ubuntu-20.04 outputs: package_version: ${{ steps.retrieve-version.outputs.package_version }} + branch-name: ${{ steps.branch.outputs.branch-name }} steps: - name: Branch check run: | - if [[ "$GITHUB_REF" != "refs/heads/rc" ]]; then + if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix" ]]; then echo "===================================" - echo "[!] Can only release from rc branch" + echo "[!] Can only release from the 'rc' or 'hotfix' branches" echo "===================================" exit 1 fi - name: Checkout repo uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - with: - ref: rc - name: Get Package Version id: retrieve-version @@ -45,12 +44,18 @@ jobs: exit 1 fi + - name: Get branch name + id: branch + run: | + BRANCH_NAME=$(basename ${{ github.ref }}) + echo "::set-output name=branch-name::$BRANCH_NAME" + - name: Download all artifacts uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783 with: workflow: build.yml workflow_conclusion: success - branch: rc + branch: ${{ steps.branch.outputs.branch-name }} - name: Create release uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5 @@ -67,18 +72,18 @@ jobs: Bitwarden-Installer-${{ env.PKG_VERSION }}.exe, Bitwarden-${{ env.PKG_VERSION }}-ia32-store.appx, Bitwarden-${{ env.PKG_VERSION }}-ia32.appx, - bitwarden-${{ env.PKG_VERSION }}-ia32.nsis.7z, + Bitwarden-${{ env.PKG_VERSION }}-ia32.nsis.7z, Bitwarden-${{ env.PKG_VERSION }}-x64-store.appx, Bitwarden-${{ env.PKG_VERSION }}-x64.appx, - bitwarden-${{ env.PKG_VERSION }}-x64.nsis.7z, + Bitwarden-${{ env.PKG_VERSION }}-x64.nsis.7z, Bitwarden-${{ env.PKG_VERSION }}-arm64-store.appx, Bitwarden-${{ env.PKG_VERSION }}-arm64.appx, - bitwarden-${{ env.PKG_VERSION }}-arm64.nsis.7z, + Bitwarden-${{ env.PKG_VERSION }}-arm64.nsis.7z, bitwarden.${{ env.PKG_VERSION }}.nupkg, latest.yml, - Bitwarden-${{ env.PKG_VERSION }}-mac.zip, - Bitwarden-${{ env.PKG_VERSION }}.dmg, - Bitwarden-${{ env.PKG_VERSION }}.dmg.blockmap, + Bitwarden-${{ env.PKG_VERSION }}-universal-mac.zip, + Bitwarden-${{ env.PKG_VERSION }}-universal.dmg, + Bitwarden-${{ env.PKG_VERSION }}-universal.dmg.blockmap, latest-mac.yml, Bitwarden-${{ env.PKG_VERSION }}-universal.pkg" commit: ${{ github.sha }} @@ -98,8 +103,6 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - with: - ref: rc - name: Install Snap uses: samuelmeuli/action-snapcraft@10d7d0a84d9d86098b19f872257df314b0bd8e2d # v1.2.0 @@ -114,7 +117,7 @@ jobs: with: workflow: build.yml workflow_conclusion: success - branch: rc + branch: ${{ needs.setup.outputs.branch-name }} artifacts: bitwarden_${{ env._PKG_VERSION }}_amd64.snap path: ./dist @@ -136,8 +139,6 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - with: - ref: rc - name: Setup Chocolatey run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/ @@ -153,7 +154,7 @@ jobs: with: workflow: build.yml workflow_conclusion: success - branch: rc + branch: ${{ needs.setup.outputs.branch-name }} artifacts: bitwarden.${{ env._PKG_VERSION }}.nupkg path: ./dist @@ -162,34 +163,3 @@ jobs: run: | cd dist choco push - - - macos: - name: Deploy MacOS - runs-on: macos-10.15 - needs: setup - env: - _PKG_VERSION: ${{ needs.setup.outputs.package_version }} - steps: - - name: Checkout repo - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - with: - ref: rc - - - name: Make target directory - run: mkdir -p dist/mas-universal - - - name: Download Mac artifact - uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783 - with: - workflow: build.yml - workflow_conclusion: success - branch: rc - artifacts: Bitwarden-${{ env._PKG_VERSION }}-universal.pkg - path: ./dist/mas-universal - - - name: Deploy to App Store - run: npm run upload:mas - env: - APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }} - APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} diff --git a/crowdin.yml b/crowdin.yml index 27f37177..8ea20348 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,7 +1,9 @@ project_id_env: _CROWDIN_PROJECT_ID api_token_env: CROWDIN_API_TOKEN +preserve_hierarchy: true files: - source: /src/locales/en/messages.json + dest: /src/locales/en/%original_file_name% translation: /src/locales/%two_letters_code%/%original_file_name% update_option: update_as_unapproved languages_mapping: diff --git a/jslib b/jslib index 24fe8360..8f177e2d 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 24fe836032354d4ec39435776e54dd0995e1b389 +Subproject commit 8f177e2d3a879b854db5c6e6d7d386b24d637a66 diff --git a/package-lock.json b/package-lock.json index aa62d524..32205c90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -86,6 +86,7 @@ } }, "jslib/common": { + "name": "@bitwarden/jslib-common", "version": "0.0.0", "license": "GPL-3.0", "dependencies": { @@ -112,12 +113,13 @@ } }, "jslib/electron": { + "name": "@bitwarden/jslib-electron", "version": "0.0.0", "license": "GPL-3.0", "dependencies": { "@bitwarden/jslib-common": "file:../common", "@nodert-win10-rs4/windows.security.credentials.ui": "^0.4.4", - "electron": "14.0.1", + "electron": "14.2.0", "electron-log": "4.4.1", "electron-store": "8.0.1", "electron-updater": "4.3.9", @@ -4539,9 +4541,9 @@ } }, "node_modules/electron": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/electron/-/electron-14.0.1.tgz", - "integrity": "sha512-1XILvfE5mQEBz5L/QeNfcwC3PxAIjwMyA3GR8Naw5C0IKAnHl3lAdjczbtGX8nqbcEpOAVo+4TMSpcPD3zxe8Q==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/electron/-/electron-14.2.0.tgz", + "integrity": "sha512-6CmAv1P0xcwK3FQOSA27fHI36/wctSFVgj46VODn56srXXQWeolkK1VzeAFNE613iAuuH9jJdHvE3gz+c7XkNA==", "hasInstallScript": true, "dependencies": { "@electron/get": "^1.0.1", @@ -14550,7 +14552,7 @@ "@bitwarden/jslib-common": "file:../common", "@nodert-win10-rs4/windows.security.credentials.ui": "^0.4.4", "@types/node": "^14.17.1", - "electron": "14.0.1", + "electron": "14.2.0", "electron-log": "4.4.1", "electron-store": "8.0.1", "electron-updater": "4.3.9", @@ -17668,9 +17670,9 @@ } }, "electron": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/electron/-/electron-14.0.1.tgz", - "integrity": "sha512-1XILvfE5mQEBz5L/QeNfcwC3PxAIjwMyA3GR8Naw5C0IKAnHl3lAdjczbtGX8nqbcEpOAVo+4TMSpcPD3zxe8Q==", + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/electron/-/electron-14.2.0.tgz", + "integrity": "sha512-6CmAv1P0xcwK3FQOSA27fHI36/wctSFVgj46VODn56srXXQWeolkK1VzeAFNE613iAuuH9jJdHvE3gz+c7XkNA==", "requires": { "@electron/get": "^1.0.1", "@types/node": "^14.6.2", diff --git a/package.json b/package.json index b196a75c..574fefd5 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "clean:l10n": "git push origin --delete l10n_master", "pack:dir": "npm run clean:dist && electron-builder --dir -p never", "pack:lin": "npm run clean:dist && electron-builder --linux --x64 -p never", - "pack:mac": "npm run clean:dist && electron-builder --mac -p never", + "pack:mac": "npm run clean:dist && electron-builder --mac --universal -p never", "pack:mac:arm64": "npm run clean:dist && electron-builder --mac --arm64 -p never", "pack:mac:mas": "npm run clean:dist && electron-builder --mac mas --universal -p never", "pack:mac:masdev": "npm run clean:dist && electron-builder --mac mas-dev --universal -p never", diff --git a/scripts/after-sign.js b/scripts/after-sign.js index b5c38979..92feb962 100644 --- a/scripts/after-sign.js +++ b/scripts/after-sign.js @@ -2,6 +2,7 @@ require('dotenv').config(); const path = require('path'); const fse = require('fs-extra'); const { notarize } = require('electron-notarize'); +const { deepAssign } = require('builder-util'); exports.default = run; @@ -12,18 +13,33 @@ async function run(context) { const appName = context.packager.appInfo.productFilename; const appPath = `${context.appOutDir}/${appName}.app`; const macBuild = context.electronPlatformName === 'darwin'; + const copyPlugIn = ['darwin', 'mas'].includes(context.electronPlatformName); - if (macBuild) { + if (copyPlugIn) { // Copy Safari plugin to work-around https://github.com/electron-userland/electron-builder/issues/5552 const plugIn = path.join(__dirname, '../PlugIns'); if (fse.existsSync(plugIn)) { fse.mkdirSync(path.join(appPath, 'Contents/PlugIns')); fse.copySync(path.join(plugIn, 'safari.appex'), path.join(appPath, 'Contents/PlugIns/safari.appex')); - - // Resign to sign safari extension - await context.packager.signApp(context, true); - } + // Resign to sign safari extension + if (context.electronPlatformName === 'mas') { + const masBuildOptions = deepAssign({}, context.packager.platformSpecificBuildOptions, context.packager.config.mas); + if (context.targets.some(e => e.name === 'mas-dev')) { + deepAssign(masBuildOptions, { + type: 'development', + }); + } + if (context.packager.packagerOptions.prepackaged == null) { + await context.packager.sign(appPath, context.appOutDir, masBuildOptions, context.arch); + } + } else { + await context.packager.signApp(context, true); + } + } + } + + if (macBuild) { console.log('### Notarizing ' + appPath); const appleId = process.env.APPLE_ID_USERNAME || process.env.APPLEID; const appleIdPassword = process.env.APPLE_ID_PASSWORD || `@keychain:AC_PASSWORD`; diff --git a/src/app/accounts/environment.component.html b/src/app/accounts/environment.component.html index 36d7d95c..72ef27c5 100644 --- a/src/app/accounts/environment.component.html +++ b/src/app/accounts/environment.component.html @@ -1,4 +1,4 @@ -