Skip to content
This repository has been archived by the owner on Oct 26, 2024. It is now read-only.

Commit

Permalink
Update GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kjxbyz committed Aug 1, 2024
1 parent 1bb732e commit f4140ae
Show file tree
Hide file tree
Showing 26 changed files with 771 additions and 774 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1636,9 +1636,6 @@ jobs:
with:
platforms: all

- name: Show linux info
run: uname --all

- name: Configure .env
run: |
ENV_BASE64="$([[ "$ENV" == "staging" ]] && echo "$ENV_STG_BASE64" || echo "$ENV_PROD_BASE64")"
Expand Down Expand Up @@ -1748,7 +1745,6 @@ jobs:
run: |
rm -f .env
linux_deb:
name: Create linux deb
runs-on: ubuntu-latest
Expand Down Expand Up @@ -2798,15 +2794,6 @@ jobs:
with:
channel: latest/stable

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.22.3'

- name: Flutter doctor -v
run: flutter doctor -v

- name: Configure .env
run: |
ENV_BASE64="$([[ "$ENV" == "staging" ]] && echo "$ENV_STG_BASE64" || echo "$ENV_PROD_BASE64")"
Expand Down
104 changes: 104 additions & 0 deletions .github/workflows/test-linux-appimage-arm64.yml
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
104 changes: 1 addition & 103 deletions .github/workflows/test-linux-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ jobs:
ENV_KEY: ${{ secrets.ENV_STG_BASE64 }}

- name: Install flutter_distributor
run: |
dart pub global activate flutter_distributor
run: dart pub global activate flutter_distributor

- name: Install flutter dependencies
run: flutter pub get
Expand All @@ -61,104 +60,3 @@ jobs:
if: ${{ always() }}
run: |
rm -f .env
appimage_aarch64:
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: all

- name: Show linux info
run: uname --all

- 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
# https://github.com/s3fs-fuse/s3fs-fuse/issues/647#issuecomment-637458150
- 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
Loading

0 comments on commit f4140ae

Please sign in to comment.