This repository has been archived by the owner on Oct 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (86 loc) · 3.48 KB
/
test-linux-appimage-arm64.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Test Linux AppImage (arm64)
on:
workflow_dispatch:
# Declare default permissions as readonly.
permissions: read-all
jobs:
appimage:
name: Create Linux appimage (aarch64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Configure .env
run: |
echo "$ENV_KEY" | base64 --decode > .env
env:
ENV_KEY: ${{ secrets.ENV_STG_BASE64 }}
- name: Install qemu-user-static
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- uses: addnab/docker-run-action@v3
with:
image: arm64v8/ubuntu:22.04
options: |
--rm
--cap-add SYS_ADMIN
--device /dev/fuse
--security-opt apparmor:unconfined
-v ${{ github.workspace }}:/work
--workdir /work
shell: bash
run: |
set -x
# Show linux info
echo "Show linux info"
uname --all
# Install dependencies for Linux
echo "Install dependencies for Linux"
apt update && apt install -y sudo
sudo apt install -y wget curl git unzip xz-utils zip libglu1-mesa file
sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
sudo apt install -y locate libfuse2
# Install appimagetool
echo "Install appimagetool"
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage"
# https://github.com/AppImage/AppImageKit/issues/1056#issuecomment-643382397
sed -i 's|AI\x02|\x00\x00\x00|' appimagetool
chmod +x appimagetool && mv appimagetool /usr/local/bin/
# Setup Flutter
echo "Setup Flutter"
bash ./scripts/install-flutter-ubuntu.sh
if [ -d "/home/linux-arm64/flutter" ]; then
echo "🟩 ls -la"
ls -la /home/linux-arm64/flutter
fi
echo 'export PATH="$PATH:/home/linux-arm64/flutter/bin:/home/linux-arm64/flutter/.pub-cache/bin:$HOME/.pub-cache/bin"' >> ~/.zshrc
source ~/.zshrc
echo $PATH
# Flutter doctor
echo "Flutter doctor -v"
flutter doctor -v
# Install flutter_distributor
echo "Install flutter_distributor"
dart pub global activate --source git https://github.com/kjxbyz/flutter_distributor --git-ref pacman --git-path packages/flutter_distributor
# Install flutter dependencies
echo "Install flutter dependencies"
flutter pub get
# Build AppImage
echo "Build AppImage"
flutter_distributor package --flutter-build-args "dart-define-from-file=.env,target-platform=linux-arm64" --platform linux --targets appimage --artifact-name '{{name}}_{{build_name}}+{{build_number}}_{{platform}}_aarch64.{{ext}}'
# Package the build.
- name: Copy build for AppImage
run: ls -laR
working-directory: dist
- uses: actions/upload-artifact@v4
with:
name: linux-appimage-arm64-artifact
path: |
./dist/**/*.AppImage
- name: Clean up
if: ${{ always() }}
run: |
rm -f .env