-
Notifications
You must be signed in to change notification settings - Fork 16
110 lines (92 loc) · 3.14 KB
/
build-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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Build & Deploy
on:
push:
branches:
- main
jobs:
build-flutter-app:
name: Build and compress Flutter app
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Dependencies
run: sudo apt update && sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
- name: Cache Flutter dependencies
uses: actions/cache@v1
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Build
run: |
flutter pub get
flutter build linux
- name: Compress Flutter build
run: tar -C build/linux/x64/release/bundle -cvf DevWidgets-Linux-Portable.tar.gz .
- name: Upload app archive for next steps
uses: actions/upload-artifact@v2
with:
name: DevWidgets-Archive
path: DevWidgets-Linux-Portable.tar.gz
build-appimage:
name: Build AppImage
runs-on: ubuntu-latest
needs: build-flutter-app
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download app archive
uses: actions/download-artifact@v3
with:
name: DevWidgets-Archive
- name: Extract archive
run: |
mkdir portable && tar -xf DevWidgets-Linux-Portable.tar.gz -C $_
- name: Build AppImage
run: |
cp -r portable DevWidgets.AppDir
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
sudo apt install libfuse2
chmod +x ./appimagetool-x86_64.AppImage
cp -r linux/appimage_assets/* DevWidgets.AppDir/
chmod +x DevWidgets.AppDir/AppRun
./appimagetool-x86_64.AppImage DevWidgets.AppDir/
- name: Upload .AppImage artifact to workflow
uses: actions/upload-artifact@v2
with:
name: AppImage artifact
path: DevWidgets-x86_64.AppImage
automatic_release:
name: Automatic Release
runs-on: ubuntu-latest
needs: [build-appimage, build-flatpak]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download Linux portable artifact
uses: actions/download-artifact@v3
with:
name: DevWidgets-Archive
- name: Download AppImage artifact
uses: actions/download-artifact@v3
with:
name: AppImage artifact
- name: Download Flatpak artifact
uses: actions/download-artifact@v3
with:
name: Flatpak artifact
- name: Automatic Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Latest Build"
files: |
DevWidgets-x86_64.AppImage
DevWidgets-Linux-Portable.tar.gz
DevWidgets.flatpak