Skip to content

Commit 60fd4f8

Browse files
committed
meson dist in CI
1 parent 16855ae commit 60fd4f8

File tree

1 file changed

+52
-13
lines changed

1 file changed

+52
-13
lines changed

.github/workflows/flatpak.yml

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,58 @@
11
on:
22
push:
3-
branches: [main]
3+
branches: [ ci ]
44
pull_request:
5-
name: CI
5+
workflow_dispatch:
6+
7+
concurrency:
8+
group: flatpak
9+
cancel-in-progress: true
10+
611
jobs:
7-
flatpak:
8-
name: "Flatpak"
12+
build-and-dist:
913
runs-on: ubuntu-latest
10-
container:
11-
image: bilelmoussaoui/flatpak-github-actions:gnome-nightly
12-
options: --privileged
14+
1315
steps:
14-
- uses: actions/checkout@v4
15-
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
16-
with:
17-
bundle: distroshelf.flatpak
18-
manifest-path: com.ranfdev.DistroShelf.json
19-
cache-key: flatpak-builder-${{ github.sha }}
16+
- name: Check out repository
17+
uses: actions/checkout@v3
18+
19+
- name: Cache Flatpak SDK/runtime
20+
uses: actions/cache@v3
21+
with:
22+
path: repo
23+
key: flatpak-${{ runner.os }}-${{ hashFiles('**/com.ranfdev.DistroShelf.json') }}
24+
25+
- name: Install Flatpak & Builder
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y flatpak flatpak-builder
29+
# flatpak-builder is a wrapper around flatpak build that automates fetching sources,
30+
# initializing the build, building modules, and exporting the result
31+
32+
- name: Add Flathub remote
33+
run: |
34+
flatpak --user remote-add --if-not-exists flathub \
35+
https://dl.flathub.org/repo/flathub.flatpakrepo
36+
# Required to pull SDK/runtime deps
37+
38+
- name: Build & run Meson dist in sandbox
39+
run: |
40+
# Perform a clean build, installing deps from Flathub into 'build' dir
41+
flatpak-builder --user \
42+
--force-clean \
43+
--install-deps-from=flathub \
44+
--repo=repo \
45+
--keep-build-dirs \
46+
build \
47+
com.ranfdev.DistroShelf.json
48+
49+
# Spawn a shell inside the build sandbox and run `meson dist`
50+
flatpak-builder --run build com.ranfdev.DistroShelf.json meson dist "-C.flatpak-builder/build/distroshelf/_flatpak_build"
51+
# `--run` spawns the build sandbox and executes the given command
52+
53+
- name: Upload Meson distribution artifact
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: meson-dist
57+
path: '.flatpak-builder/build/distroshelf/_flatpak_build/meson-dist/*.tar.gz'
58+
# Uploads any .tar.gz produced by meson dist; supports wildcards and directories

0 commit comments

Comments
 (0)