-
-
Notifications
You must be signed in to change notification settings - Fork 82
130 lines (124 loc) · 4.59 KB
/
build-quickgui.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build Quickgui 🏗️
on:
pull_request:
branches:
- main
paths:
- pubspec.yaml
- assets/**
- lib/**
- linux/**
push:
branches:
- main
paths:
- pubspec.yaml
- assets/**
- lib/**
- linux/**
workflow_dispatch:
# TODO: arm64 runner
# https://github.blog/changelog/2024-06-03-actions-arm-based-linux-and-windows-runners-are-now-in-public-beta/
jobs:
test-build-linux-x64:
runs-on: ubuntu-22.04
steps:
- name: "Checkout 🥡"
uses: actions/checkout@v4
- name: "Install Flutter 🦋"
uses: subosito/flutter-action@v2
with:
channel: stable
architecture: x64
flutter-version-file: pubspec.yaml
- name: "Install dependencies 💾"
run: |
sudo apt-get -y install clang cmake libblkid1 liblzma5 libgtk-3-0 libgtk-3-dev ninja-build pkg-config
- name: Install Flutter dependencies 🦋
run: flutter pub get
- name: Enable Linux Desktop 🐧
run: flutter config --enable-linux-desktop
- name: Build artifacts 🏗️
run: flutter build linux --release
- name: Show artifacts 👀
run: tree build/linux/x64/release/bundle
- name: Upload artifacts ⤴️
uses: actions/upload-artifact@v4
with:
name: Quickgui-${{github.run_number}}-linux-x64
path: build/linux/x64/release/bundle
overwrite: true
test-build-ppa-x64:
runs-on: ubuntu-22.04
steps:
- name: "Checkout 🥡"
uses: actions/checkout@v4
- name: "Install Flutter 🦋"
uses: subosito/flutter-action@v2
with:
channel: stable
architecture: x64
flutter-version-file: pubspec.yaml
- name: "Install dependencies 💾"
run: |
sudo apt-get -y install clang cmake libblkid1 liblzma5 libgtk-3-0 libgtk-3-dev ninja-build pkg-config
sudo apt-get -y install debhelper-compat distro-info dput devscripts rsync
- name: Install Flutter dependencies 🦋
run: flutter pub get
- name: Enable Linux Desktop 🐧
run: flutter config --enable-linux-desktop
- name: Build artifacts 🏗️
run: flutter build linux --release
- name: "Import gpg key 🔑"
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }}
- name: "Upload to PPA ⤴️"
env:
DEBEMAIL: ${{ secrets.DEBEMAIL }}
DEBFULLNAME: ${{ secrets.DEBFULLNAME }}
run: |
# Version variables
DEB_VER=$(grep "^version" pubspec.yaml | cut -d' ' -f2 | sed 's/+/-/')
TAR_VER=$(grep "^version" pubspec.yaml | cut -d' ' -f2 | sed 's/+.*//')
STAMP=$(date +%y%j.%H%M)
# Create a "fake" orig.tar.xz
mkdir -p ubuntu/build
cp -a build/linux/x64/release/bundle/* ubuntu/build/
cp -a assets/resources/quickgui.desktop ubuntu/build/
for SIZE in 16 32 48 64 128 256 512; do
mkdir -p ubuntu/build/icons/hicolor/${SIZE}x${SIZE}/apps/
cp -av assets/resources/quickgui_${SIZE}.png ubuntu/build/icons/hicolor/${SIZE}x${SIZE}/apps/quickgui.png
done
tar cvf "ubuntu/quickgui_${TAR_VER}.orig.tar" --directory ubuntu/build .
xz -vv -fz "ubuntu/quickgui_${TAR_VER}.orig.tar"
# Make a debian "source" package
mkdir -p ubuntu/build/debian
cp -a linux/packaging/debian/* ubuntu/build/debian/
sed -i 's/Architecture: any/Architecture: amd64/g' ubuntu/build/debian/control
cd ubuntu/build
for CODENAME in $(distro-info --supported); do
rm debian/changelog
dch --package quickgui --newversion="${DEB_VER}~${CODENAME}${STAMP}" --distribution=${CODENAME} "New upstream release." --create
dpkg-buildpackage -d -S -sa
#dput ppa:flexiondotorg/rubbish ../quickgui_${DEB_VER}~${CODENAME}${STAMP}_source.changes
done
- name: Show artifacts 👀
run: tree ubuntu/
test-build-nix-x64:
runs-on: ubuntu-22.04
permissions:
id-token: "write"
contents: "read"
steps:
- name: "Checkout 🥡"
uses: "actions/checkout@v4"
- name: "Install Nix ❄️"
uses: "DeterminateSystems/nix-installer-action@v12"
- name: "Enable Magic Nix Cache 🪄"
uses: "DeterminateSystems/magic-nix-cache-action@v7"
- name: "Build with Nix ❄️"
run: |
nix build .#quickgui
tree ./result