meson dist in CI #12
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: | |
| branches: [ ci ] | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: flatpak | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-dist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v3 | |
| - name: Cache Flatpak SDK/runtime | |
| uses: actions/cache@v3 | |
| with: | |
| path: repo | |
| key: flatpak-${{ runner.os }}-${{ hashFiles('**/com.ranfdev.DistroShelf.json') }} | |
| - name: Install Flatpak & Builder | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y flatpak flatpak-builder | |
| # flatpak-builder is a wrapper around flatpak build that automates fetching sources, | |
| # initializing the build, building modules, and exporting the result | |
| - 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 \ | |
| build \ | |
| com.ranfdev.DistroShelf.json | |
| # Spawn a shell inside the build sandbox and run `meson dist` | |
| flatpak-builder --run build com.ranfdev.DistroShelf.json meson dist | |
| # `--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: '*.tar.gz' | |
| # Uploads any .tar.gz produced by meson dist; supports wildcards and directories |