build(electron): flatpak support for linux (#8439)

some issues
- app icon not showing correctly
- missing wayland support
- runtime is outdated

related to
- https://github.com/toeverything/AFFiNE/issues/3272
- https://github.com/toeverything/AFFiNE/issues/5985
- https://github.com/toeverything/AFFiNE/issues/6642
This commit is contained in:
pengx17
2024-10-10 09:51:32 +00:00
parent 46321b72ba
commit 06e059db88
5 changed files with 92 additions and 8 deletions

View File

@@ -567,7 +567,7 @@ jobs:
if: ${{ matrix.spec.test && matrix.spec.os != 'ubuntu-latest' }}
run: yarn workspace @affine-test/affine-desktop e2e
- name: Make bundle
- name: Make bundle (macOS)
if: ${{ matrix.spec.target == 'aarch64-apple-darwin' }}
env:
SKIP_BUNDLE: true
@@ -575,8 +575,15 @@ jobs:
HOIST_NODE_MODULES: 1
run: yarn workspace @affine/electron package --platform=darwin --arch=arm64
- name: Make AppImage
run: yarn workspace @affine/electron make --platform=linux --arch=x64
- name: Make Bundle (Linux)
run: |
sudo add-apt-repository universe
sudo apt install -y libfuse2 elfutils flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak update
# some flatpak deps need git protocol.file.allow
git config --global protocol.file.allow always
yarn workspace @affine/electron make --platform=linux --arch=x64
if: ${{ matrix.spec.target == 'x86_64-unknown-linux-gnu' }}
env:
SKIP_WEB_BUILD: 1

View File

@@ -131,17 +131,22 @@ jobs:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Install fuse on Linux (for patching AppImage)
- name: Install additional dependencies on Linux
if: ${{ matrix.spec.platform == 'linux' }}
run: |
sudo add-apt-repository universe
sudo apt install libfuse2 -y
sudo apt install -y libfuse2 elfutils flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak update
# some flatpak deps need git protocol.file.allow
git config --global protocol.file.allow always
- name: make
run: yarn workspace @affine/electron make --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
env:
SKIP_WEB_BUILD: 1
HOIST_NODE_MODULES: 1
DEBUG: '*'
- name: signing DMG
if: ${{ matrix.spec.platform == 'darwin' }}
@@ -161,6 +166,8 @@ jobs:
mv packages/frontend/apps/electron/out/*/make/zip/linux/x64/*.zip ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.zip
mv packages/frontend/apps/electron/out/*/make/*.AppImage ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.appimage
mv packages/frontend/apps/electron/out/*/make/deb/x64/*.deb ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.deb
mv packages/frontend/apps/electron/out/*/make/flatpak/*/*.flatpak ./builds/affine-${{ needs.before-make.outputs.RELEASE_VERSION }}-${{ env.BUILD_TYPE }}-linux-x64.flatpak
- uses: actions/attest-build-provenance@v1
if: ${{ matrix.spec.platform == 'darwin' }}
with:
@@ -412,6 +419,7 @@ jobs:
./*.exe
./*.appimage
./*.deb
./*.flatpak
./*.apk
./*.yml
- name: Create Nightly Release Draft
@@ -436,4 +444,5 @@ jobs:
./*.appimage
./*.deb
./*.apk
./*.flatpak
./*.yml