Skip to content

Fix GHA flatpak build by using ubuntu 24.04 (flatpak-builder 1.2.2 ->… #1019

Fix GHA flatpak build by using ubuntu 24.04 (flatpak-builder 1.2.2 ->…

Fix GHA flatpak build by using ubuntu 24.04 (flatpak-builder 1.2.2 ->… #1019

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
jobs:
pre-commit:
name: "Pre-commit hooks"
runs-on: ubuntu-latest
steps:
- name: Checkout repository.
uses: actions/checkout@v4
with:
submodules: true
- name: Setup nix.
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Use cachix.
uses: cachix/cachix-action@v15
with:
name: devenv
- name: Install devenv.sh
run: nix profile install nixpkgs#devenv
- name: Run pre-commit hooks.
run: devenv shell pre-commit -- run --all-files
build:
name: "LLVM build: Version ${{ matrix.llvm_version }}"
runs-on: ubuntu-latest
needs:
- pre-commit
strategy:
fail-fast: false
matrix:
llvm_version: [15, 16, 17, 18, 19]
steps:
- name: Checkout repository.
uses: actions/checkout@v4
with:
submodules: true
- name: Setup go.
uses: actions/setup-go@v5
with:
go-version: "stable"
cache-dependency-path: tailwrap/go.sum
- name: Vendor go dependencies.
run: go mod vendor
working-directory: src/wrapper
- name: Add KDE Neon apt repo.
run: sudo ./scripts/add-neon-apt-repo.sh
- name: Install dependencies.
run: sudo ./scripts/neon-deps.sh
- name: Add LLVM apt key.
run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
- name: Add LLVM repo.
run: sudo add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${{ matrix.llvm_version }} main"
- name: Install clang.
run: sudo apt install -y clang-${{ matrix.llvm_version }}
- name: Configure CMake project.
run: CC=clang-${{ matrix.llvm_version }} CXX=clang++-${{ matrix.llvm_version }} cmake -B build
- name: Build CMake project.
run: cmake --build build
flatpak_build:
name: Flatpak build
runs-on: ubuntu-24.04
needs:
- pre-commit
steps:
- name: Checkout repository.
uses: actions/checkout@v4
with:
submodules: true
- name: Update apt cache.
run: sudo apt-get update -yq
- name: Install flatpak-builder.
run: sudo apt-get install -yq flatpak-builder flatpak appstream
- name: Show flatpak-builder version.
run: flatpak-builder --version
- name: Install flatpak dependencies.
run: ./scripts/flatpak-deps.sh
- name: Validate manifest.
run: flatpak run --command=flatpak-builder-lint org.flatpak.Builder manifest org.fkoehler.KTailctl.yml
- name: Check external data.
run: flatpak run org.flathub.flatpak-external-data-checker --check-outdated org.fkoehler.KTailctl.yml
- name: Setup go.
uses: actions/setup-go@v5
with:
go-version: "stable"
- name: Vendor go dependencies.
run: go mod vendor
working-directory: src/wrapper
- name: Build.
run: flatpak-builder --user --force-clean build-dir org.fkoehler.KTailctl.yml
- name: Validate build.
run: flatpak run --command=flatpak-builder-lint org.flatpak.Builder builddir build-dir/
nix_build:
name: Nix build
runs-on: ubuntu-latest
needs:
- pre-commit
steps:
- name: Checkout repository.
uses: actions/checkout@v4
with:
submodules: true
- name: Setup nix.
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Vendor go dependencies.
run: nix-shell -p go --command "go mod vendor"
working-directory: src/wrapper
- name: Build with nix
run: nix build .
create_release:
if: startsWith(github.event.ref, 'refs/tags/v')
name: Create release
runs-on: ubuntu-latest
needs:
- build
- flatpak_build
- pre-commit
permissions:
contents: write
steps:
- name: Checkout repository.
uses: actions/checkout@v4
with:
submodules: true
- name: Setup go.
uses: actions/setup-go@v5
with:
go-version: "stable"
cache-dependency-path: tailwrap/go.sum
- name: Install GH CLI.
run: |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
- name: Create release.
run: ./scripts/create-release.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}