forked from shiosyakeyakini-info/miria
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (84 loc) · 3.68 KB
/
linux_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
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
name: デプロイ(linux)
on:
workflow_dispatch:
release:
types: [published]
env:
APP_NAME: 'miria'
MAINTAINER: 'sorairo <sorairo@shiosyakeyakini.info>'
permissions:
contents: write
jobs:
build-debs:
name: ビルド(Deb)
runs-on: ubuntu-latest
strategy:
matrix:
platform: [amd64]
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Get Flutter version from .fvmrc
run: echo "FLUTTER_FVM_VERSION=$(jq -r .flutter .fvmrc)" >> $GITHUB_ENV
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_FVM_VERSION }}
cache: true
- name: Patch for linux build
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libsecret-1-dev libstdc++-12-dev nasm
sudo pip3 install meson
- name: Build libmpv
run: |
git clone https://github.com/mpv-player/mpv-build.git
cd mpv-build
sed -i 's|checkout_ffmpeg=master|checkout_ffmpeg=@dcdfd7fb62464beeeb03c24f21713bf3914b9ea4|g' update
sed -i 's|checkout_libplacebo=master|checkout_libplacebo=@ed29e541a55acf28022738440b2a925386292551|g' update
sed -i 's|checkout_mpv=master|checkout_mpv=@140ec21c89d671d392877a7f3b91d67e7d7b9239|g' update
sed -i 's|OPTIONS="--enable-static --disable-shared"|OPTIONS="--enable-shared"|g' scripts/libass-config
sed -i 's|--prefix="$BUILD/build_libs" --libdir="$BUILD/build_libs/lib"||g' scripts/libass-config
sed -i 's|^meson setup build.*||g' scripts/mpv-config
echo -e "\npython3 ./bootstrap.py\n./waf configure --disable-alsa --enable-libmpv-shared\n./waf build" >> scripts/mpv-config
./update
./scripts/libplacebo-config
./scripts/libplacebo-build -j$(nproc)
./scripts/libass-config
sudo make -C libass install -j$(nproc)
./scripts/ffmpeg-config
./scripts/ffmpeg-build -j$(nproc)
./scripts/mpv-config
cd mpv
sudo ./waf install
- run: flutter pub get
# - run: flutter test
- run: flutter build linux
- name: Get Build Version
run: |
echo "VERSION=$(yq -r '.version' pubspec.yaml)" >> $GITHUB_ENV
- name: Prepare to build DEB
run: |
echo "DESC=$(awk -F '=' '/^Comment=/{print $2}' ./snap/gui/miria.desktop)" >> $GITHUB_ENV
sed -i -E 's|^Version=.*|Version=${{ env.VERSION }}|g' ./snap/gui/miria.desktop
sed -i -E 's|^Icon=.*|Icon=/usr/share/pixmaps/miria.png|g' ./snap/gui/miria.desktop
sed -i -E 's|^Exec=.*|Exec=/opt/miria/miria|g' ./snap/gui/miria.desktop
mkdir -p .debpkg/opt/miria .debpkg/usr/share/applications .debpkg/usr/share/pixmaps
cp -rp ./build/linux/x64/release/bundle/* .debpkg/opt/miria/
cp ./snap/gui/miria.desktop .debpkg/usr/share/applications/
cp ./assets/images/icon.png .debpkg/usr/share/pixmaps/miria.png
- name: Build DEB
uses: jiro4989/build-deb-action@v3
with:
desc: '${{ env.DESC }}'
package: ${{ env.APP_NAME }}
maintainer: ${{ env.MAINTAINER }}
version: ${{ env.VERSION }}
arch: "amd64"
package_root: ".debpkg"
depends: "libgtk-3-0, libstdc++6, libx11-6, libsecret-1-0"
- name: Upload DEB
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create --draft v$VERSION ./miria_${{ env.VERSION }}_amd64.deb