Skip to content

Commit

Permalink
👷 package linux
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Apr 15, 2024
1 parent 881ef06 commit 0e8df8e
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 13 deletions.
44 changes: 39 additions & 5 deletions .github/workflows/Package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:
default: false
description: 'Android version'
required: true

env:
FLUTTER_VERSION: '3.7.3'
GO_VERSION: "1.19"
PACKAGE_LINUX:
type: boolean
default: false
description: 'Linux version'

jobs:
package:
Expand All @@ -25,9 +25,20 @@ jobs:
config:
- target: ios
host: macos-latest
go_version: '1.19'
flutter_version: '3.7.3'
- target: android
host: ubuntu-latest
go_version: '1.19'
flutter_version: '3.7.3'
- target: linux
host: ubuntu-latest
flutter_version: '2.10.3'
go_version: '1.17'
runs-on: ${{ matrix.config.host }}
env:
GO_VERSION: ${{ matrix.config.go_version }}
FLUTTER_VERSION: ${{ matrix.config.flutter_version }}
steps:
- name: need_build
id: need_build
Expand All @@ -36,6 +47,8 @@ jobs:
echo "::set-output name=need_build::true"
elif [ ${{ matrix.config.target }} == 'ios' ] && [ ${{ github.event.inputs.PACKAGE_IOS }} == 'true' ]; then
echo "::set-output name=need_build::true"
elif [ ${{ matrix.config.target }} == 'linux' ] && [ ${{ github.event.inputs.PACKAGE_LINUX }} == 'true' ]; then
echo "::set-output name=need_build::true"
else
echo "::set-output name=need_build::false"
fi
Expand Down Expand Up @@ -74,10 +87,14 @@ jobs:
run: |
cd ci
cp version.code.txt ../lib/assets/version.txt
- if: steps.need_build.outputs.need_build == 'true'
- if: steps.need_build.outputs.need_build == 'true' && (matrix.config.target == 'ios' || matrix.config.target == 'android')
name: Install go mobile (mobile)
run: |
go install golang.org/x/mobile/cmd/gomobile@latest
- if: steps.need_build.outputs.need_build == 'true' && matrix.config.target == 'linux'
name: Install hover
run: |
go install github.com/go-flutter-desktop/hover@latest
- if: steps.need_build.outputs.need_build == 'true' && matrix.config.target == 'ios'
name: Build (ios)
run: |
Expand All @@ -102,6 +119,23 @@ jobs:
run: |
sh scripts/build-apk-arm64.sh
sh scripts/sign-apk-github-actions.sh
- if: steps.need_build.outputs.need_build == 'true' && matrix.config.target == 'linux'
name: Setup (linux)
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
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 libfuse2
- if: steps.need_build.outputs.need_build == 'true' && matrix.config.target == 'linux'
name: Build (linux)
run: |
sh scripts/build-linux.sh
- if: steps.need_build.outputs.need_build == 'true' && matrix.config.target == 'ios'
name: 'Upload Artifact (ios)'
uses: actions/upload-artifact@v4
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,35 @@ jobs:
- target: ios
host: macos-latest
flutter_version: '2.10.5'
go_version: '1.18'
go_version: '1.19'
- target: ios
host: macos-latest
flutter_version: '3.7.3'
go_version: '1.18'
go_version: '1.19'
- target: android-arm32
host: ubuntu-latest
flutter_version: '2.10.5'
go_version: '1.18'
go_version: '1.19'
- target: android-arm64
host: ubuntu-latest
flutter_version: '2.10.5'
go_version: '1.18'
go_version: '1.19'
- target: android-x86_64
host: ubuntu-latest
flutter_version: '2.10.5'
go_version: '1.18'
go_version: '1.19'
- target: android-arm32
host: ubuntu-latest
flutter_version: '3.7.3'
go_version: '1.18'
go_version: '1.19'
- target: android-arm64
host: ubuntu-latest
flutter_version: '3.7.3'
go_version: '1.18'
go_version: '1.19'
- target: android-x86_64
host: ubuntu-latest
flutter_version: '3.7.3'
go_version: '1.18'
go_version: '1.19'

runs-on: ${{ matrix.config.host }}

Expand Down
8 changes: 8 additions & 0 deletions scripts/build-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

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
hover build linux-appimage
mv go/build/outputs/linux-appimage-release/*.AppImage build/build.AppImage

0 comments on commit 0e8df8e

Please sign in to comment.