Merge branch 'master' into staging

This commit is contained in:
RiotRobot 2023-03-31 10:56:21 +01:00
commit a479c8607b
16 changed files with 295 additions and 140 deletions

View File

@ -41,15 +41,14 @@ on:
default: true default: true
concurrency: ${{ github.workflow }} concurrency: ${{ github.workflow }}
env: env:
# XXX: UPDATE THIS BEFORE WHEN GOING LIVE R2_BUCKET: "packages-element-io"
R2_BUCKET: "packages-element-io-test"
jobs: jobs:
prepare: prepare:
uses: ./.github/workflows/build_prepare.yaml uses: ./.github/workflows/build_prepare.yaml
with: with:
config: element.io/${{ inputs.mode || 'nightly' }} config: element.io/${{ inputs.mode || 'nightly' }}
version: ${{ inputs.mode == 'release' && '' || 'develop' }} version: ${{ inputs.mode == 'release' && '' || 'develop' }}
calculate-nightly-versions: ${{ inputs.mode != 'release' }} nightly: ${{ inputs.mode != 'release' }}
secrets: secrets:
CF_R2_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }} CF_R2_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
CF_R2_TOKEN: ${{ secrets.CF_R2_TOKEN }} CF_R2_TOKEN: ${{ secrets.CF_R2_TOKEN }}
@ -88,8 +87,7 @@ jobs:
with: with:
sign: true sign: true
deploy-mode: true deploy-mode: true
# XXX: UPDATE THIS BEFORE WHEN GOING LIVE base-url: https://packages.element.io/${{ inputs.mode == 'release' && 'desktop' || 'nightly' }}
base-url: https://packages-element-io-test.element.io/${{ inputs.mode == 'release' && 'desktop' || 'nightly' }}
version: ${{ needs.prepare.outputs.macos-version }} version: ${{ needs.prepare.outputs.macos-version }}
linux: linux:
@ -98,6 +96,7 @@ jobs:
name: Linux name: Linux
uses: ./.github/workflows/build_linux.yaml uses: ./.github/workflows/build_linux.yaml
with: with:
config: element.io/${{ inputs.mode || 'nightly' }}
sqlcipher: system sqlcipher: system
version: ${{ needs.prepare.outputs.linux-version }} version: ${{ needs.prepare.outputs.linux-version }}
@ -111,7 +110,7 @@ jobs:
- windows_64bit - windows_64bit
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Deploy name: Deploy
if: github.event != 'workflow_dispatch' || (inputs.deploy && (inputs.macos || inputs.windows_32bit || inputs.windows_64bit)) if: github.event_name != 'workflow_dispatch' || (inputs.deploy && (inputs.macos || inputs.windows_32bit || inputs.windows_64bit))
environment: packages.element.io environment: packages.element.io
steps: steps:
- name: Download artifacts - name: Download artifacts
@ -135,7 +134,7 @@ jobs:
# We queue this after the other deploy stage as we want to abort if that fails # We queue this after the other deploy stage as we want to abort if that fails
- deploy - deploy
name: Run reprepro name: Run reprepro
if: github.event != 'workflow_dispatch' || (inputs.deploy && inputs.linux) if: github.event_name != 'workflow_dispatch' || (inputs.deploy && inputs.linux)
uses: ./.github/workflows/reprepro.yaml uses: ./.github/workflows/reprepro.yaml
secrets: inherit secrets: inherit
with: with:

View File

@ -31,6 +31,7 @@ jobs:
matrix: matrix:
sqlcipher: [system, static] sqlcipher: [system, static]
with: with:
config: ${{ github.event.pull_request.base.ref == 'develop' && 'element.io/nightly' || 'element.io/release' }}
sqlcipher: ${{ matrix.sqlcipher }} sqlcipher: ${{ matrix.sqlcipher }}
macos: macos:
@ -91,7 +92,7 @@ jobs:
if: matrix.prepare_cmd if: matrix.prepare_cmd
- name: Run tests - name: Run tests
uses: GabrielBB/xvfb-action@v1 uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1
timeout-minutes: 5 timeout-minutes: 5
with: with:
run: "yarn test" run: "yarn test"

53
.github/workflows/build_keyring.yaml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Build Keyring package
on:
workflow_dispatch:
inputs:
deploy:
description: Deploy artifacts
required: true
type: boolean
default: true
fingerprint:
description: The expected gpg fingerprint
required: true
type: string
concurrency: ${{ github.workflow }}
jobs:
build:
name: Build Keyring package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
mkdir -p element-io-archive-keyring/usr/share/keyrings/
cp packages.element.io/debian/element-io-archive-keyring.gpg element-io-archive-keyring/usr/share/keyrings/element-io-archive-keyring.gpg
- name: Check fingerprint
run: |
gpg --import element-io-archive-keyring/usr/share/keyrings/element-io-archive-keyring.gpg
gpg --fingerprint "$FINGERPRINT"
env:
FINGERPRINT: ${{ inputs.fingerprint }}
- name: Build deb package
run: |
chmod u=rw,go=r element-io-archive-keyring/usr/share/keyrings/element-io-archive-keyring.gpg
dpkg-deb -Zxz --root-owner-group --build element-io-archive-keyring element-io-archive-keyring.deb
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: element-io-archive-keyring
path: "*.deb"
retention-days: 1
reprepro:
needs: build
name: Run reprepro
if: inputs.deploy
uses: ./.github/workflows/reprepro.yaml
secrets: inherit
with:
artifact-name: element-io-archive-keyring

View File

@ -4,6 +4,10 @@
on: on:
workflow_call: workflow_call:
inputs: inputs:
config:
type: string
required: true
description: "The config directory to use"
version: version:
type: string type: string
required: false required: false
@ -58,12 +62,19 @@ jobs:
run: | run: |
echo "config-args=--nightly '${{ inputs.version }}'" >> $GITHUB_OUTPUT echo "config-args=--nightly '${{ inputs.version }}'" >> $GITHUB_OUTPUT
- name: Generate debian control file - name: Generate debian files and arguments
id: debian
run: | run: |
cp element.io/${{ inputs.version && 'nightly' || 'release' }}/control.template debcontrol if [ -f changelog.Debian ]; then
INPUT_VERSION="${{ inputs.version }}" echo "config-args=--deb-changelog changelog.Debian" >> $GITHUB_OUTPUT
fi
cp "$DIR/control.template" debcontrol
VERSION=${INPUT_VERSION:-$(cat package.json | jq -r .version)} VERSION=${INPUT_VERSION:-$(cat package.json | jq -r .version)}
echo "Version: $VERSION" >> debcontrol echo "Version: $VERSION" >> debcontrol
env:
DIR: ${{ inputs.config }}
INPUT_VERSION: ${{ inputs.version }}
- name: Build App - name: Build App
run: | run: |

View File

@ -54,6 +54,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
default: true
toolchain: stable toolchain: stable
target: aarch64-apple-darwin target: aarch64-apple-darwin
@ -79,12 +80,11 @@ jobs:
- name: "[Signed] Build App" - name: "[Signed] Build App"
if: inputs.sign != '' if: inputs.sign != ''
run: | run: |
scripts/generate-builder-config.ts ${{ steps.nightly.outputs.config-args }} scripts/generate-builder-config.ts ${{ steps.nightly.outputs.config-args }} --notarytool-team-id='${{ secrets.APPLE_TEAM_ID }}'
yarn build:universal --publish never --config electron-builder.json yarn build:universal --publish never --config electron-builder.json
env: env:
NOTARIZE_APPLE_ID: ${{ secrets.APPLE_ID }} APPLE_ID: ${{ secrets.APPLE_ID }}
NOTARIZE_APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
NOTARIZE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }} CSC_KEY_PASSWORD: ${{ secrets.APPLE_CSC_KEY_PASSWORD }}
CSC_LINK: ${{ secrets.APPLE_CSC_LINK }} CSC_LINK: ${{ secrets.APPLE_CSC_LINK }}

View File

@ -10,37 +10,38 @@ on:
type: string type: string
required: false required: false
description: "The version tag to fetch, or 'develop', will pick automatically if not passed" description: "The version tag to fetch, or 'develop', will pick automatically if not passed"
calculate-nightly-versions: nightly:
type: string type: boolean
required: false required: false
description: "Whether to calculate the version strings new Nightly builds should use" default: false
description: "Whether the build is a Nightly and to calculate the version strings new builds should use"
secrets: secrets:
# Required if `calculate-nightly-versions` is set # Required if `nightly` is set
CF_R2_ACCESS_KEY_ID: CF_R2_ACCESS_KEY_ID:
required: false required: false
# Required if `calculate-nightly-versions` is set # Required if `nightly` is set
CF_R2_TOKEN: CF_R2_TOKEN:
required: false required: false
# Required if `calculate-nightly-versions` is set # Required if `nightly` is set
CF_R2_S3_API: CF_R2_S3_API:
required: false required: false
outputs: outputs:
macos-version: macos-version:
description: "The version string the next macOS Nightly should use, only output for calculate-nightly-versions" description: "The version string the next macOS Nightly should use, only output for nightly"
value: ${{ jobs.prepare.outputs.macos-version }} value: ${{ jobs.prepare.outputs.macos-version }}
linux-version: linux-version:
description: "The version string the next Linux Nightly should use, only output for calculate-nightly-versions" description: "The version string the next Linux Nightly should use, only output for nightly"
value: ${{ jobs.prepare.outputs.linux-version }} value: ${{ jobs.prepare.outputs.linux-version }}
win32-x64-version: win32-x64-version:
description: "The version string the next Windows x64 Nightly should use, only output for calculate-nightly-versions" description: "The version string the next Windows x64 Nightly should use, only output for nightly"
value: ${{ jobs.prepare.outputs.win32-x64-version }} value: ${{ jobs.prepare.outputs.win32-x64-version }}
win32-x86-version: win32-x86-version:
description: "The version string the next Windows x86 Nightly should use, only output for calculate-nightly-versions" description: "The version string the next Windows x86 Nightly should use, only output for nightly"
value: ${{ jobs.prepare.outputs.win32-x86-version }} value: ${{ jobs.prepare.outputs.win32-x86-version }}
jobs: jobs:
prepare: prepare:
name: Prepare name: Prepare
environment: ${{ inputs.calculate-nightly-versions && 'packages.element.io' || '' }} environment: ${{ inputs.nightly && 'packages.element.io' || '' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
macos-version: ${{ steps.versions.outputs.macos }} macos-version: ${{ steps.versions.outputs.macos }}
@ -66,19 +67,9 @@ jobs:
yarn run --silent electron --version > electronVersion yarn run --silent electron --version > electronVersion
cat package.json | jq -c .hakDependencies > hakDependencies.json cat package.json | jq -c .hakDependencies > hakDependencies.json
- uses: actions/upload-artifact@v3 - name: "[Nightly] Calculate versions"
with:
name: webapp
retention-days: 1
path: |
webapp.asar
package.json
electronVersion
hakDependencies.json
- name: Calculate Nightly versions
id: versions id: versions
if: inputs.calculate-nightly-versions if: inputs.nightly
run: | run: |
MACOS=$(aws s3 cp s3://$R2_BUCKET/nightly/update/macos/releases.json - --endpoint-url $R2_URL --region auto | jq -r .currentRelease) MACOS=$(aws s3 cp s3://$R2_BUCKET/nightly/update/macos/releases.json - --endpoint-url $R2_URL --region auto | jq -r .currentRelease)
echo "macos=$(scripts/generate-nightly-version.ts --latest $MACOS)" >> $GITHUB_OUTPUT echo "macos=$(scripts/generate-nightly-version.ts --latest $MACOS)" >> $GITHUB_OUTPUT
@ -93,6 +84,43 @@ jobs:
env: env:
AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.CF_R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }} AWS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_TOKEN }}
# XXX: UPDATE THIS BEFORE WHEN GOING LIVE R2_BUCKET: "packages-element-io"
R2_BUCKET: "packages-element-io-test"
R2_URL: ${{ secrets.CF_R2_S3_API }} R2_URL: ${{ secrets.CF_R2_S3_API }}
- name: Check version
id: package
run: |
echo "version=$(cat package.json | jq -r .version)" >> $GITHUB_OUTPUT
- name: "[Release] Fetch release"
id: release
if: ${{ !inputs.nightly && inputs.version != 'develop' }}
uses: cardinalby/git-get-release-action@cedef2faf69cb7c55b285bad07688d04430b7ada # v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag: v${{ steps.package.outputs.version }}
- name: "[Release] Write changelog"
if: ${{ !inputs.nightly && inputs.version != 'develop' }}
run: |
TIME=$(date -d "$PUBLISHED_AT" -R)
echo "element-desktop ($VERSION) default; urgency=medium" >> changelog.Debian
echo "$BODY" | sed 's/^##/\n */g;s/^\*/ */g' | perl -pe 's/\[.+?]\((.+?)\)/\1/g' >> changelog.Debian
echo "" >> changelog.Debian
echo " -- ${{ github.actor }} <support@element.io> $TIME" >> changelog.Debian
env:
VERSION: v${{ steps.package.outputs.version }}
BODY: ${{ steps.release.outputs.body }}
PUBLISHED_AT: ${{ steps.release.outputs.published_at }}
- uses: actions/upload-artifact@v3
with:
name: webapp
retention-days: 1
path: |
webapp.asar
package.json
electronVersion
hakDependencies.json
changelog.Debian

View File

@ -14,7 +14,7 @@ on:
arch: arch:
type: string type: string
required: true required: true
description: "The architecture to build for, one of 'x64' | 'x86'" description: "The architecture to build for, one of 'x64' | 'x86' | 'arm64'"
version: version:
type: string type: string
required: false required: false
@ -45,6 +45,12 @@ jobs:
"target": "x86_64-pc-windows-msvc", "target": "x86_64-pc-windows-msvc",
"dir": "x64" "dir": "x64"
}, },
"arm64": {
"target": "aarch64-pc-windows-msvc",
"build-args": "--arm64",
"arch": "amd64_arm64",
"dir": "arm64"
},
"x86": { "x86": {
"target": "i686-pc-windows-msvc", "target": "i686-pc-windows-msvc",
"build-args": "--ia32", "build-args": "--ia32",
@ -62,14 +68,14 @@ jobs:
id: cache id: cache
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
key: ${{ runner.os }}-${{ hashFiles('hakDependencies.json', 'electronVersion') }} key: ${{ runner.os }}-${{ inputs.arch }}-${{ hashFiles('hakDependencies.json', 'electronVersion') }}
path: | path: |
./.hak ./.hak
- name: Set up build tools - name: Set up build tools
uses: ilammy/msvc-dev-cmd@v1 uses: ilammy/msvc-dev-cmd@v1
with: with:
arch: ${{ inputs.arch }} arch: ${{ steps.config.outputs.arch || inputs.arch }}
# ActiveTCL package on choco is from 2015, # ActiveTCL package on choco is from 2015,
# this one is newer but includes more than we need # this one is newer but includes more than we need
@ -91,6 +97,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
default: true
toolchain: stable toolchain: stable
target: ${{ steps.config.outputs.target }} target: ${{ steps.config.outputs.target }}
@ -127,7 +134,7 @@ jobs:
$LogConfig | Set-Content -Path ${{ env.INSTALL_DIR }}/log4net.config $LogConfig | Set-Content -Path ${{ env.INSTALL_DIR }}/log4net.config
# Configure # Configure
${{ env.INSTALL_DIR }}/eSignerCKATool.exe config -mode "${{ env.MODE }}" -user "${{ secrets.ESIGNER_USER_NAME }}" -pass "${{ secrets.ESIGNER_USER_PASSWORD }}" -totp "${{ secrets.ESIGNER_USER_TOTP }}" -key "${{ env.MASTER_KEY_FILE }}" -r ${{ env.INSTALL_DIR }}/eSignerCKATool.exe config -mode product -user "${{ secrets.ESIGNER_USER_NAME }}" -pass "${{ secrets.ESIGNER_USER_PASSWORD }}" -totp "${{ secrets.ESIGNER_USER_TOTP }}" -key "${{ env.MASTER_KEY_FILE }}" -r
${{ env.INSTALL_DIR }}/eSignerCKATool.exe unload ${{ env.INSTALL_DIR }}/eSignerCKATool.exe unload
${{ env.INSTALL_DIR }}/eSignerCKATool.exe load ${{ env.INSTALL_DIR }}/eSignerCKATool.exe load
@ -140,8 +147,6 @@ jobs:
$SubjectName = ($CodeSigningCert.Subject -replace ", ?", "`n" | ConvertFrom-StringData).CN $SubjectName = ($CodeSigningCert.Subject -replace ", ?", "`n" | ConvertFrom-StringData).CN
echo "config-args=--signtool-thumbprint '$Thumbprint' --signtool-subject-name '$SubjectName'" >> $env:GITHUB_OUTPUT echo "config-args=--signtool-thumbprint '$Thumbprint' --signtool-subject-name '$SubjectName'" >> $env:GITHUB_OUTPUT
env: env:
# XXX: UPDATE THIS BEFORE WHEN GOING LIVE
MODE: sandbox
INSTALL_DIR: C:\Users\runneradmin\eSignerCKA INSTALL_DIR: C:\Users\runneradmin\eSignerCKA
MASTER_KEY_FILE: C:\Users\runneradmin\eSignerCKA\master.key MASTER_KEY_FILE: C:\Users\runneradmin\eSignerCKA\master.key
@ -159,8 +164,6 @@ jobs:
- name: Check app was signed successfully - name: Check app was signed successfully
if: inputs.sign != '' if: inputs.sign != ''
# XXX: UPDATE THIS BEFORE WHEN GOING LIVE
continue-on-error: true
run: | run: |
. "$env:SIGNTOOL_PATH" verify /pa (get-item ./dist/squirrel-windows*/*.exe) . "$env:SIGNTOOL_PATH" verify /pa (get-item ./dist/squirrel-windows*/*.exe)

View File

@ -18,7 +18,7 @@ on:
jobs: jobs:
deploy: deploy:
name: "Deploy" name: "Deploy"
if: github.event != 'workflow_run' || github.event.workflow_run.conclusion == 'success' if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: packages.element.io environment: packages.element.io
env: env:

View File

@ -24,8 +24,7 @@ jobs:
environment: packages.element.io environment: packages.element.io
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
# XXX: UPDATE THIS BEFORE WHEN GOING LIVE R2_BUCKET: "packages-element-io"
R2_BUCKET: "packages-element-io-test"
R2_DB_BUCKET: packages-element-io-db R2_DB_BUCKET: packages-element-io-db
R2_URL: ${{ secrets.CF_R2_S3_API }} R2_URL: ${{ secrets.CF_R2_S3_API }}
steps: steps:
@ -64,10 +63,10 @@ jobs:
# Download signing keyring # Download signing keyring
sudo wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg sudo wget -O /usr/share/keyrings/element-io-archive-keyring.gpg https://packages.element.io/debian/element-io-archive-keyring.gpg
# Point apt at local apt repo # Point apt at local apt repo
echo "deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] http://localhost:8000/debian/ default main" | sudo tee /etc/apt/sources.list.d/element-io.list echo "deb [signed-by=/usr/share/keyrings/element-io-archive-keyring.gpg] http://127.0.0.1:8000/debian/ default main" | sudo tee /etc/apt/sources.list.d/element-io.list
# Start http server and fetch from it via apt # Start http server and fetch from it via apt
python3 -m http.server 8000 & python3 -m http.server 8000 --bind 127.0.0.1 &
sudo apt-get update --allow-insecure-repositories sudo apt-get update --allow-insecure-repositories
killall python3 killall python3

View File

@ -0,0 +1,7 @@
Package: element-io-archive-keyring
Architecture: all
Section: contrib/meta
Maintainer: support@element.io
Priority: optional
Version: 1.1
Description: The packages.element.io repository keyring

View File

@ -22,6 +22,15 @@ import fsExtra from "fs-extra";
import HakEnv from "../../scripts/hak/hakEnv"; import HakEnv from "../../scripts/hak/hakEnv";
import { DependencyInfo } from "../../scripts/hak/dep"; import { DependencyInfo } from "../../scripts/hak/dep";
type WinConfiguration =
| "VC-WIN32"
| "VC-WIN64A"
| "VC-WIN64-ARM"
| "VC-WIN64-CLANGASM-ARM"
| "VC-CLANG-WIN64-CLANGASM-ARM"
| "VC-WIN32-HYBRIDCRT"
| "VC-WIN64A-HYBRIDCRT";
export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> { export default async function (hakEnv: HakEnv, moduleInfo: DependencyInfo): Promise<void> {
if (hakEnv.isWin()) { if (hakEnv.isWin()) {
await buildOpenSslWin(hakEnv, moduleInfo); await buildOpenSslWin(hakEnv, moduleInfo);
@ -36,7 +45,18 @@ async function buildOpenSslWin(hakEnv: HakEnv, moduleInfo: DependencyInfo): Prom
const version = moduleInfo.cfg.dependencies.openssl; const version = moduleInfo.cfg.dependencies.openssl;
const openSslDir = path.join(moduleInfo.moduleTargetDotHakDir, `openssl-${version}`); const openSslDir = path.join(moduleInfo.moduleTargetDotHakDir, `openssl-${version}`);
const openSslArch = hakEnv.getTargetArch() === "x64" ? "VC-WIN64A" : "VC-WIN32"; let openSslArch: WinConfiguration;
switch (hakEnv.getTargetArch()) {
case "x64":
openSslArch = "VC-WIN64A";
break;
case "ia32":
openSslArch = "VC-WIN32";
break;
case "arm64":
openSslArch = "VC-WIN64-ARM";
break;
}
console.log("Building openssl in " + openSslDir); console.log("Building openssl in " + openSslDir);
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {

View File

@ -11,6 +11,9 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"files": [], "files": [],
"engines": {
"node": ">=16.0.0"
},
"scripts": { "scripts": {
"i18n": "matrix-gen-i18n", "i18n": "matrix-gen-i18n",
"prunei18n": "matrix-prune-i18n", "prunei18n": "matrix-prune-i18n",
@ -52,8 +55,10 @@
"test": "jest" "test": "jest"
}, },
"dependencies": { "dependencies": {
"@sentry/electron": "^4.3.0",
"auto-launch": "^5.0.5", "auto-launch": "^5.0.5",
"counterpart": "^0.18.6", "counterpart": "^0.18.6",
"electron-clear-data": "^1.0.5",
"electron-store": "^8.0.2", "electron-store": "^8.0.2",
"electron-window-state": "^5.0.3", "electron-window-state": "^5.0.3",
"minimist": "^1.2.6", "minimist": "^1.2.6",
@ -80,20 +85,21 @@
"@typescript-eslint/eslint-plugin": "^5.42.0", "@typescript-eslint/eslint-plugin": "^5.42.0",
"@typescript-eslint/parser": "^5.42.0", "@typescript-eslint/parser": "^5.42.0",
"allchange": "^1.0.6", "allchange": "^1.0.6",
"app-builder-lib": "^22.14.10", "app-builder-lib": "24.0.0",
"asar": "^3.2.0",
"babel-jest": "^29.0.0", "babel-jest": "^29.0.0",
"chokidar": "^3.5.2", "chokidar": "^3.5.2",
"detect-libc": "^1.0.3", "detect-libc": "^1.0.3",
"electron": "^23.0.0", "electron": "^23.0.0",
"electron-builder": "^23.6.0", "electron-builder": "24.0.0",
"electron-builder-squirrel-windows": "^23.6.0", "electron-builder-squirrel-windows": "24.0.0",
"electron-devtools-installer": "^3.1.1", "electron-devtools-installer": "^3.2.0",
"eslint": "^8.26.0", "eslint": "^8.26.0",
"eslint-config-google": "^0.14.0", "eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.25.4", "eslint-plugin-import": "^2.25.4",
"eslint-plugin-matrix-org": "^1.0.0", "eslint-plugin-matrix-org": "^1.0.0",
"eslint-plugin-unicorn": "^45.0.0", "eslint-plugin-unicorn": "^46.0.0",
"expect-playwright": "^0.8.0", "expect-playwright": "^0.8.0",
"find-npm-prefix": "^1.0.2", "find-npm-prefix": "^1.0.2",
"fs-extra": "^11.0.0", "fs-extra": "^11.0.0",

View File

@ -24,35 +24,69 @@ zj97Y0WRPkAagJzeesIx/M4pjYg9zDIZ22NWT9d7KAZemLVtREwWM4zKYEI0Hpid
GxR8jQ1rCc9RMVdO6xuhnVwUD/JyNEgtRKbBJX9qIH2Z30rvIg7ev9MJG6g52cDy GxR8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ightly version with `0.0.1-nightly.` as it breaks if it is not semver * Prefixes the nightly version with `0.0.1-nightly.` as it breaks if it is not semver
* *
* On macOS:
* Passes --notarytool-team-id to build.mac.notarize.notarize if specified and removes build.mac.afterSign
*
* On Linux: * On Linux:
* Replaces spaces in the product name with dashes as spaces in paths can cause issues * Replaces spaces in the product name with dashes as spaces in paths can cause issues
* Passes --deb-custom-control to build.deb.fpm if specified * Passes --deb-custom-control to build.deb.fpm if specified
@ -15,6 +18,7 @@
import parseArgs from "minimist"; import parseArgs from "minimist";
import fsProm from "fs/promises"; import fsProm from "fs/promises";
import * as os from "os"; import * as os from "os";
import { Configuration } from "app-builder-lib";
const ELECTRON_BUILDER_CFG_FILE = "electron-builder.json"; const ELECTRON_BUILDER_CFG_FILE = "electron-builder.json";
@ -25,54 +29,23 @@ const argv = parseArgs<{
"nightly"?: string; "nightly"?: string;
"signtool-thumbprint"?: string; "signtool-thumbprint"?: string;
"signtool-subject-name"?: string; "signtool-subject-name"?: string;
"notarytool-team-id"?: string;
"deb-custom-control"?: string; "deb-custom-control"?: string;
"deb-changelog"?: string;
}>(process.argv.slice(2), { }>(process.argv.slice(2), {
string: ["nightly", "deb-custom-control", "signtool-thumbprint", "signtool-subject-name"], string: [
"nightly",
"deb-custom-control",
"deb-changelog",
"signtool-thumbprint",
"signtool-subject-name",
"notarytool-team-id",
],
}); });
interface File { type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> };
from: string;
to: string;
}
interface PackageBuild { interface PackageBuild extends DeepWriteable<Omit<Configuration, "extraMetadata">> {
appId: string;
asarUnpack: string;
files: Array<string | File>;
extraResources: Array<string | File>;
linux: {
target: string;
category: string;
maintainer: string;
desktop: {
StartupWMClass: string;
};
};
mac: {
category: string;
darkModeSupport: boolean;
};
win: {
target: {
target: string;
};
sign?: string;
signingHashAlgorithms?: string[];
certificateSubjectName?: string;
certificateSha1?: string;
};
deb?: {
fpm?: string[];
};
directories: {
output: string;
};
afterPack: string;
afterSign: string;
protocols: Array<{
name: string;
schemes: string[];
}>;
extraMetadata?: { extraMetadata?: {
productName?: string; productName?: string;
name?: string; name?: string;
@ -114,10 +87,17 @@ async function main(): Promise<number | void> {
} }
if (argv["signtool-thumbprint"] && argv["signtool-subject-name"]) { if (argv["signtool-thumbprint"] && argv["signtool-subject-name"]) {
delete cfg.win.sign; delete cfg.win!.sign;
cfg.win.signingHashAlgorithms = ["sha256"]; cfg.win!.signingHashAlgorithms = ["sha256"];
cfg.win.certificateSubjectName = argv["signtool-subject-name"]; cfg.win!.certificateSubjectName = argv["signtool-subject-name"];
cfg.win.certificateSha1 = argv["signtool-thumbprint"]; cfg.win!.certificateSha1 = argv["signtool-thumbprint"];
}
if (argv["notarytool-team-id"]) {
delete cfg.afterSign;
cfg.mac!.notarize = {
teamId: argv["notarytool-team-id"],
};
} }
if (os.platform() === "linux") { if (os.platform() === "linux") {
@ -125,10 +105,15 @@ async function main(): Promise<number | void> {
// https://github.com/vector-im/element-web/issues/13171 // https://github.com/vector-im/element-web/issues/13171
cfg.extraMetadata!.productName = cfg.extraMetadata!.productName!.replace(/ /g, "-"); cfg.extraMetadata!.productName = cfg.extraMetadata!.productName!.replace(/ /g, "-");
cfg.deb = {
fpm: [],
};
if (argv["deb-custom-control"]) { if (argv["deb-custom-control"]) {
cfg.deb = { cfg.deb.fpm!.push(`--deb-custom-control=${argv["deb-custom-control"]}`);
fpm: [`--deb-custom-control=${argv["deb-custom-control"]}`], }
}; if (argv["deb-changelog"]) {
cfg.deb.fpm!.push(`--deb-changelog=${argv["deb-changelog"]}`);
} }
} }

View File

@ -25,6 +25,7 @@ export type TargetId =
| "universal-apple-darwin" | "universal-apple-darwin"
| "i686-pc-windows-msvc" | "i686-pc-windows-msvc"
| "x86_64-pc-windows-msvc" | "x86_64-pc-windows-msvc"
| "aarch64-pc-windows-msvc"
| "i686-unknown-linux-musl" | "i686-unknown-linux-musl"
| "i686-unknown-linux-gnu" | "i686-unknown-linux-gnu"
| "x86_64-unknown-linux-musl" | "x86_64-unknown-linux-musl"
@ -98,6 +99,13 @@ const x8664PcWindowsMsvc: WindowsTarget = {
vcVarsArch: "amd64", vcVarsArch: "amd64",
}; };
const aarch64WindowsMsvc: WindowsTarget = {
id: "aarch64-pc-windows-msvc",
platform: "win32",
arch: "arm64",
vcVarsArch: "arm64",
};
const x8664UnknownLinuxGnu: LinuxTarget = { const x8664UnknownLinuxGnu: LinuxTarget = {
id: "x86_64-unknown-linux-gnu", id: "x86_64-unknown-linux-gnu",
platform: "linux", platform: "linux",
@ -162,6 +170,7 @@ export const TARGETS: Record<TargetId, Target> = {
// Windows // Windows
"i686-pc-windows-msvc": i686PcWindowsMsvc, "i686-pc-windows-msvc": i686PcWindowsMsvc,
"x86_64-pc-windows-msvc": x8664PcWindowsMsvc, "x86_64-pc-windows-msvc": x8664PcWindowsMsvc,
"aarch64-pc-windows-msvc": aarch64WindowsMsvc,
// Linux // Linux
"i686-unknown-linux-musl": i686UnknownLinuxMusl, "i686-unknown-linux-musl": i686UnknownLinuxMusl,
"i686-unknown-linux-gnu": i686UnknownLinuxGnu, "i686-unknown-linux-gnu": i686UnknownLinuxGnu,