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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
771 additions
and
774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 ./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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.