forked from ndonkoHenri/flet-github-action-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (111 loc) · 3.65 KB
/
desktop-builds.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
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
name: Desktop Build (Linux, macOS, Windows)
on:
# Runs on push to any of the below branches
push:
branches:
- master
- main
# Runs on pull request events that target one of the below branches
pull_request:
branches:
- master
- main
# Allows you to run this workflow manually from the Actions tab of the repository
workflow_dispatch:
env:
# https://flet.dev/docs/publish#versioning
BUILD_NUMBER: 1
BUILD_VERSION: 1.0.0
PYTHON_VERSION: 3.12.2
FLUTTER_VERSION: 3.24.0
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Setup Flutter ${{ env.FLUTTER_VERSION }}
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Patch for linux build
run: |
flutter doctor
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
flutter doctor
- name: Flet Build Linux
run: |
flutter config --no-analytics
flet build linux --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION
- name: Upload Linux Artifact
uses: actions/[email protected]
with:
name: linux-build-artifact
path: build/linux
if-no-files-found: warn
overwrite: false
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Setup Flutter ${{ env.FLUTTER_VERSION }}
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Flet Build macOS
run: |
flutter config --no-analytics
flet build macos --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION
- name: Upload macOS Artifact
uses: actions/[email protected]
with:
name: macos-build-artifact
path: build/macos
if-no-files-found: warn
overwrite: false
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Setup Flutter ${{ env.FLUTTER_VERSION }}
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Flet Build Windows
run: |
flutter config --no-analytics
flet build windows --verbose --no-rich-output --build-number=$env:BUILD_NUMBER --build-version=$env:BUILD_VERSION
- name: Upload Windows Artifact
uses: actions/[email protected]
with:
name: windows-build-artifact
path: build/windows
if-no-files-found: warn
overwrite: false