-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (64 loc) · 2.2 KB
/
linux-arm.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
name: "Linux ARM Build"
on:
push:
tags: ['v*']
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 25
steps:
- name: "Code Checkout"
uses: actions/checkout@v3
- name: "Java Setup"
uses: actions/setup-java@v2
with:
distribution: "zulu"
java-version: "11"
- name: Build Linux (arm64)
uses: uraimo/run-on-arch-action@v2
with:
arch: aarch64
distro: ubuntu_latest
githubToken: ${{ github.token }}
setup: |
mkdir -p "${PWD}/AppDir"
dockerRunArgs: |
--volume "${PWD}/AppDir:/AppDir"
install: |
echo Installing dependencies
apt-get update -qq -y
apt-get install -qq -y \
sudo \
bash curl file git unzip xz-utils zip \
clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good
echo Installing Flutter
git clone https://github.com/flutter/flutter.git -b stable --depth 1 /opt/flutter
/opt/flutter/bin/flutter doctor -v
run: |
echo Creating non-root user
useradd -m nonroot
chown -R nonroot /opt/flutter
chown -R nonroot .
echo Building
sudo -u nonroot /opt/flutter/bin/flutter build linux --target-platform linux-arm64
mv build/linux/arm64/release/bundle/* /AppDir/
chown -R nonroot /AppDir/
chmod -R a+rw /AppDir/
chmod +x /AppDir/dateapp
- name: Compress Flutter build
id: compress
run: |
archiveName="dateapp-linux-arm64.tar.gz"
echo "archiveName=$archiveName" >> $GITHUB_OUTPUT
sudo chown -R $USER:$USER .
tar -C AppDir -czf $archiveName .
- name: Release to GitHub
uses: ncipollo/release-action@v1
with:
artifacts: "dateapp-linux-arm64.tar.gz"
tag: ${{ steps.version.outputs.content }}
commit: ${{ github.sha }}
allowUpdates: true