-
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (78 loc) · 3.01 KB
/
flutter_build.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
79
80
81
---
name: build_linux
permissions:
contents: write
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- main
jobs:
main:
runs-on: ${{ matrix.os }}
name: Ubuntu-${{ matrix.os-name }}-${{ matrix.bundle-arch }} artefacts
strategy:
matrix:
include:
- os: ubuntu-24.04
os-name: noble
flutter-arch: x64
deb-arch: amd64
bundle-arch: x86_64
dep-depends: libgtk-3-0t64 (>= 3.24.41)
- os: ubuntu-24.04-arm
os-name: noble
flutter-arch: arm64
deb-arch: arm64
bundle-arch: aarch64
dep-depends: libgtk-3-0t64 (>= 3.24.41)
- os: ubuntu-22.04
os-name: jammy
flutter-arch: x64
deb-arch: amd64
bundle-arch: x86_64
dep-depends: libgtk-3-0 (>= 3.24.33)
steps:
- name: Clone repository
uses: actions/checkout@v4
- run: |
echo "$GITHUB_WORKSPACE"/.flutter/bin/ >> "$GITHUB_PATH"
echo VERSION="$(grep -e "^version: " < pubspec.yaml | sed -e "s/^version: //; s/[+][0-9]*\s*$/-1${{ matrix.os-name }}/")" >> "$GITHUB_ENV"
- run: |
echo BUNDLE_NAME="oav-bundle-ubuntu-${{ matrix.os-name }}-${{ matrix.bundle-arch }}" >> "$GITHUB_ENV"
echo DEB_DIR=open-alert-viewer_"$VERSION" >> "$GITHUB_ENV"
- run: |
sudo apt update -y
sudo apt upgrade -y
sudo apt dist-upgrade -y
- run: |
sudo apt install -y ninja-build libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev
- run: |
git submodule init
git submodule update
flutter channel stable --disable-analytics
flutter doctor --verbose
flutter pub get
flutter build linux --release
- run: |
mv build/linux/${{ matrix.flutter-arch }}/release/bundle "$BUNDLE_NAME"
tar czf "$BUNDLE_NAME".tar.gz "$BUNDLE_NAME"
- run: |
echo "Building .deb package..."
mkdir -p "$DEB_DIR"
cd "$DEB_DIR"
mkdir -p ./DEBIAN ./usr/local/{bin,lib/open-alert-viewer,share/applications,share/icons/hicolor/scalable/apps}/
sed -e "s/VERSION/$VERSION/; s/ARCHITECTURE/${{ matrix.deb-arch }}/; s/DEPENDS/${{ matrix.deb-depends }}/" < ../linux/debian/control.template > DEBIAN/control
cp -R ../"$BUNDLE_NAME"/* usr/local/lib/open-alert-viewer/
ln -s ../lib/open-alert-viewer/open_alert_viewer usr/local/bin/
install -Dm644 ../assets/icon/open_alert_viewer_circle_full.svg usr/local/share/icons/hicolor/scalable/apps/studio.okcode.open_alert_viewer.svg
install -Dm644 ../linux/studio.okcode.open_alert_viewer.desktop usr/local/share/applications/studio.okcode.open_alert_viewer.desktop
cd ..
dpkg-deb --build "$DEB_DIR"
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
"$BUNDLE_NAME".tar.gz
"$DEB_DIR".deb