Skip to content

Commit

Permalink
Add linux appimage build to release ci
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Apr 22, 2022
1 parent 00e765d commit 5b646c7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
fail-fast: false
matrix:
config:
# - target: linux
# host: ubuntu-latest
- target: linux
host: ubuntu-latest
- target: windows
host: windows-latest
- target: macos
Expand Down Expand Up @@ -250,20 +250,20 @@ jobs:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
cd pansy
sudo apt-get update
sudo apt install -y ninja-build liblzma-dev libgtk-3-dev libgl1-mesa-dev xorg-dev
curl -JOL https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod a+x appimagetool-x86_64.AppImage
mkdir -p ${GITHUB_WORKSPACE}/bin
mv appimagetool-x86_64.AppImage ${GITHUB_WORKSPACE}/bin/appimagetool
echo ::add-path::${GITHUB_WORKSPACE}/bin
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev xorg-dev
curl -JOL https://github.com/junmer/source-han-serif-ttf/raw/master/SubsetTTF/CN/SourceHanSerifCN-Regular.ttf
mkdir -p fonts
mv SourceHanSerifCN-Regular.ttf fonts/Roboto.ttf
cat ci/linux_font.yaml >> pubspec.yaml
mv appimagetool-x86_64.AppImage appimagetool
cd pansy
echo > native/src/bridge_generated.rs
flutter_rust_bridge_codegen --rust-input native/src/api.rs --dart-output lib/bridge_generated.dart
flutter config --enable-linux-desktop
flutter build linux
flutter build linux --release
mv build/linux/x64/release/bundle/{pansy,AppRun}
cp linux/appimage/* build/linux/x64/release/bundle/
../appimagetool build/linux/x64/release/bundle/
mv *.AppImage build/linux.AppImage
- name: build (windows)
if: steps.check_asset.outputs.skip_build != 'true' && matrix.config.target == 'windows'
Expand Down
2 changes: 1 addition & 1 deletion ci/src/upload_asset/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async fn main() -> Result<()> {
"macos" => "../build/macos.dmg",
"ios" => "../build/nosign.ipa",
"windows" => "../build/windows.zip",
"linux" => "../build/linux.zip",
"linux" => "../build/linux.AppImage",
"android-arm32" => "../build/app/outputs/flutter-apk/app-release.apk",
"android-arm64" => "../build/app/outputs/flutter-apk/app-release.apk",
"android-x86_64" => "../build/app/outputs/flutter-apk/app-release.apk",
Expand Down
8 changes: 8 additions & 0 deletions linux/appimage/AppRun.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name=pansy
Exec=AppRun %u
Icon=AppRun
Categories=Utility;
Binary file added linux/appimage/AppRun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5b646c7

Please sign in to comment.