Im trying to package my package my app for flatpak and publish on flathub…
My app is entirely build with CICD (in github actions).
I got the flatpak to build locally, but now i want to build it into a CICD workflow.
I got at the root of my repository a “flatpak” folder containing the buildscript (build-flatpak.sh, app yaml).
The thing im confused about is: How is this supposed to function? I know that i have to fork the flathub repo and then put my .yml file there followed by a pr. From my understanding this now means that the app is available on flathup, problem being: I cant just tell the manifest to download “github.com/.../releases/lateast/linux-portable.tar.gz” for the building process, because it requires a sha hash. Please help me, i have no clue how to do it… (wget, curl, etc, all fail when i try to download the file in the build-flatpak.sh)
# yaml-language-server: $schema=https://raw.githubusercontent.com/flatpak/flatpak-builder/main/data/flatpak-manifest.schema.json --- app-id: com.myapp.example runtime: org.freedesktop.Platform runtime-version: "22.08" sdk: org.freedesktop.Sdk command: myapp separate-locales: false finish-args: - --share=ipc - --socket=fallback-x11 - --socket=wayland - --device=dri - --socket=pulseaudio - --share=network modules: - name: myapp buildsystem: simple only-arches: - x86_64 build-commands: - "./build-flatpak.sh" sources: - type: file url: http://localhost:8080/linux-flatpak.tar.gz #https://github.com/.../releases/latest/linux-flatpak.tar.gz sha256: f9a02aad918f962584989344d82edcae89609f241651c3e2c9c5ecba8eee9628 - type: dir path: ../myapp - type: file path: build-flatpak.sh
#!/bin/bash set -e set -x # No spaces in project name. projectName=myapp projectId=com.myapp.example executableName=myapp # ------------------------------- Build Flatpak ----------------------------- # # Extract portable Flutter build. mkdir -p $projectName tar -xf linux-flatpak.tar.gz -C $projectName # Copy the portable app to the Flatpak-based location. cp -r $projectName /app/ chmod +x /app/$projectName/$executableName mkdir -p /app/bin ln -s /app/$projectName/$executableName /app/bin/$executableName # Install the icon. (Omit for now, we got no svg icon) #iconDir=/app/share/icons/hicolor/scalable/apps #mkdir -p $iconDir #cp -r assets/icons/$projectId.svg $iconDir/ # Install the desktop file. desktopFileDir=/app/share/applications mkdir -p $desktopFileDir cp -r packaging/flatpak/$projectId.desktop $desktopFileDir/ # Install the AppStream metadata file. metadataDir=/app/share/metainfo mkdir -p $metadataDir cp -r packaging/flatpak/$projectId.metainfo.xml $metadataDir/