Skip to content

Commit af6870a

Browse files
committed
flatpak ci
1 parent 82b647d commit af6870a

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

.github/workflows/flatpak.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
on:
2+
push:
3+
tags: [ v*.*.* ]
4+
workflow_dispatch:
5+
6+
concurrency:
7+
group: flatpak
8+
cancel-in-progress: true
9+
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
build-and-dist:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Check out repository
20+
uses: actions/checkout@v3
21+
22+
- name: Install Flatpak & Builder
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y flatpak flatpak-builder
26+
27+
- name: Add Flathub remote
28+
run: |
29+
flatpak --user remote-add --if-not-exists flathub \
30+
https://dl.flathub.org/repo/flathub.flatpakrepo
31+
# Required to pull SDK/runtime deps
32+
33+
- name: Build & run Meson dist in sandbox
34+
run: |
35+
# Perform a clean build, installing deps from Flathub into 'build' dir
36+
flatpak-builder --user \
37+
--force-clean \
38+
--install-deps-from=flathub \
39+
--repo=repo \
40+
--keep-build-dirs \
41+
build \
42+
build-aux/com.ranfdev.Geopard.Devel.json
43+
44+
# Test the build
45+
flatpak-builder --run build build-aux/com.ranfdev.Geopard.Devel.json ninja test "-C.flatpak-builder/build/Geopard-1/_flatpak_build"
46+
47+
# Spawn a shell inside the build sandbox and run `meson dist`
48+
flatpak-builder --run build build-aux/com.ranfdev.Geopard.Devel.json meson dist --no-tests "-C.flatpak-builder/build/Geopard-1/_flatpak_build"
49+
# `--run` spawns the build sandbox and executes the given command
50+
51+
- name: Upload Meson distribution artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: meson-dist
55+
path: '.flatpak-builder/build/Geopard-1/_flatpak_build/meson-dist/*.tar.xz'
56+
57+
- name: Create or update GitHub Release
58+
uses: softprops/action-gh-release@v2
59+
with:
60+
tag_name: ${{ github.ref_name }} # defaults to this if omitted
61+
name: Release ${{ github.ref_name }} # defaults to tag name if omitted
62+
files: '.flatpak-builder/build/Geopard-1/_flatpak_build/meson-dist/*.tar.xz'
63+
generate_release_notes: true # optional: auto-generate notes

0 commit comments

Comments
 (0)