Skip to content

Commit a84bf21

Browse files
Merge branch 'saber-notes:main' into main
2 parents c2fae37 + 7d60459 commit a84bf21

File tree

156 files changed

+692
-532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+692
-532
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: "Setup"
2+
description: "Setup Node.js environment and dependencies"
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Install apt dependencies
8+
uses: awalsh128/cache-apt-pkgs-action@latest
9+
with:
10+
packages: libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev libsecret-1-dev libjsoncpp-dev ghostscript libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev webkit2gtk-4.1-dev
11+
version: 1.0
12+
execute_install_scripts: true

.github/workflows/android-play-store.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ jobs:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
2222

23-
- name: Install apt dependencies
24-
uses: awalsh128/cache-apt-pkgs-action@latest
25-
with:
26-
packages: libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev libsecret-1-dev libjsoncpp-dev ghostscript libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev webkit2gtk-4.1-dev
27-
version: 1.0
28-
execute_install_scripts: true
23+
- uses: "./.github/shared_workflows/install_apt_dependencies"
2924

3025
- name: Setup cache
3126
uses: actions/cache@v4

.github/workflows/android.yml

+2-12
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ jobs:
2222
- name: Checkout code
2323
uses: actions/checkout@v4
2424

25-
- name: Install apt dependencies
26-
uses: awalsh128/cache-apt-pkgs-action@latest
27-
with:
28-
packages: libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev libsecret-1-dev libjsoncpp-dev ghostscript libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev webkit2gtk-4.1-dev
29-
version: 1.0
30-
execute_install_scripts: true
25+
- uses: "./.github/shared_workflows/install_apt_dependencies"
3126

3227
- name: Setup cache
3328
uses: actions/cache@v4
@@ -104,12 +99,7 @@ jobs:
10499
- name: Checkout code
105100
uses: actions/checkout@v4
106101

107-
- name: Install apt dependencies
108-
uses: awalsh128/cache-apt-pkgs-action@latest
109-
with:
110-
packages: libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev libsecret-1-dev libjsoncpp-dev ghostscript libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev webkit2gtk-4.1-dev
111-
version: 1.0
112-
execute_install_scripts: true
102+
- uses: "./.github/shared_workflows/install_apt_dependencies"
113103

114104
- name: Setup cache
115105
uses: actions/cache@v4

.github/workflows/linux.yml

+32-182
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,53 @@ on:
1010
- '**'
1111
paths:
1212
- .github/workflows/linux.yml
13+
- appimage/AppImageBuilder.yml
1314

1415
jobs:
15-
build-flutter-app-x86_64:
16-
name: Build Flutter app (x86_64)
17-
runs-on: ubuntu-latest
16+
build-linux:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
arch:
21+
- runs-on: ubuntu-latest
22+
cache-name: saber
23+
target-platform: linux-x64
24+
flutter-output-folder: build/linux/x64/release/bundle
25+
archive-suffix: x86_64
26+
- runs-on: ubuntu-24.04-arm
27+
cache-name: saberarm64
28+
target-platform: linux-arm64
29+
flutter-output-folder: build/linux/arm64/release/bundle
30+
archive-suffix: arm64
31+
runs-on: ${{ matrix.arch.runs-on }}
1832
permissions:
1933
contents: write
2034
timeout-minutes: 20
35+
name: Build Linux (${{ matrix.arch.target-platform }})
2136
steps:
2237
- name: Checkout code
2338
uses: actions/checkout@v4
2439

25-
- name: Install apt dependencies
26-
uses: awalsh128/cache-apt-pkgs-action@latest
27-
with:
28-
packages: libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev libsecret-1-dev libjsoncpp-dev ghostscript libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev webkit2gtk-4.1-dev
29-
version: 1.0
30-
execute_install_scripts: true
40+
- uses: "./.github/shared_workflows/install_apt_dependencies"
3141

3242
- name: Setup cache
3343
uses: actions/cache@v4
3444
with:
3545
path: |
3646
build
37-
key: ${{ runner.OS }}-saber-${{ hashFiles('**/pubspec.lock') }}-${{ hashFiles('**/*.dart') }}
47+
key: ${{ runner.OS }}-${{ matrix.arch.cache-name }}-${{ hashFiles('**/pubspec.lock') }}-${{ hashFiles('**/*.dart') }}
3848
restore-keys: |
39-
${{ runner.OS }}-saber-
40-
49+
${{ runner.OS }}-${{ matrix.arch.cache-name }}-
50+
4151
- name: Remove proprietary dependencies
4252
run: ./patches/remove_proprietary_dependencies.sh
4353

4454
- name: Setup Flutter
4555
uses: subosito/flutter-action@v2
4656
with:
47-
channel: stable
57+
# Workaround for https://github.com/subosito/flutter-action/issues/345, needs to be removed when fixed
58+
channel: master
59+
flutter-version: 3.29.1
4860
cache: true
4961
cache-key: 'flutter-:os:-:channel:-:version:-:arch:'
5062

@@ -53,22 +65,21 @@ jobs:
5365

5466
- run: flutter pub get
5567

56-
- name: Build Linux (x86_64)
68+
- name: Build Linux (${{ matrix.arch.target-platform }})
5769
run: |
5870
flutter build linux \
59-
--dart-define=DIRTY=$DIRTY
60-
env:
61-
DIRTY: ${{ !startsWith(github.ref, 'refs/tags/') }}
71+
--target-platform ${{ matrix.arch.target-platform }} \
72+
--dart-define=DIRTY=${{ !startsWith(github.ref, 'refs/tags/') }}
6273
6374
- name: Compress Flutter build
6475
id: compress
6576
run: |
6677
buildName=$(grep -oP "(?<=buildName = ').*(?=')" lib/data/version.dart)
67-
archiveName="Saber_v${buildName}_Linux_x86_64.tar.gz"
78+
archiveName="Saber_v${buildName}_Linux_${{ matrix.arch.archive-suffix }}.tar.gz"
6879
echo "archiveName=$archiveName" >> $GITHUB_OUTPUT
6980
7081
mkdir -p AppDir
71-
mv build/linux/x64/release/bundle/* AppDir
82+
mv ${{ matrix.arch.flutter-output-folder }}/* AppDir
7283
chmod +x AppDir/saber
7384
7485
install -Dm644 flatpak/com.adilhanney.saber.metainfo.xml -t AppDir/share/metainfo/
@@ -84,7 +95,7 @@ jobs:
8495
- name: Upload artifact
8596
uses: actions/upload-artifact@v4
8697
with:
87-
name: Saber-Archive-x86_64
98+
name: Saber-Archive-${{ matrix.arch.archive-suffix }}
8899
path: ${{ steps.compress.outputs.archiveName }}
89100

90101
- name: Upload to GitHub release
@@ -94,170 +105,9 @@ jobs:
94105
repo_token: ${{ secrets.GITHUB_TOKEN }}
95106
file: ${{ steps.compress.outputs.archiveName }}
96107

97-
build-flutter-app-arm64:
98-
name: Build Flutter app (arm64)
99-
runs-on: ubuntu-latest
100-
permissions:
101-
contents: write
102-
packages: write
103-
timeout-minutes: 120
104-
steps:
105-
- name: Checkout code
106-
uses: actions/checkout@v4
107-
108-
- name: Setup cache
109-
uses: actions/cache@v4
110-
with:
111-
path: |
112-
build
113-
key: ${{ runner.OS }}-saberarm64-${{ hashFiles('**/pubspec.lock') }}-${{ hashFiles('**/*.dart') }}
114-
restore-keys: |
115-
${{ runner.OS }}-saberarm64-
116-
117-
- name: Build Linux (arm64)
118-
uses: uraimo/run-on-arch-action@v2
119-
with:
120-
arch: aarch64
121-
distro: ubuntu_latest
122-
githubToken: ${{ github.token }}
123-
124-
setup: |
125-
mkdir -p "${PWD}/AppDir"
126-
mkdir -p "${PWD}/build/pub_cache"
127-
dockerRunArgs: |
128-
--volume "${PWD}/AppDir:/AppDir"
129-
130-
install: |
131-
quiet () {
132-
output=`"$@" 2>&1` || echo $output
133-
}
134-
unsudo () {
135-
sudo -u nonroot env "PATH=$PATH" "CARGO_HOME=$CARGO_HOME" "RUSTUP_HOME=$RUSTUP_HOME" PUB_CACHE="$PUB_CACHE" "$@"
136-
}
137-
138-
echo Installing dependencies
139-
quiet apt-get update -qq -y
140-
quiet apt-get install -qq -y \
141-
sudo \
142-
bash curl file git unzip xz-utils zip \
143-
clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev \
144-
libsecret-1-dev libjsoncpp-dev webkit2gtk-4.1-dev \
145-
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev
146-
147-
echo Creating nonroot user
148-
useradd -m -d /home/nonroot -s /bin/bash nonroot
149-
echo 'export PATH="$PATH:/opt/flutter/bin"' >> /home/nonroot/.bashrc
150-
echo 'export PATH="$PATH:/opt/cargo/bin"' >> /home/nonroot/.bashrc
151-
echo 'export CARGO_HOME=/opt/cargo' >> /home/nonroot/.bashrc
152-
echo 'export RUSTUP_HOME=/opt/rustup' >> /home/nonroot/.bashrc
153-
echo 'export PUB_CACHE=build/pub_cache' >> /home/nonroot/.bashrc
154-
export PATH="$PATH:/opt/flutter/bin"
155-
export PATH="$PATH:/opt/cargo/bin"
156-
export CARGO_HOME=/opt/cargo
157-
export RUSTUP_HOME=/opt/rustup
158-
export PUB_CACHE=build/pub_cache
159-
160-
echo Installing Flutter
161-
if [ -z "$(which flutter)" ]; then
162-
echo Flutter not installed, installing...
163-
mkdir -p /opt/flutter
164-
chown -R nonroot /opt/flutter
165-
unsudo git clone https://github.com/flutter/flutter.git -b stable --depth 1 /opt/flutter
166-
else
167-
echo Flutter already installed, updating...
168-
chown -R nonroot /opt/flutter
169-
unsudo flutter upgrade
170-
fi
171-
172-
echo flutter doctor
173-
unsudo flutter doctor -v
174-
175-
echo Precaching Flutter
176-
unsudo flutter precache --no-universal --linux
177-
178-
echo Installing Rust
179-
mkdir -p $CARGO_HOME
180-
mkdir -p $RUSTUP_HOME
181-
mkdir -p "$RUSTUP_HOME/tmp"
182-
chown -R nonroot $CARGO_HOME
183-
chown -R nonroot $RUSTUP_HOME
184-
unsudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y
185-
chmod -R a+rw $CARGO_HOME
186-
chmod -R a+rw $RUSTUP_HOME
187-
unsudo ls -l $CARGO_HOME/bin
188-
unsudo which rustup
189-
190-
run: |
191-
unsudo () {
192-
sudo -u nonroot env "PATH=$PATH" "CARGO_HOME=$CARGO_HOME" "RUSTUP_HOME=$RUSTUP_HOME" PUB_CACHE="$PUB_CACHE" "$@"
193-
}
194-
195-
echo Setting up environment
196-
chown -R nonroot .
197-
chown -R nonroot /opt/flutter
198-
chown -R nonroot /opt/cargo
199-
export PATH="$PATH:/opt/flutter/bin"
200-
export PATH="$PATH:/opt/cargo/bin"
201-
export CARGO_HOME=/opt/cargo
202-
export RUSTUP_HOME=/opt/rustup
203-
export PUB_CACHE=build/pub_cache
204-
205-
echo Removing proprietary dependencies
206-
./patches/remove_proprietary_dependencies.sh
207-
208-
echo Disabling Flutter CLI animations
209-
unsudo flutter config --no-cli-animations
210-
211-
echo flutter pub get
212-
unsudo flutter pub get
213-
214-
echo Verifying that rustup is installed
215-
unsudo which rustup
216-
217-
echo Building
218-
unsudo flutter build linux \
219-
--target-platform linux-arm64 \
220-
--dart-define=DIRTY=${{ !startsWith(github.ref, 'refs/tags/') }}
221-
mv build/linux/arm64/release/bundle/* /AppDir/
222-
chown -R nonroot /AppDir/
223-
chmod -R a+rw /AppDir/
224-
chmod a+x /AppDir/saber
225-
226-
- name: Compress Flutter build
227-
id: compress
228-
run: |
229-
buildName=$(grep -oP "(?<=buildName = ').*(?=')" lib/data/version.dart)
230-
archiveName="Saber_v${buildName}_Linux_arm64.tar.gz"
231-
echo "archiveName=$archiveName" >> $GITHUB_OUTPUT
232-
233-
sudo chown -R $USER:$USER .
234-
235-
install -Dm644 flatpak/com.adilhanney.saber.metainfo.xml -t AppDir/share/metainfo/
236-
install -Dm644 flatpak/com.adilhanney.saber.metainfo.xml -t AppDir/usr/share/metainfo/
237-
238-
install -Dm644 assets/icon/icon.svg AppDir/share/icons/hicolor/scalable/apps/com.adilhanney.saber.svg
239-
install -Dm644 assets/icon/icon.svg AppDir/usr/share/icons/hicolor/scalable/apps/com.adilhanney.saber.svg
240-
241-
install -Dm644 flatpak/com.adilhanney.saber.desktop -t AppDir/share/applications/
242-
243-
tar -C AppDir -cvf $archiveName .
244-
245-
- name: Upload artifact
246-
uses: actions/upload-artifact@v4
247-
with:
248-
name: Saber-Archive-arm64
249-
path: ${{ steps.compress.outputs.archiveName }}
250-
251-
- name: Upload to GitHub release
252-
uses: svenstaro/upload-release-action@v2
253-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
254-
with:
255-
repo_token: ${{ secrets.GITHUB_TOKEN }}
256-
file: ${{ steps.compress.outputs.archiveName }}
257-
258108
build-appimage:
259109
name: Build AppImage
260-
needs: build-flutter-app-x86_64
110+
needs: build-linux
261111
runs-on: ubuntu-latest
262112
permissions:
263113
contents: write

.github/workflows/onyxsdk_pen_tests.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ jobs:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
2222

23-
- name: Install apt dependencies
24-
uses: awalsh128/cache-apt-pkgs-action@latest
25-
with:
26-
packages: libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev libsecret-1-dev libjsoncpp-dev ghostscript libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev webkit2gtk-4.1-dev
27-
version: 1.0
28-
execute_install_scripts: true
23+
- uses: "./.github/shared_workflows/install_apt_dependencies"
2924

3025
- name: Setup Flutter
3126
uses: subosito/flutter-action@v2

.github/workflows/tests.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
1818

19-
- name: Install apt dependencies
20-
uses: awalsh128/cache-apt-pkgs-action@latest
21-
with:
22-
packages: libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev libsecret-1-dev libjsoncpp-dev ghostscript libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev webkit2gtk-4.1-dev
23-
version: 1.0
24-
execute_install_scripts: true
19+
- uses: "./.github/shared_workflows/install_apt_dependencies"
2520

2621
- name: Setup cache
2722
uses: actions/cache@v4

README-ar.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ If you like Saber, please consider supporting it by:
343343
[google_play]: https://play.google.com/store/apps/details?id=com.adilhanney.saber
344344
[snap]: https://snapcraft.io/saber
345345
[app_store]: https://apps.apple.com/us/app/saber/id1671523739
346-
[download_windows]: https://github.com/saber-notes/saber/releases/download/v0.25.3/SaberInstaller_v0.25.3.exe
347-
[download_appimage]: https://github.com/saber-notes/saber/releases/download/v0.25.3/Saber-0.25.3-x86_64.AppImage
346+
[download_windows]: https://github.com/saber-notes/saber/releases/download/v0.25.4/SaberInstaller_v0.25.4.exe
347+
[download_appimage]: https://github.com/saber-notes/saber/releases/download/v0.25.4/Saber-0.25.4-x86_64.AppImage
348348

349349
[nextcloud]: https://nc.saber.adil.hanney.org/
350350

README-cs.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ Pokud máte rádi Saber, zvažte prosím jeho podporu pomocí
352352
[google_play]: https://play.google.com/store/apps/details?id=com.adilhanney.saber
353353
[snap]: https://snapcraft.io/saber
354354
[app_store]: https://apps.apple.com/cz/app/saber/id1671523739
355-
[download_windows]: https://github.com/saber-notes/saber/releases/download/v0.25.3/SaberInstaller_v0.25.3.exe
356-
[download_appimage]: https://github.com/saber-notes/saber/releases/download/v0.25.3/Saber-0.25.3-x86_64.AppImage
355+
[download_windows]: https://github.com/saber-notes/saber/releases/download/v0.25.4/SaberInstaller_v0.25.4.exe
356+
[download_appimage]: https://github.com/saber-notes/saber/releases/download/v0.25.4/Saber-0.25.4-x86_64.AppImage
357357

358358
[nextcloud]: https://nc.saber.adil.hanney.org/
359359

README-de.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ Falls dir Saber gefällt, bitte denke darüber nach das Projekt wie folgt zu unt
338338
[google_play]: https://play.google.com/store/apps/details?id=com.adilhanney.saber
339339
[snap]: https://snapcraft.io/saber
340340
[app_store]: https://apps.apple.com/us/app/saber/id1671523739
341-
[download_windows]: https://github.com/saber-notes/saber/releases/download/v0.25.3/SaberInstaller_v0.25.3.exe
342-
[download_appimage]: https://github.com/saber-notes/saber/releases/download/v0.25.3/Saber-0.25.3-x86_64.AppImage
341+
[download_windows]: https://github.com/saber-notes/saber/releases/download/v0.25.4/SaberInstaller_v0.25.4.exe
342+
[download_appimage]: https://github.com/saber-notes/saber/releases/download/v0.25.4/Saber-0.25.4-x86_64.AppImage
343343

344344
[nextcloud]: https://nc.saber.adil.hanney.org/
345345

0 commit comments

Comments
 (0)