Skip to content

Commit f70e6e4

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

File tree

1 file changed

+55
-13
lines changed

1 file changed

+55
-13
lines changed

.github/workflows/flatpak.yml

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,61 @@
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: Install Flatpak & Builder
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install -y flatpak flatpak-builder
23+
24+
- name: Add Flathub remote
25+
run: |
26+
flatpak --user remote-add --if-not-exists flathub \
27+
https://dl.flathub.org/repo/flathub.flatpakrepo
28+
# Required to pull SDK/runtime deps
29+
30+
- name: Build & run Meson dist in sandbox
31+
run: |
32+
# Perform a clean build, installing deps from Flathub into 'build' dir
33+
flatpak-builder --user \
34+
--force-clean \
35+
--install-deps-from=flathub \
36+
--repo=repo \
37+
--keep-build-dirs \
38+
build \
39+
com.ranfdev.DistroShelf.json
40+
41+
# Test the build
42+
flatpak-builder --run build com.ranfdev.DistroShelf.json ninja test "-C.flatpak-builder/build/distroshelf/_flatpak_build"
43+
44+
# Spawn a shell inside the build sandbox and run `meson dist`
45+
flatpak-builder --run build com.ranfdev.DistroShelf.json meson dist --no-tests "-C.flatpak-builder/build/distroshelf/_flatpak_build"
46+
# `--run` spawns the build sandbox and executes the given command
47+
48+
- name: Upload Meson distribution artifact
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: meson-dist
52+
path: '.flatpak-builder/build/distroshelf/_flatpak_build/meson-dist/*.tar.xz'
53+
54+
- name: Create or update GitHub Release
55+
uses: softprops/action-gh-release@v2
56+
if: github.ref_type == 'tag'
57+
with:
58+
tag_name: ${{ github.ref_name }} # defaults to this if omitted
59+
name: Release ${{ github.ref_name }} # defaults to tag name if omitted
60+
files: '.flatpak-builder/build/distroshelf/_flatpak_build/meson-dist/*.tar.xz'
61+
generate_release_notes: true # optional: auto-generate notes

0 commit comments

Comments
 (0)