fix: appimage build (#4578)

* chore: force exec flutter package pub get

* feat: support building appimage on github ci
This commit is contained in:
Lucas.Xu 2024-02-01 19:58:58 +07:00 committed by GitHub
parent 1e4f342fc3
commit 5b030303a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 28 additions and 10 deletions

View File

@ -327,6 +327,8 @@ jobs:
LINUX_PACKAGE_DEB_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.deb LINUX_PACKAGE_DEB_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.deb
LINUX_PACKAGE_RPM_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.rpm LINUX_PACKAGE_RPM_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.rpm
LINUX_PACKAGE_TMP_RPM_NAME: AppFlowy-${{ github.ref_name }}-2.x86_64.rpm LINUX_PACKAGE_TMP_RPM_NAME: AppFlowy-${{ github.ref_name }}-2.x86_64.rpm
LINUX_PACKAGE_TMP_APPIMAGE_NAME: AppFlowy-${{ github.ref_name }}-x86_64.AppImage
LINUX_PACKAGE_APPIMAGE_NAME: AppFlowy-${{ github.ref_name }}-linux-x86_64.AppImage
strategy: strategy:
fail-fast: false fail-fast: false
@ -395,11 +397,15 @@ jobs:
- name: Build Linux package (.rpm) - name: Build Linux package (.rpm)
working-directory: ${{ env.LINUX_APP_RELEASE_PATH }} working-directory: ${{ env.LINUX_APP_RELEASE_PATH }}
run: | run: |
ls -a
sudo alien -r ${{ env.LINUX_PACKAGE_DEB_NAME }} sudo alien -r ${{ env.LINUX_PACKAGE_DEB_NAME }}
echo '------------'
cp -r ${{ env.LINUX_PACKAGE_TMP_RPM_NAME }} ${{ env.LINUX_PACKAGE_RPM_NAME }} cp -r ${{ env.LINUX_PACKAGE_TMP_RPM_NAME }} ${{ env.LINUX_PACKAGE_RPM_NAME }}
ls -a
- name: Build Linux package (.AppImage)
working-directory: frontend
continue-on-error: true
run: |
sh scripts/linux_distribution/appimage/build_appimage.sh ${{ github.ref_name }}
cp -r ${{ env.LINUX_PACKAGE_TMP_APPIMAGE_NAME }} ${{ env.LINUX_PACKAGE_APPIMAGE_NAME }}
- name: Upload Asset - name: Upload Asset
id: upload-release-asset id: upload-release-asset
@ -434,6 +440,17 @@ jobs:
asset_name: ${{ env.LINUX_PACKAGE_RPM_NAME }} asset_name: ${{ env.LINUX_PACKAGE_RPM_NAME }}
asset_content_type: application/octet-stream asset_content_type: application/octet-stream
- name: Upload AppImage package
id: upload-release-asset-install-package-appimage
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ${{ env.LINUX_APP_RELEASE_PATH }}/${{ env.LINUX_PACKAGE_APPIMAGE_NAME }}
asset_name: ${{ env.LINUX_PACKAGE_APPIMAGE_NAME }}
asset_content_type: application/octet-stream
build-for-docker: build-for-docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -22,9 +22,8 @@ rm -rf assets/flowy_icons/
mkdir -p assets/flowy_icons/ mkdir -p assets/flowy_icons/
rsync -r ../resources/flowy_icons/ assets/flowy_icons/ rsync -r ../resources/flowy_icons/ assets/flowy_icons/
if [ "$no_pub_get" = false ]; then flutter pub get
flutter packages pub get flutter packages pub get
fi
echo "Generating FlowySvg classes" echo "Generating FlowySvg classes"
dart run flowy_svg dart run flowy_svg

View File

@ -24,9 +24,8 @@ rm -rf assets/translations/
mkdir -p assets/translations/ mkdir -p assets/translations/
cp -f ../resources/translations/*.json assets/translations/ cp -f ../resources/translations/*.json assets/translations/
if [ "$no_pub_get" = false ]; then flutter pub get
flutter packages pub get flutter packages pub get
fi
echo "Specifying source directory for AppFlowy Localizations." echo "Specifying source directory for AppFlowy Localizations."
dart run easy_localization:generate -S assets/translations/ dart run easy_localization:generate -S assets/translations/

View File

@ -49,6 +49,9 @@ AppDir:
- libc6:amd64 - libc6:amd64
- libnotify4:amd64 - libnotify4:amd64
- libkeybinder-3.0-0:amd64 - libkeybinder-3.0-0:amd64
- libwayland-cursor0:amd64
- libwayland-client0:amd64
- libwayland-egl1:amd64
files: files:
include: [] include: []
exclude: exclude:

View File

@ -15,4 +15,4 @@ fi
# update version # update version
grep -rl "\[CHANGE_THIS\]" scripts/linux_distribution/appimage/AppImageBuilder.yml | xargs sed -i "s/\[CHANGE_THIS\]/$VERSION/" grep -rl "\[CHANGE_THIS\]" scripts/linux_distribution/appimage/AppImageBuilder.yml | xargs sed -i "s/\[CHANGE_THIS\]/$VERSION/"
appimage-builder --recipe scripts/linux_distribution/appimage/AppImageBuilder.yml appimage-builder --recipe scripts/linux_distribution/appimage/AppImageBuilder.yml --skip-tests