Add ability to insert extra config for windows builds.

This commit is contained in:
Half-Shot 2025-03-03 10:03:01 +00:00
parent 1496f3d64c
commit 46e81cd8f8
2 changed files with 26 additions and 0 deletions

View File

@ -63,10 +63,18 @@ jobs:
strategy:
matrix:
arch: [ia32, x64, arm64]
include:
- arch: ia32
extra_config: |-
"user_notice": {
"title": "Element will no longer be available for this platform soon",
"description": "Support for 32-bit Windows installations will be removed in the next release."
}
uses: ./.github/workflows/build_windows.yaml
secrets: inherit
with:
sign: true
extra_config: ${{ matrix.extra_config }}
arch: ${{ matrix.arch }}
version: ${{ needs.prepare.outputs.nightly-version }}

View File

@ -22,6 +22,10 @@ on:
type: string
required: true
description: "The architecture to build for, one of 'x64' | 'ia32' | 'arm64'"
extra_config:
type: string
required: false
description: "Additional configuration for config.json to be inserted for this build."
version:
type: string
required: false
@ -105,6 +109,20 @@ jobs:
- name: Install Deps
run: "yarn install --frozen-lockfile"
- name: Insert config snippet
if: inputs.extra_config != ''
shell: bash
run: |
mkdir config-edit
yarn asar extract webapp.asar config-edit
cd config-edit
mv config.json old-config.json
echo ${{ inputs.extra_config }} | jq -s '.[0] * .[1]' old-config.json - > config.json
rm old-config.json
rm webapp.asar
cd ..
yarn asar pack config-edit/ webpack.asar
- name: Set up sqlcipher macros
if: steps.cache.outputs.cache-hit != 'true' && contains(inputs.arch, 'arm')
shell: pwsh