This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
192 lines (183 loc) · 6.82 KB
/
flutter.yml
File metadata and controls
192 lines (183 loc) · 6.82 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: "Create Setup files"
on:
release:
types: [published]
branches: ["app"]
jobs:
windows_build:
name: Create Windows Setup file
runs-on: windows-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v3
- name: "Setup Flutter"
uses: subosito/flutter-action@v2
with:
flutter-version: "3.3.3"
architecture: x64
- name: "Build application"
run: |
flutter config --enable-windows-desktop
flutter build windows --release --no-sound-null-safety --dart-define=LB_PLANNER_SETUP_TYPE=exe
- name: Create config.iss
uses: DamianReeves/write-file-action@master
with:
path: config.iss
contents: |
#define MyAppName "LB Planner"
#define MyAppVersion "${{ github.ref_name }}"
#define MyAppPublisher "necodeIT"
#define MyAppURL "https://projekte.tgm.ac.at/lb-planner/"
#define MyAppExeName "lb_planner.exe"
[Setup]
AppId=75c7586b-90c8-4f31-ad1d-dfb465f6941a
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName="LB Planner ${{ github.event.release.name }}"
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
UninstallDisplayIcon={app}\lb_planner.exe
DisableProgramGroupPage=yes
OutputDir=.
OutputBaseFilename=LB.Planner.Setup
SetupIconFile=app_icon.png
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "build\windows\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion
Source: "build\windows\runner\Release\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: runascurrentuser nowait postinstall skipifsilent
- name: Create installer
uses: nadeemjazmawe/inno-setup-action-cli@v6.0.5
with:
filepath: config.iss
- name: Upload Setup file
uses: xresloader/upload-to-github-release@v1.3.11
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: LB.Planner.Setup.exe
release_id: ${{ github.event.release.id }}
macos_build:
name: Create macOS Setup file
runs-on: macos-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v3
- name: "Setup flutter"
uses: subosito/flutter-action@v2
with:
flutter-version: "3.3.3"
architecture: x64
- name: Build application
run: |
flutter config --enable-macos-desktop
flutter build macos --release --no-sound-null-safety --dart-define=LB_PLANNER_SETUP_TYPE=dmg
- name: Install node
uses: actions/setup-node@v2
with:
node-version: "16"
- name: Install appdmg node module
run: |
npm install -g appdmg
appdmg --version
- name: Create config file
run: |
echo '{
"title": "LB Planner",
"icon": "app_icon.icns",
"contents": [
{
"x": 410,
"y": 150,
"type": "link",
"path": "/Applications"
},
{
"x": 130,
"y": 150,
"type": "file",
"path": "build/macos/Build/Products/Release/LB Planner.app"
}
]
}' > ./dmg_config.json
- name: Create Setup file
run: |
appdmg dmg_config.json LB.Planner.Setup.dmg
- name: Upload Setup file
uses: xresloader/upload-to-github-release@v1.3.11
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: LB.Planner.Setup.dmg
release_id: ${{ github.event.release.id }}
linux_build:
name: Create Linux AppImage
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build libgtk-3-dev
sudo apt-get install fuse libfuse2
sudo apt-get install -y appstream
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.3.3"
architecture: x64
- name: Build application
run: |
flutter config --enable-linux-desktop
flutter build linux --release --no-sound-null-safety --dart-define=LB_PLANNER_SETUP_TYPE=appimage
- name: Install AppImage Tool
run: |
wget -c https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
- name: Create the required directories and copy the binary files to the AppDir
run: |
mkdir -p ./LB.Planner.AppDir/usr/bin
cp -r build/linux/x64/release/bundle/* ./LB.Planner.AppDir/usr/bin/
cp app_icon.png ./LB.Planner.AppDir/app_icon.png
- name: Create Desktop file
run: |
echo "[Desktop Entry]
Name=LB Planner
Exec=lb_planner
Icon=app_icon
Type=Application
Categories=Education;" > ./LB.Planner.AppDir/lb_planner.desktop
chmod +x ./LB.Planner.AppDir/lb_planner.desktop
- name: Create AppRun file
run: |
echo '#!/bin/sh
HERE="$(dirname "$(readlink -f "${0}")")"
EXEC="${HERE}/usr/bin/lb_planner"
exec "${EXEC}"' > ./LB.Planner.AppDir/AppRun
chmod +x ./LB.Planner.AppDir/AppRun
- name: Create AppImage
run: |
ARCH=x86_64 appimagetool ./LB.Planner.AppDir
mv LB_Planner-x86_64.AppImage LB.Planner-x86_64.AppImage
- name: Upload AppImage
uses: xresloader/upload-to-github-release@v1.3.11
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: LB.Planner-x86_64.AppImage
release_id: ${{ github.event.release.id }}