Skip to content

Commit

Permalink
Try a flatpak builder action
Browse files Browse the repository at this point in the history
  • Loading branch information
xylo04 committed May 23, 2021
1 parent 638e245 commit e30fdd2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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_*

Expand All @@ -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_*

Expand All @@ -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 }}

Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compiled binary
# Compiled assets
kel-agent
kel-agent.exe
kel-agent.pkg
Expand All @@ -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/

Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -68,4 +69,4 @@ win-package: kel-agent

.PHONY: clean
clean:
rm -f $(GENERATED)
rm -rf $(GENERATED)

0 comments on commit e30fdd2

Please sign in to comment.