forked from shiosyakeyakini-info/miria
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (70 loc) · 2.78 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
name: デプロイ(Linux)
on:
workflow_dispatch:
release:
types: [published]
permissions:
contents: write
jobs:
build_for_linux:
name: Linux用ビルド
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Flutter Develop dependencies
run: sudo apt install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libmpv-dev mpv
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Cache pubspec dependencies
uses: actions/cache@v3
with:
path: |
${{ env.FLUTTER_HOME }}/.pub-cache
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.lock') }}
restore-keys: build-pubspec-
- name: Install Flutter Build Tools for Linux
run: sudo apt install -y libsecret-1-dev
- name: Flutter pub get
run: flutter pub get
- name: Get Version
run: echo "VERSION=$(flutter pub run cider version)" >> $GITHUB_ENV
- name: Flutter Build
run: flutter build linux --release
- name: Setup Packaging AppImage
run: |
sudo apt install -y locate libfuse2
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
sudo mv appimagetool /usr/local/bin/
flutter pub global activate flutter_distributor
- name: Packaging AppImage
run: |
flutter_distributor package --platform linux --targets appimage --skip-clean
mv ./dist/$BUMP_VERSION/miria-$BUMP_VERSION-linux.AppImage ./dist/$BUMP_VERSION/miria-$BUMP_VERSION-amd64.AppImage
- name: Upload artifact to release (AppImage)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload v$VERSION ./dist/$BUMP_VERSION/miria-$BUMP_VERSION-amd64.AppImage
- name: Compress App
run: |
cd build/linux/x64/release/bundle
tar -czaf miria-$VERSION-x86_64.tar.gz *
# - name: Upload artifact
# uses: actions/upload-artifacts@v3
# with:
# name: linux-x86_64
# path: build/linux/x64/release/bundle/miria-$VERSION-x86_64.tar.gz
- name: Upload artifact to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload v$VERSION ./build/linux/x64/release/bundle/miria-$VERSION-x86_64.tar.gz
- name: Remove artifact.tar.gz
run: rm build/linux/x64/release/bundle/miria-$VERSION-x86_64.tar.gz