mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 15:34:59 +01:00
Include changelogs in deb package (#563)
* Initial attempt at custom Debian changelogs * Iterate * Quotes... * Iterate * facepalm * Iterate * Remove reundant line * Ifs * Test * Iterate * Iterate * Brackets * inconsistent? * Update build_and_test.yaml * Update build_and_test.yaml
This commit is contained in:
parent
25af58e86f
commit
22fe702b83
3
.github/workflows/build_and_deploy.yaml
vendored
3
.github/workflows/build_and_deploy.yaml
vendored
@ -49,7 +49,7 @@ jobs:
|
|||||||
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 }}
|
||||||
@ -98,6 +98,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 }}
|
||||||
|
|
||||||
|
1
.github/workflows/build_and_test.yaml
vendored
1
.github/workflows/build_and_test.yaml
vendored
@ -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:
|
||||||
|
22
.github/workflows/build_linux.yaml
vendored
22
.github/workflows/build_linux.yaml
vendored
@ -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
|
||||||
@ -60,16 +64,26 @@ 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: |
|
||||||
scripts/generate-builder-config.ts ${{ steps.nightly.outputs.config-args }} --deb-custom-control=debcontrol
|
scripts/generate-builder-config.ts \
|
||||||
|
${{ steps.nightly.outputs.config-args }} \
|
||||||
|
${{ steps.debian.outputs.config-args }} \
|
||||||
|
--deb-custom-control=debcontrol
|
||||||
yarn build --publish never -l --config electron-builder.json
|
yarn build --publish never -l --config electron-builder.json
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
|
75
.github/workflows/build_prepare.yaml
vendored
75
.github/workflows/build_prepare.yaml
vendored
@ -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
|
||||||
@ -96,3 +87,41 @@ jobs:
|
|||||||
# XXX: UPDATE THIS BEFORE WHEN GOING LIVE
|
# XXX: UPDATE THIS BEFORE WHEN GOING LIVE
|
||||||
R2_BUCKET: "packages-element-io-test"
|
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
|
||||||
|
@ -1,81 +0,0 @@
|
|||||||
Origin: riot.im
|
|
||||||
Codename: default
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
||||||
|
|
||||||
Origin: riot.im
|
|
||||||
Suite: oldoldstable
|
|
||||||
Codename: jessie
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
||||||
|
|
||||||
Origin: riot.im
|
|
||||||
Suite: oldstable
|
|
||||||
Codename: stretch
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
||||||
|
|
||||||
Origin: riot.im
|
|
||||||
Suite: stable
|
|
||||||
Codename: buster
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
||||||
|
|
||||||
Origin: riot.im
|
|
||||||
Suite: testing
|
|
||||||
Codename: bullseye
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
||||||
|
|
||||||
Origin: riot.im
|
|
||||||
Suite: unstable
|
|
||||||
Codename: sid
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
||||||
|
|
||||||
Origin: riot.im
|
|
||||||
Codename: xenial
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
||||||
|
|
||||||
Origin: riot.im
|
|
||||||
Codename: bionic
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
||||||
|
|
||||||
Origin: riot.im
|
|
||||||
Codename: cosmic
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
||||||
|
|
||||||
Origin: riot.im
|
|
||||||
Codename: disco
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
||||||
|
|
||||||
Origin: riot.im
|
|
||||||
Codename: eoan
|
|
||||||
Architectures: amd64 i386 source
|
|
||||||
Components: main
|
|
||||||
SignWith: D7B0B66941D01538
|
|
||||||
Tracking: minimal
|
|
@ -15,6 +15,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";
|
||||||
|
|
||||||
@ -26,53 +27,14 @@ const argv = parseArgs<{
|
|||||||
"signtool-thumbprint"?: string;
|
"signtool-thumbprint"?: string;
|
||||||
"signtool-subject-name"?: string;
|
"signtool-subject-name"?: 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"],
|
||||||
});
|
});
|
||||||
|
|
||||||
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 +76,10 @@ 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 (os.platform() === "linux") {
|
if (os.platform() === "linux") {
|
||||||
@ -125,10 +87,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"]}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user