Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add linux arm64 build #32

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ jobs:
build/windows/outputs/*.zip
build/windows/outputs/*.exe
- target: Linux
os: ubuntu-latest
os: ubuntu-22.04
artifact_name: release-Linux
artifact_path: |
build/linux/*.deb
build/linux/*.tar.gz
- target: Linux-arm
os: ubuntu-22.04-arm
artifact_name: release-Linux-arm
artifact_path: |
build/linux/*.deb
build/linux/*.tar.gz
- target: iOS
os: macos-latest
cache_pod_key: ios-pods
Expand All @@ -52,6 +58,7 @@ jobs:
outputs:
version: ${{ steps.get_version.outputs.version }}
date: ${{ steps.get_version.outputs.date}}
arch: ${{ steps.get_version.outputs.arch}}
runs-on: ${{ matrix.os }}
env:
FLUTTER_VERSION: 3.24.0
Expand All @@ -72,7 +79,7 @@ jobs:
uses: subosito/[email protected]
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
channel: 'master'
cache: true

# Cache Pod
Expand Down Expand Up @@ -113,6 +120,7 @@ jobs:
run: |
echo "version=$(head -n 2 pubspec.yaml | tail -n 1 | cut -d ' ' -f 2 | cut -d '+' -f 1)" >> $GITHUB_OUTPUT
echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
echo "arch=${RUNNER_ARCH,,}" >> $GITHUB_OUTPUT

# Build Android .apk
- name: Build Android
Expand Down Expand Up @@ -176,26 +184,20 @@ jobs:

# Build Linux .deb
- name: Build Linux
if: matrix.target == 'Linux'
if: matrix.target == 'Linux' || matrix.target == 'Linux-arm'
run: |
# Prepare build depends
sudo apt-get update -y
sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa
sudo apt-get install -y clang cmake ninja-build pkg-config liblzma-dev libgtk-3-dev liblzma-dev libstdc++-12-dev
sudo apt-get install -y libayatana-appindicator3-dev libkeybinder-3.0-dev libsecret-1-dev libnotify-dev libsqlcipher-dev

# Compile
flutter config --enable-linux-desktop
sudo apt update -y
sudo apt install -y curl git unzip xz-utils zip libglu1-mesa clang cmake ninja-build pkg-config liblzma-dev libgtk-3-dev liblzma-dev libstdc++-12-dev libayatana-appindicator3-dev libkeybinder-3.0-dev libsecret-1-dev libnotify-dev libsqlcipher-dev
flutter build linux --release

# Debian package
mkdir -p build/linux/CloudOTP-${{ steps.get_version.outputs.version }}-linux-amd64
cd build/linux/CloudOTP-${{ steps.get_version.outputs.version }}-linux-amd64
mkdir -p build/linux/CloudOTP-${{ steps.get_version.outputs.version }}-linux-${{ steps.get_version.outputs.arch }}
cd build/linux/CloudOTP-${{ steps.get_version.outputs.version }}-linux-${{ steps.get_version.outputs.arch }}
mkdir -p opt/CloudOTP
mkdir -p usr/share/metainfo
mkdir -p usr/share/applications
mkdir -p usr/share/icons/hicolor/scalable/apps
cp -r ../x64/release/bundle/* opt/CloudOTP
cp -r ../${{ steps.get_version.outputs.arch }}/release/bundle/* opt/CloudOTP
cp -r ../../../tools/linux_tools/DEBIAN .
chmod 0755 DEBIAN/postinst
chmod 0755 DEBIAN/postrm
Expand All @@ -207,9 +209,13 @@ jobs:

sed -i "/^Version: /s/Version: .*/Version: ${{ steps.get_version.outputs.version }}/" DEBIAN/control

if [ "${{ steps.get_version.outputs.arch }}" = "arm64" ]; then
sed -i "/^Architecture: /s/Architecture: .*/Architecture: arm64/" DEBIAN/control
fi

cd ..
dpkg-deb --build --root-owner-group CloudOTP-${{ steps.get_version.outputs.version }}-linux-amd64
tar -zcvf CloudOTP-${{ steps.get_version.outputs.version }}-linux-amd64.tar.gz -C CloudOTP-${{ steps.get_version.outputs.version }}-linux-amd64 .
dpkg-deb --build --root-owner-group CloudOTP-${{ steps.get_version.outputs.version }}-linux-${{ steps.get_version.outputs.arch }}
tar -zcvf CloudOTP-${{ steps.get_version.outputs.version }}-linux-${{ steps.get_version.outputs.arch }}.tar.gz -C CloudOTP-${{ steps.get_version.outputs.version }}-linux-${{ steps.get_version.outputs.arch }} .

# Upload Artifacts
- name: Upload Artifacts
Expand Down Expand Up @@ -247,6 +253,8 @@ jobs:
mv /tmp/artifacts/release-iOS/*.ipa /tmp/artifacts/final/
mv /tmp/artifacts/release-Linux/*.deb /tmp/artifacts/final/
mv /tmp/artifacts/release-Linux/*.tar.gz /tmp/artifacts/final/
mv /tmp/artifacts/release-Linux-arm/*.deb /tmp/artifacts/final/
mv /tmp/artifacts/release-Linux-arm/*.tar.gz /tmp/artifacts/final/

cd /tmp/artifacts/final
for file in *; do
Expand Down