Skip to content

Commit

Permalink
Linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangtian616 committed Jan 18, 2024
1 parent 7efe5a4 commit ae04f9c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/build_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- target: Linux
os: ubuntu-latest
artifact_name: release-Linux
artifact_path: build/linux/*.zip
artifact_path: build/linux/*.AppImage
- target: iOS
os: macos-latest
cache_pod_key: ios-pods
Expand Down Expand Up @@ -147,13 +147,26 @@ jobs:
if: matrix.target == 'Linux'
run: |
sudo apt-get update -y
sudo add-apt-repository universe
sudo apt-get install libfuse2
sudo apt-get install -y ninja-build libgtk-3-dev
flutter config --enable-linux-desktop
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin/
flutter build linux --release -t lib/src/main.dart
mkdir ./build/linux/JHenTai_${{ steps.get_version.outputs.version }}
cp -a build/linux/x64/release/bundle/* ./build/linux/JHenTai_${{ steps.get_version.outputs.version }}
mkdir ./build/linux/JHenTai.AppDir/usr/bin
cp -a build/linux/x64/release/bundle/* ./build/linux/JHenTai.AppDir/usr/bin
echo "[Desktop Entry]" > ./build/linux/JHenTai.AppDir/JHenTai.desktop
echo "Type=Application" >> ./build/linux/JHenTai.AppDir/JHenTai.desktop
echo "Name=JHenTai" >> ./build/linux/JHenTai.AppDir/JHenTai.desktop
echo "Comment=JHenTai" >> ./build/linux/JHenTai.AppDir/JHenTai.desktop
echo "Exec=jhentai" >> ./build/linux/JHenTai.AppDir/JHenTai.desktop
echo "Icon=jhentai_icon" >> ./build/linux/JHenTai.AppDir/JHenTai.desktop
echo "Categories=Network" >> ./build/linux/JHenTai.AppDir/JHenTai.desktop
echo "Terminal=false" >> ./build/linux/JHenTai.AppDir/JHenTai.desktop
cd build/linux
zip -qroy JHenTai_${{ steps.get_version.outputs.version }}_Linux.zip JHenTai_${{ steps.get_version.outputs.version }}
appimagetool JHenTai_${{ steps.get_version.outputs.version }} JHenTai_${{ steps.get_version.outputs.version }}.AppImage
# Upload Artifacts
- name: Upload Artifacts
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -182,6 +195,6 @@ jobs:
tag: ${{ github.ref_name }}
allowUpdates: true
bodyFile: changelog/${{ github.ref_name }}.md
artifacts: /tmp/artifacts/release-Android/*.apk,/tmp/artifacts/release-iOS/*.ipa,/tmp/artifacts/release-macOS/*.dmg,/tmp/artifacts/release-Windows/*.zip,/tmp/artifacts/release-Linux/*.zip
artifacts: /tmp/artifacts/release-Android/*.apk,/tmp/artifacts/release-iOS/*.ipa,/tmp/artifacts/release-macOS/*.dmg,/tmp/artifacts/release-Windows/*.zip,/tmp/artifacts/release-Linux/*.AppImage
artifactErrorsFailBuild: true
replacesArtifacts: true
Binary file added linux/jhentai_icon.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 ae04f9c

Please sign in to comment.