forked from shiosyakeyakini-info/miria
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (66 loc) · 2.58 KB
/
flatpak_deploy.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
name: Build Flatpak
on: [push]
jobs:
build_flutter_app:
name: Build and compress Flutter App
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.cprs.outputs.tarsha }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Flutter dependencies
run: |
sudo apt update
sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libsecret-1-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Build Flutter Linux version
run: |
flutter pub get
flutter build linux
echo "VERSION=$(flutter pub run cider version)" >> $GITHUB_ENV
- name: Compress App
run: |
cd build/linux/x64/release/bundle
tar -czaf miria-$VERSION-amd64.tar.gz *
- name: Get checksum
id: cprs
run: |
echo "tarsha=$(sha256sum build/linux/x64/release/bundle/miria-$VERSION-amd64.tar.gz | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
- name: Upload artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload v$VERSION build/linux/x64/release/bundle/miria-$VERSION-amd64.tar.gz
build_flatpak:
name: Build Flatpak
needs: build_flutter_app
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08
options: --privileged
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup build env
env:
OUTPUT1: ${{ needs.build_flutter_app.outputs.output1 }}
run: |
VERSION=$(cat pubspec.yaml | grep version | cut -d ' ' -f 2)
chmod 777 flatpak/build-flatpak.sh
cp assets/images/icon.png assets/images/info.shiosyakeyakini.miria.png
sed -i "s|url: file_path|url: https://github.com/Npepperlinux/miria/releases/download/v$VERSION/miria-$VERSION-amd64.tar.gz|g" flatpak/info.shiosyakeyakini.miria.yml
sed -i "s|sha256: get-later|sha256: $OUTPUT1|g" flatpak/info.shiosyakeyakini.miria.yml
sed -i "s|ReplaceToCommand|tar -xf miria-$VERSION-amd64.tar.gz -C miria|g" flatpak/build-flatpak.sh
cat flatpak/build-flatpak.sh
- name: Build .flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: miria.flatpak
manifest-path: flatpak/info.shiosyakeyakini.miria.yml
- name: Upload Flatpak artifact
uses: actions/upload-artifact@v3
with:
path: miria.flatpak