Skip to content

Commit 0e01e73

Browse files
committed
ci: get github ci to build arm64 linux deb and rpm release packages
1 parent f4ae25f commit 0e01e73

File tree

2 files changed

+30
-7
lines changed

2 files changed

+30
-7
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,13 @@ jobs:
323323
needs: create-release
324324
env:
325325
LINUX_APP_RELEASE_PATH: frontend/appflowy_flutter/product/${{ github.ref_name }}/linux/Release
326-
LINUX_ZIP_NAME: AppFlowy-${{ matrix.job.target }}-x86_64.tar.gz
327-
LINUX_PACKAGE_DEB_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.deb
328-
LINUX_PACKAGE_RPM_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.rpm
329-
LINUX_PACKAGE_TMP_RPM_NAME: AppFlowy-${{ github.ref_name }}-2.x86_64.rpm
330-
LINUX_PACKAGE_TMP_APPIMAGE_NAME: AppFlowy-${{ github.ref_name }}-x86_64.AppImage
331-
LINUX_PACKAGE_APPIMAGE_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.AppImage
332-
LINUX_PACKAGE_ZIP_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.tar.gz
326+
LINUX_ZIP_NAME: AppFlowy-${{ matrix.job.target }}-${{ matrix.job.arch }}.tar.gz
327+
LINUX_PACKAGE_DEB_NAME: AppFlowy-${{ github.ref_name }}-linux--${{ matrix.job.arch }}.deb
328+
LINUX_PACKAGE_RPM_NAME: AppFlowy-${{ github.ref_name }}-linux--${{ matrix.job.arch }}.rpm
329+
LINUX_PACKAGE_TMP_RPM_NAME: AppFlowy-${{ github.ref_name }}-2.-${{ matrix.job.arch }}.rpm
330+
LINUX_PACKAGE_TMP_APPIMAGE_NAME: AppFlowy-${{ github.ref_name }}--${{ matrix.job.arch }}.AppImage
331+
LINUX_PACKAGE_APPIMAGE_NAME: AppFlowy-${{ github.ref_name }}-linux--${{ matrix.job.arch }}.AppImage
332+
LINUX_PACKAGE_ZIP_NAME: AppFlowy-${{ github.ref_name }}-linux--${{ matrix.job.arch }}.tar.gz
333333

334334
strategy:
335335
fail-fast: false
@@ -342,6 +342,13 @@ jobs:
342342
extra-build-args: "",
343343
flutter_profile: production-linux-x86_64,
344344
}
345+
- {
346+
arch: arm64,
347+
target: arm64-unknown-linux-gnu,
348+
os: ubuntu-22.04-arm,
349+
extra-build-args: "",
350+
flutter_profile: production-linux-arm64,
351+
}
345352
steps:
346353
- name: Checkout source code
347354
uses: actions/checkout@v4
@@ -403,6 +410,7 @@ jobs:
403410
cp -r ${{ env.LINUX_PACKAGE_TMP_RPM_NAME }} ${{ env.LINUX_PACKAGE_RPM_NAME }}
404411
405412
- name: Build Linux package (.AppImage)
413+
if: ${{ matrix.job.target == 'x86_64-unknown-linux-gnu' }}
406414
working-directory: frontend
407415
continue-on-error: true
408416
run: |
@@ -444,6 +452,7 @@ jobs:
444452
asset_content_type: application/octet-stream
445453

446454
- name: Upload AppImage package
455+
if: ${{ matrix.job.target == 'x86_64-unknown-linux-gnu' }}
447456
id: upload-release-asset-install-package-appimage
448457
uses: actions/upload-release-asset@v1
449458
env:

frontend/scripts/linux_distribution/deb/build_deb.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
LINUX_RELEASE_PRODUCTION=$1
44
VERSION=$2
55
PACKAGE_NAME=$3
6+
ARCHITECTURE=$4
7+
8+
if [-z $ARCHITECTURE] || ["$ARCHITECTURE" = "amd64"] ; then
9+
ARCHITECTURE=amd64
10+
ALT_ARCHITECTURE=arm64
11+
elif ["$ARCHITECTURE" = "arm64"]
12+
ALT_ARCHITECTURE=amd64
13+
else
14+
echo "Supported architectures are only amd64 and arm64."
15+
exit 1
16+
fi
17+
18+
619

720
# Define package folders
821
PACKAGE=$LINUX_RELEASE_PRODUCTION/package
@@ -24,6 +37,7 @@ cp -R ./scripts/linux_distribution/deb/DEBIAN $PACKAGE
2437
chmod 0755 $DEBIAN/postinst
2538
chmod 0755 $DEBIAN/postrm
2639
grep -rl "\[CHANGE_THIS\]" $DEBIAN/control | xargs sed -i "s/\[CHANGE_THIS\]/$VERSION/"
40+
grep -rl "$ALT_ARCHITECTURE" $DEBIAN/control | xargs sed -i "s/$ALT_ARCHITECTURE/$ARCHITECTURE/"
2741

2842
cp -fR $LINUX_RELEASE_PRODUCTION/AppFlowy $LIB
2943
cp ./scripts/linux_distribution/deb/AppFlowy.desktop $APPLICATIONS

0 commit comments

Comments
 (0)