.github/workflows/flatpak.yml #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| tags: [ v*.*.* ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: flatpak | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-dist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v3 | |
| - name: Install Flatpak & Builder | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y flatpak flatpak-builder | |
| - name: Add Flathub remote | |
| run: | | |
| flatpak --user remote-add --if-not-exists flathub \ | |
| https://dl.flathub.org/repo/flathub.flatpakrepo | |
| # Required to pull SDK/runtime deps | |
| - name: Build & run Meson dist in sandbox | |
| run: | | |
| # Perform a clean build, installing deps from Flathub into 'build' dir | |
| flatpak-builder --user \ | |
| --force-clean \ | |
| --install-deps-from=flathub \ | |
| --repo=repo \ | |
| --keep-build-dirs \ | |
| build \ | |
| build-aux/com.ranfdev.Geopard.Devel.json | |
| # Test the build | |
| flatpak-builder --run build build-aux/com.ranfdev.Geopard.Devel.json ninja test "-C.flatpak-builder/build/geopard/_flatpak_build" | |
| # Spawn a shell inside the build sandbox and run `meson dist` | |
| flatpak-builder --run build build-aux/com.ranfdev.Geopard.Devel.json meson dist --no-tests "-C.flatpak-builder/build/geopard/_flatpak_build" | |
| # `--run` spawns the build sandbox and executes the given command | |
| - name: Upload Meson distribution artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: meson-dist | |
| path: '.flatpak-builder/build/geopard/_flatpak_build/meson-dist/*.tar.xz' | |
| - name: Create or update GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} # defaults to this if omitted | |
| name: Release ${{ github.ref_name }} # defaults to tag name if omitted | |
| files: '.flatpak-builder/build/geopard/_flatpak_build/meson-dist/*.tar.xz' | |
| generate_release_notes: true # optional: auto-generate notes |