Skip to content

Commit c10e666

Browse files
authored
Ship linux tarball with static sqlcipher (#597)
1 parent 743f5dc commit c10e666

File tree

4 files changed

+52
-5
lines changed

4 files changed

+52
-5
lines changed

.github/workflows/build_and_deploy.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,37 @@ jobs:
9090
base-url: https://packages.element.io/${{ inputs.mode == 'release' && 'desktop' || 'nightly' }}
9191
version: ${{ needs.prepare.outputs.macos-version }}
9292

93+
# We do not put this call into deploy-mode as we do not want it to add to the packages.element.io artifact
94+
# We ship this build via reprepro only
9395
linux:
9496
if: github.event_name != 'workflow_dispatch' || inputs.linux
9597
needs: prepare
96-
name: Linux
98+
name: Linux (sqlcipher system)
9799
uses: ./.github/workflows/build_linux.yaml
98100
with:
99101
config: element.io/${{ inputs.mode || 'nightly' }}
100102
sqlcipher: system
101103
version: ${{ needs.prepare.outputs.linux-version }}
102104

103-
# This deploy job only handles Windows & macOS as those are stateless and static.
105+
# We ship the static build via static tarball only
106+
linux_static:
107+
if: github.event_name != 'workflow_dispatch' || inputs.linux
108+
needs: prepare
109+
name: Linux (sqlcipher static)
110+
uses: ./.github/workflows/build_linux.yaml
111+
with:
112+
deploy-mode: true
113+
config: element.io/${{ inputs.mode || 'nightly' }}
114+
sqlcipher: static
115+
version: ${{ needs.prepare.outputs.linux-version }}
116+
117+
# This deploy job only handles Windows, macOS & linux_static as those are stateless and static.
104118
# Linux will be deployed via reprepro after it, but we list it as a dependency to abort if it fails.
105119
deploy:
106120
needs:
107121
- macos
108122
- linux
123+
- linux_static
109124
- windows_32bit
110125
- windows_64bit
111126
runs-on: ubuntu-latest

.github/workflows/build_linux.yaml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
type: string
1717
required: true
1818
description: "How to link sqlcipher, one of 'system' | 'static'"
19+
deploy-mode:
20+
type: boolean
21+
required: false
22+
description: "Whether to arrange artifacts in the arrangement needed for deployment, skipping unrelated ones"
1923
jobs:
2024
build:
2125
runs-on: ubuntu-latest
@@ -84,9 +88,37 @@ jobs:
8488
--deb-custom-control=debcontrol
8589
yarn build --publish never -l --config electron-builder.json
8690
91+
- name: Stash deb package
92+
if: inputs.deploy-mode
93+
uses: actions/upload-artifact@v3
94+
with:
95+
name: linux-sqlcipher-${{ inputs.sqlcipher }}-deb
96+
path: dist/*.deb
97+
retention-days: 1
98+
99+
- name: Prepare artifacts for deployment
100+
if: inputs.deploy-mode
101+
run: |
102+
mv dist _dist
103+
mkdir -p "dist/install/linux/glibc-x86-64/"
104+
mv _dist/*.tar.gz "dist/install/linux/glibc-x86-64"
105+
106+
# We don't wish to store the tarball for every nightly ever, so we only keep the latest
107+
- name: "[Nightly] Strip version from tarball"
108+
if: inputs.deploy-mode && inputs.version != ''
109+
run: |
110+
mv dist/install/linux/glibc-x86-64/*.tar.gz "dist/install/linux/glibc-x86-64/element-desktop-nightly.tar.gz"
111+
112+
- name: "[Release] Prepare release latest symlink"
113+
if: inputs.deploy-mode && inputs.version == ''
114+
shell: bash
115+
run: |
116+
ln -s "$(find . -type f -iname "*.tar.gz" | xargs -0 -n1 -- basename)" "element-desktop.tar.gz"
117+
working-directory: "dist/install/linux/glibc-x86-64"
118+
87119
- name: Upload Artifacts
88120
uses: actions/upload-artifact@v3
89121
with:
90-
name: linux-sqlcipher-${{ inputs.sqlcipher }}
122+
name: ${{ inputs.deploy-mode && 'packages.element.io' || format('linux-sqlcipher-{0}', inputs.sqlcipher) }}
91123
path: dist
92124
retention-days: 1

.github/workflows/build_macos.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
required: false
2525
description: "Whether to sign & notarise the build, requires 'packages.element.io' environment"
2626
deploy-mode:
27-
type: string
27+
type: boolean
2828
required: false
2929
description: "Whether to arrange artifacts in the arrangement needed for deployment, skipping unrelated ones"
3030
base-url:

.github/workflows/build_windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
required: false
2525
description: "Whether to sign & notarise the build, requires 'packages.element.io' environment"
2626
deploy-mode:
27-
type: string
27+
type: boolean
2828
required: false
2929
description: "Whether to arrange artifacts in the arrangement needed for deployment, skipping unrelated ones"
3030
jobs:

0 commit comments

Comments
 (0)