-
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (61 loc) · 2.3 KB
/
test_arm64_deb.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
name: Build arm64 deb
on:
workflow_dispatch:
env:
FLUTTER_VERSION: "3.13.9"
jobs:
build:
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Get version from pubspec.yaml
id: get_version
run: |
VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' app/pubspec.yaml)
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Manage the Flutter version on the self-hosted runner manually!
# Flutter currently doesn't provide Linux ARM64 binaries.
build_deb_arm_64:
needs: build
runs-on: [self-hosted, linux, arm64]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev
- name: Enable dart_distributor
run: dart pub global activate flutter_distributor
- name: Build deb package
working-directory: app
run: PATH="$PATH:$HOME/.pub-cache/bin" flutter_distributor package --platform linux --targets deb
- name: Find deb file
id: find_deb
run: |
VERSION=${{ needs.build.outputs.version }}
DEB_PATH=$(find app/dist -name "localsend_app-$VERSION*-linux.deb")
echo "deb_path=$DEB_PATH" >> $GITHUB_OUTPUT
- name: Check if deb file exists
id: check_file
run: |
if [[ ! -f "${{ steps.find_deb.outputs.deb_path }}" ]]; then
echo "File not found: ${{ steps.find_deb.outputs.deb_path }}"
exit 1
fi
# Remove this when: https://github.com/leanflutter/flutter_distributor/pull/150 is merged
- name: Update Architecture
run: |
mkdir temp
cd temp
ar x ../${{ steps.find_deb.outputs.deb_path }}
tar xJf control.tar.xz --overwrite
sed -i '/Architecture:/c\Architecture: arm64' ./control
tar cJf control.tar.xz control postinst postrm
ar rcs ../${{ steps.find_deb.outputs.deb_path }} debian-binary control.tar.xz data.tar.xz
- name: Upload deb file
uses: actions/upload-artifact@v4
with:
name: deb-arm-64-result
path: ${{ steps.find_deb.outputs.deb_path }}