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