Skip to content

Commit 87ea122

Browse files
committed
chore: Rework utopia of having a single flatpak binary as an output
1 parent 3eac123 commit 87ea122

2 files changed

Lines changed: 18 additions & 77 deletions

File tree

.github/workflows/new_flatpak.yaml

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
lfs: true
5353
submodules: recursive
5454
- uses: ./.github/actions/setup_gradle
55+
- uses: ./.github/actions/setup_python
5556
- name: "Download lib native"
5657
uses: actions/download-artifact@v7
5758
with:
@@ -72,42 +73,10 @@ jobs:
7273
name: app-linux-${{ matrix.arch }}
7374
path: |
7475
desktopApp/build/distributions/*.tar.gz
75-
flatpak:
76-
runs-on: ubuntu-latest
77-
needs:
78-
- build-linux-app
79-
env:
80-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81-
steps:
82-
- name: "Checkout"
83-
uses: actions/checkout@v6
84-
with:
85-
lfs: true
86-
submodules: recursive
87-
- uses: ./.github/actions/setup_python
88-
- name: "Download artifacts (x86_64)"
89-
uses: actions/download-artifact@v7
90-
with:
91-
name: app-linux-x86_64
92-
path: artifacts-x86_64
93-
- name: "Download artifacts (aarch64)"
94-
uses: actions/download-artifact@v7
95-
with:
96-
name: app-linux-aarch64
97-
path: artifacts-aarch64
98-
- name: "Verify directory structure"
99-
run: |
100-
find artifacts-x86_64
101-
find artifacts-aarch64
10276
- name: "Move binaries into the template directory"
10377
run: |
104-
mkdir -p desktopApp/flatpak/app-x86_64/
105-
mkdir -p desktopApp/flatpak/app-aarch64/
106-
tar -xvzf $(find . -type f -regex '\./artifacts-x86_64/.*\.tar.gz') -C desktopApp/flatpak/app-x86_64/ --strip-components=1
107-
tar -xvzf $(find . -type f -regex '\./artifacts-aarch64/.*\.tar.gz') -C desktopApp/flatpak/app-aarch64/ --strip-components=1
108-
- name: "Verify directory structure"
109-
run: |
110-
find desktopApp/flatpak
78+
mkdir -p desktopApp/flatpak/app-${{ matrix.arch }}/
79+
tar -xvzf $(find . -type f -regex '\./desktopApp/build/distributions/.*\.tar.gz') -C desktopApp/flatpak/app-${{ matrix.arch }}/ --strip-components=1
11180
- name: "Get Flatpak runtime version -install dependencies"
11281
run: pip install -r .github/get_flatpak_runtime_version.requirements.txt
11382
- name: "Get Flatpak runtime version"
@@ -123,10 +92,10 @@ jobs:
12392
working-directory: desktopApp/flatpak/
12493
run: |
12594
flatpak-builder --force-clean --state-dir=build/flatpak-builder --repo=build/flatpak-repo build/flatpak-target com.artemchep.keyguard.yml
126-
flatpak build-bundle build/flatpak-repo Keyguard.flatpak com.artemchep.keyguard
95+
flatpak build-bundle build/flatpak-repo "Keyguard-$(find . -type f -regex '\./desktopApp/build/distributions/.*\.tar.gz' | sed -E 's/.*-([0-9]+\.[0-9]+\.[0-9]+)-.*/\1/')-${{ matrix.arch }}.flatpak" com.artemchep.keyguard
12796
- name: 'Upload .flatpak'
12897
uses: actions/upload-artifact@v6
12998
with:
130-
name: app-flatpak
99+
name: app-linux-flatpak-${{ matrix.arch }}
131100
path: |
132-
desktopApp/flatpak/Keyguard.flatpak
101+
desktopApp/flatpak/Keyguard-*.flatpak

.github/workflows/new_tag_release.yaml

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -143,42 +143,10 @@ jobs:
143143
name: app-linux-${{ matrix.arch }}
144144
path: |
145145
desktopApp/build/distributions/*.tar.gz
146-
build-linux-flatpak-app:
147-
runs-on: ubuntu-latest
148-
needs:
149-
- build-linux-app
150-
env:
151-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152-
steps:
153-
- name: "Checkout"
154-
uses: actions/checkout@v6
155-
with:
156-
lfs: true
157-
submodules: recursive
158-
- uses: ./.github/actions/setup_python
159-
- name: "Download artifacts (x86_64)"
160-
uses: actions/download-artifact@v7
161-
with:
162-
name: app-linux-x86_64
163-
path: artifacts-x86_64
164-
- name: "Download artifacts (aarch64)"
165-
uses: actions/download-artifact@v7
166-
with:
167-
name: app-linux-aarch64
168-
path: artifacts-aarch64
169-
- name: "Verify directory structure"
170-
run: |
171-
find artifacts-x86_64
172-
find artifacts-aarch64
173146
- name: "Move binaries into the template directory"
174147
run: |
175-
mkdir -p desktopApp/flatpak/app-x86_64/
176-
mkdir -p desktopApp/flatpak/app-aarch64/
177-
tar -xvzf $(find . -type f -regex '\./artifacts-x86_64/.*\.tar.gz') -C desktopApp/flatpak/app-x86_64/ --strip-components=1
178-
tar -xvzf $(find . -type f -regex '\./artifacts-aarch64/.*\.tar.gz') -C desktopApp/flatpak/app-aarch64/ --strip-components=1
179-
- name: "Verify directory structure"
180-
run: |
181-
find desktopApp/flatpak
148+
mkdir -p desktopApp/flatpak/app-${{ matrix.arch }}/
149+
tar -xvzf $(find . -type f -regex '\./desktopApp/build/distributions/.*\.tar.gz') -C desktopApp/flatpak/app-${{ matrix.arch }}/ --strip-components=1
182150
- name: "Get Flatpak runtime version -install dependencies"
183151
run: pip install -r .github/get_flatpak_runtime_version.requirements.txt
184152
- name: "Get Flatpak runtime version"
@@ -194,13 +162,13 @@ jobs:
194162
working-directory: desktopApp/flatpak/
195163
run: |
196164
flatpak-builder --force-clean --state-dir=build/flatpak-builder --repo=build/flatpak-repo build/flatpak-target com.artemchep.keyguard.yml
197-
flatpak build-bundle build/flatpak-repo Keyguard.flatpak com.artemchep.keyguard
165+
flatpak build-bundle build/flatpak-repo "Keyguard-$(find . -type f -regex '\./desktopApp/build/distributions/.*\.tar.gz' | sed -E 's/.*-([0-9]+\.[0-9]+\.[0-9]+)-.*/\1/')-${{ matrix.arch }}.flatpak" com.artemchep.keyguard
198166
- name: 'Upload .flatpak'
199167
uses: actions/upload-artifact@v6
200168
with:
201-
name: app-linux-flatpak
169+
name: app-linux-flatpak-${{ matrix.arch }}
202170
path: |
203-
desktopApp/flatpak/Keyguard.flatpak
171+
desktopApp/flatpak/Keyguard-*.flatpak
204172
build-windows-app:
205173
runs-on: windows-latest
206174
env:
@@ -266,7 +234,6 @@ jobs:
266234
needs:
267235
- build-android-app
268236
- build-linux-app
269-
- build-linux-flatpak-app
270237
- build-macos-app
271238
- build-windows-app
272239
env:
@@ -301,10 +268,15 @@ jobs:
301268
with:
302269
name: app-linux-aarch64
303270
path: artifacts
304-
- name: "Download Linux app (flatpak)"
271+
- name: "Download Linux app (flatpak-x86_64)"
272+
uses: actions/download-artifact@v7
273+
with:
274+
name: app-linux-flatpak-x86_64
275+
path: artifacts
276+
- name: "Download Linux app (flatpak-aarch64)"
305277
uses: actions/download-artifact@v7
306278
with:
307-
name: app-linux-flatpak
279+
name: app-linux-flatpak-aarch64
308280
path: artifacts
309281
- name: "Download Windows app"
310282
uses: actions/download-artifact@v7

0 commit comments

Comments
 (0)