From e30fdd2963f3f990d6468b4259389fae76922ad5 Mon Sep 17 00:00:00 2001 From: Chris Keller Date: Sun, 23 May 2021 14:18:50 -0600 Subject: [PATCH] Try a flatpak builder action --- .github/workflows/release.yml | 35 +++++++++++++++++++---------------- .gitignore | 6 +++++- Makefile | 5 +++-- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0aff57d..6437e2e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,9 +10,12 @@ jobs: release-linux: name: Build the Linux release artifact runs-on: [ self-hosted, linux, x64 ] + # Trust that the runner has an sbuild chroot + # sudo apt install autorevision sbuild-debian-developer-setup debhelper dh-golang + # newgrp sbuild + # sudo sbuild-debian-developer-setup --suite=stable steps: - # Trust that the runner has an sbuild chroot - name: Remove old release artifacts run: rm -f ../kel-agent_* @@ -36,9 +39,12 @@ jobs: release-rpi: name: Build the Raspberry Pi release artifact runs-on: [ self-hosted, linux, ARM ] + # Trust that the runner has an sbuild chroot: + # sudo apt install autorevision sbuild-debian-developer-setup debhelper dh-golang + # newgrp sbuild + # sudo sbuild-debian-developer-setup --suite=stable steps: - # Trust that the runner has an sbuild chroot - name: Remove old release artifacts run: rm -f ../kel-agent_* @@ -61,31 +67,28 @@ jobs: release-flatpak: name: Build the Flatpak release artifact - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest + container: + image: bilelmoussaoui/flatpak-github-actions:freedesktop-20.08 + options: --privileged steps: - - name: Install Flatpak - run: | - sudo apt install flatpak flatpak-builder - sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - flatpak install --user flathub runtime/org.freedesktop.Platform/x86_64/20.08 - flatpak install --user flathub runtime/org.freedesktop.Sdk/x86_64/20.08 - flatpak install --user flathub runtime/org.freedesktop.Sdk.Extension.golang/x86_64/20.08 - - name: Checkout code uses: actions/checkout@v2 - - name: Test - run: make test - - name: Build Flatpak - run: make flatpak + uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v3 + with: + bundle: kel-agent.flatpak + manifest-path: flatpak/radio.k0swe.kel_agent.Kel_Agent.yml + branch: main + cache-key: flatpak-builder-${{ github.sha }} - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: - files: flatpak/kel_agent.flatpak + files: kel-agent.flatpak env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index a4cc783..11ba10d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -# Compiled binary +# Compiled assets kel-agent kel-agent.exe kel-agent.pkg @@ -7,6 +7,10 @@ win/kel-agent.msi win/kel-agent.wixobj win/kel-agent.wixpdb autorevision.cache +repo/ +.flatpak-builder/ +kel-agent.flatpak +flatpak_app/ .idea/ diff --git a/Makefile b/Makefile index 1d89b1d..6c62c12 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ VERSION = $(shell < debian/changelog head -1 | egrep -o "[0-9]+\.[0-9]+\.[0-9]+") GITCOMMIT = $(shell git rev-parse --short HEAD 2> /dev/null || true) -GENERATED = kel-agent kel-agent_*.pkg win/kel-agent_*.msi win/kel-agent.wixobj autorevision.cache ../kel-agent_* ../*.deb +GENERATED = kel-agent kel-agent_*.pkg win/kel-agent_*.msi win/kel-agent.wixobj autorevision.cache \ + ../kel-agent_* ../*.deb repo/ .flatpak-builder/ kel-agent.flatpak flatpak_app/ .PHONY: all all: kel-agent @@ -68,4 +69,4 @@ win-package: kel-agent .PHONY: clean clean: - rm -f $(GENERATED) + rm -rf $(GENERATED)