Skip to content

Commit df0a17e

Browse files
authored
Merge pull request #7 from paluigi/dev
Dev
2 parents 25060c4 + 12802c1 commit df0a17e

File tree

3 files changed

+229
-133
lines changed

3 files changed

+229
-133
lines changed

.github/workflows/desktop-builds.yml

Lines changed: 0 additions & 133 deletions
This file was deleted.

.github/workflows/flet_build.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Build Flet App
2+
3+
on:
4+
workflow_dispatch:
5+
6+
env:
7+
UV_PYTHON: 3.11 # Python version
8+
PYTHONUTF8: 1
9+
10+
# https://docs.flet.dev/publish/
11+
BUILD_NUMBER: 1
12+
BUILD_VERSION: 1.0.0
13+
14+
# https://docs.flet.dev/reference/environment-variables
15+
FLET_CLI_NO_RICH_OUTPUT: 1
16+
17+
jobs:
18+
build:
19+
name: Build ${{ matrix.name }}
20+
runs-on: ${{ matrix.runner }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
# -------- Desktop --------
26+
- name: linux
27+
runner: ubuntu-latest
28+
build_cmd: "flet build linux --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
29+
artifact_path: build/linux
30+
needs_linux_deps: true
31+
32+
- name: macos
33+
runner: macos-latest
34+
build_cmd: "flet build macos --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
35+
artifact_path: build/macos
36+
needs_linux_deps: false
37+
38+
- name: windows
39+
runner: windows-latest
40+
build_cmd: "flet build windows --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
41+
artifact_path: build/windows
42+
needs_linux_deps: false
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Setup uv
49+
uses: astral-sh/setup-uv@v6
50+
51+
- name: Install Linux dependencies
52+
if: matrix.needs_linux_deps
53+
shell: bash
54+
run: |
55+
sudo apt update --allow-releaseinfo-change
56+
sudo apt-get install -y --no-install-recommends \
57+
clang \
58+
ninja-build \
59+
libgtk-3-dev \
60+
libasound2-dev \
61+
libmpv-dev \
62+
mpv \
63+
libgstreamer1.0-dev \
64+
libgstreamer-plugins-base1.0-dev \
65+
libgstreamer-plugins-bad1.0-dev \
66+
gstreamer1.0-plugins-base \
67+
gstreamer1.0-plugins-good \
68+
gstreamer1.0-plugins-bad \
69+
gstreamer1.0-plugins-ugly \
70+
gstreamer1.0-libav \
71+
gstreamer1.0-tools \
72+
gstreamer1.0-x \
73+
gstreamer1.0-alsa \
74+
gstreamer1.0-gl \
75+
gstreamer1.0-gtk3 \
76+
gstreamer1.0-qt5 \
77+
gstreamer1.0-pulseaudio \
78+
pkg-config \
79+
libsecret-1-0 \
80+
libsecret-1-dev
81+
sudo apt-get clean
82+
83+
- name: Build app
84+
shell: bash
85+
run: |
86+
uv run ${{ matrix.build_cmd }}
87+
88+
- name: Upload Artifact
89+
uses: actions/upload-artifact@v5.0.0
90+
with:
91+
name: ${{ matrix.name }}-build-artifact
92+
path: ${{ matrix.artifact_path }}
93+
if-no-files-found: error
94+
overwrite: false

.github/workflows/release.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Release Build
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
env:
9+
UV_PYTHON: 3.11 # Python version
10+
PYTHONUTF8: 1
11+
12+
# https://docs.flet.dev/publish/
13+
BUILD_NUMBER: 1
14+
BUILD_VERSION: 1.0.0
15+
16+
# https://docs.flet.dev/reference/environment-variables
17+
FLET_CLI_NO_RICH_OUTPUT: 1
18+
19+
jobs:
20+
build:
21+
name: Build ${{ matrix.name }}
22+
runs-on: ${{ matrix.runner }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
include:
27+
# -------- Desktop --------
28+
- name: linux
29+
runner: ubuntu-latest
30+
build_cmd: "flet build linux --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
31+
artifact_path: build/linux
32+
needs_linux_deps: true
33+
34+
- name: macos
35+
runner: macos-latest
36+
build_cmd: "flet build macos --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
37+
artifact_path: build/macos
38+
needs_linux_deps: false
39+
40+
- name: windows
41+
runner: windows-latest
42+
build_cmd: "flet build windows --yes --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION"
43+
artifact_path: build/windows
44+
needs_linux_deps: false
45+
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v4
49+
50+
- name: Setup uv
51+
uses: astral-sh/setup-uv@v6
52+
53+
- name: Install Linux dependencies
54+
if: matrix.needs_linux_deps
55+
shell: bash
56+
run: |
57+
sudo apt update --allow-releaseinfo-change
58+
sudo apt-get install -y --no-install-recommends \
59+
clang \
60+
ninja-build \
61+
libgtk-3-dev \
62+
libasound2-dev \
63+
libmpv-dev \
64+
mpv \
65+
libgstreamer1.0-dev \
66+
libgstreamer-plugins-base1.0-dev \
67+
libgstreamer-plugins-bad1.0-dev \
68+
gstreamer1.0-plugins-base \
69+
gstreamer1.0-plugins-good \
70+
gstreamer1.0-plugins-bad \
71+
gstreamer1.0-plugins-ugly \
72+
gstreamer1.0-libav \
73+
gstreamer1.0-tools \
74+
gstreamer1.0-x \
75+
gstreamer1.0-alsa \
76+
gstreamer1.0-gl \
77+
gstreamer1.0-gtk3 \
78+
gstreamer1.0-qt5 \
79+
gstreamer1.0-pulseaudio \
80+
pkg-config \
81+
libsecret-1-0 \
82+
libsecret-1-dev
83+
sudo apt-get clean
84+
85+
- name: Build app
86+
shell: bash
87+
run: |
88+
uv run ${{ matrix.build_cmd }}
89+
90+
- name: Upload Artifact
91+
uses: actions/upload-artifact@v5.0.0
92+
with:
93+
name: ${{ matrix.name }}-build-artifact
94+
path: ${{ matrix.artifact_path }}
95+
if-no-files-found: error
96+
overwrite: false
97+
98+
release:
99+
needs: build
100+
runs-on: ubuntu-latest
101+
permissions:
102+
contents: write
103+
steps:
104+
- name: Download all artifacts
105+
uses: actions/download-artifact@v4
106+
with:
107+
path: artifacts
108+
merge-multiple: false
109+
110+
- name: Rename artifacts with version tag
111+
run: |
112+
TAG_NAME="${GITHUB_REF#refs/tags/}"
113+
mv artifacts/linux-build-artifact "artifacts/linux-${TAG_NAME}"
114+
mv artifacts/macos-build-artifact "artifacts/macos-${TAG_NAME}"
115+
mv artifacts/windows-build-artifact "artifacts/windows-${TAG_NAME}"
116+
ls -la artifacts/
117+
118+
- name: Zip artifacts
119+
run: |
120+
TAG_NAME="${GITHUB_REF#refs/tags/}"
121+
cd artifacts
122+
zip -r "linux-${TAG_NAME}.zip" "linux-${TAG_NAME}"
123+
zip -r "macos-${TAG_NAME}.zip" "macos-${TAG_NAME}"
124+
zip -r "windows-${TAG_NAME}.zip" "windows-${TAG_NAME}"
125+
ls -la
126+
127+
- name: Create GitHub Release
128+
uses: softprops/action-gh-release@v2
129+
with:
130+
name: "Release ${{ github.ref_name }}"
131+
files: |
132+
artifacts/*.zip
133+
generate_release_notes: true
134+
env:
135+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)