From 08d625a3e01aff9b427fbde88b848f672d6ff495 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 22 Aug 2023 13:23:44 +0700 Subject: [PATCH] feat: support appimage builder --- .github/workflows/release.yml | 25 +++++++++++++++---- .../appimage/build_appimage.sh | 6 +++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05a44b2218505..e9412634ac7c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,6 @@ jobs: cat CHANGELOG.md | sed -e '/./{H;$!d;}' -e "x;/##\ Version\ ${{ github.ref_name }}/"'!d;' >> ${{ env.RELEASE_NOTES_PATH }} - name: Create release - if: github.run_number == 1 id: create_release uses: actions/create-release@v1 env: @@ -403,14 +402,19 @@ jobs: flutter config --enable-linux-desktop dart ./scripts/flutter_release_build/build_flowy.dart run . ${{ github.ref_name }} - - name: Archive Assert + - name: Archive Asset working-directory: ${{ env.LINUX_APP_RELEASE_PATH }} run: tar -czf ${{ env.LINUX_ZIP_NAME }} * - - name: Build Linux package (deb) + - name: Build Linux package (.deb) + working-directory: frontend + run: | + sh scripts/linux_distribution/deb/build_deb.sh appflowy_flutter/product/${{ github.ref_name }}/linux/Release ${{ github.ref_name }} ${{ env.LINUX_PACKAGE_NAME }} + + - name: Build Linux package (.AppImage) working-directory: frontend run: | - sh scripts/linux_distribution/deb/build_deb.sh ${{ env.LINUX_APP_RELEASE_PATH }} ${{ github.ref_name }} ${{ env.LINUX_PACKAGE_NAME }} + sh scripts/linux_distribution/appimage/build_appimage.sh.sh ${{ github.ref_name }} - name: Upload Asset id: upload-release-asset @@ -423,7 +427,18 @@ jobs: asset_name: ${{ env.LINUX_ZIP_NAME }} asset_content_type: application/octet-stream - - name: Upload Asset Install Package + - name: Upload AppImage + id: upload-appimage-package + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: frontend/AppFlowy-${{ github.ref_name }}-x86_64.AppImage + asset_name: AppFlowy-${{ github.ref_name }}-x86_64.AppImage + asset_content_type: application/octet-stream + + - name: Upload Debian package id: upload-release-asset-install-package uses: actions/upload-release-asset@v1 env: diff --git a/frontend/scripts/linux_distribution/appimage/build_appimage.sh b/frontend/scripts/linux_distribution/appimage/build_appimage.sh index fbf0de9a7914a..cfaf1c15d63e1 100644 --- a/frontend/scripts/linux_distribution/appimage/build_appimage.sh +++ b/frontend/scripts/linux_distribution/appimage/build_appimage.sh @@ -2,6 +2,12 @@ VERSION=$1 +wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage +chmod +x appimage-builder-x86_64.AppImage + +# install (optional) +sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder + # update version grep -rl "\[CHANGE_THIS\]" scripts/linux_distribution/appimage/AppImageBuilder.yml | xargs sed -i "s/\[CHANGE_THIS\]/$VERSION/"