Code Monkey home page Code Monkey logo

flatpak-remote's Introduction

flatpak-remote

flatpak-remote is a template for creating Flatpak remotes for single projects using GitHub Workflow. It is based on gasinvein/proton-flatpak. No additional hardware or money is required.

Disclaimer! This project is extremely hacky! We have done our best to make the setup as easy as possible. However, this project is new and can be easily disrupted. It's also a lot more complex and time consuming to setup than publishing it on Flathub. Updating to a newer version/commit of the template may require manual intervention on the workflow.

Features

  • Additional branches: this is useful for projects that do not comply with Flathub's guidelines, e.g. if your project has no tagged releases, icons, etc. Sometimes developers want more than two branches. Flathub only allows stable and beta branches, so a third branch in Flathub would be literally impossible unless Flathub lets us create additional branches. This project helps the developers who want to have a third branch, be it nightly or other, while keeping the same App ID.
  • f-e-d-c support: flatpak-external-data-checker (f-e-d-c) can be used in the template. However, you will still have to manually make changes to the manifest so it can automatically update dependencies and the project itself.
  • Extensible: since this is only a template, it can be extended to do a lot more things, like make flatpak-builder-tools automatically update itself, which is unsupported on Flathub.

What doesn't work

At the moment, we've found two things that do not work:

  • extra-data, see flatpak/flatpak#3790.
  • History log, running flatpak remote-info --log $REMOTE $APP_ID will give an error.

Setting up

As written previously, this setup is more complex than publishing on Flathub.

Requirements

  • Full access to the repository and probably organization too.
  • Understanding with Flatpak (or not, if you want to learn).

Preparing

Before starting, create a new personal access token (PAT). Generate a new token, and copy the token in a safe space. The token should start with ghp. Do not share the token with anyone!

  1. Since this is a template, you can press on the green Use this template button at the top of the page. It will ask you to type in a repository name. You are free to choose the name of the repository.
  2. Before you create the repository from the template, check Include all branches box. This template sets up a GitHub page that is located in the gh-pages branch. This is required to have a successful Flatpak remote.
    • If you forgot to check that branch, create a new branch called gh-pages, then create a new index directory and an empty file called static inside the directory.
  3. Press on the green Create repository from template button to create your new repository.
    • Optional: as soon as you create the repository, a new action will start running. You can manually turn it off in the Actions tab.
  4. Go to the settings of the repository, press on the Secrets tab.
  5. Press on the New repository secret
  6. Type PAT inside Name, and paste your PAT inside Value.

For the steps below, I advise to clone the repository and work locally, or press the dot (.) button to open GitHub's IDE.

Adding/Creating manifest and dependencies

If you want to use already existing manifest and dependencies in Flathub, you can copy and paste its content to your repository.

If you have to create a manifest, refer to the Flatpak documentation or to the Flatpak Building Guide (video).

Editing workflows

Editing workflows may require repetition. flatpak.yml is used to build and push Flatpak packages to the remote.

In the env: list, these are the variables that will need to be changed. The comments explain what they are/do. You can edit them accordingly.

Once done, push the changes to the repository and it should start building.

Allowing access to your container image

Finally, in order to allow users the ability to download packages from your Flatpak repository you must allow everyone read access to your container image.

You accomplish this by doing the following:

  1. On GitHub, navigate to the main page of your user account.
  2. In the top right corner of GitHub, click your profile photo, then click Your profile.
  3. On your profile page, in the top right, click Packages.
  4. From here you could change the visibility of your container to allow everyone to read your container.

flatpak-remote's People

Contributors

rany2 avatar theevilskeleton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flatpak-remote's Issues

Multiple packages on the same remote

More than an issue, I just wanted to share how I made a multi-package flatpak remote source using this project as base.

First I created a repo that would work as a hub for all the other projects [0]. This repository has a folder with all of the OCI descriptions from github and a workflow that mixes them and creates the file to host on gh-pages.

On each of the source projects, I created a workflow that builds the flatpak OCI image for the project [1], then it pushes them to the github OCI repo the same way this project does [2]. Then, instead of updating the local gh-pages branch of the project, I send a commit to update it's respective OCI description file on the hub repo [3].

For all of this to work I also had to create and install the respective keys for the projects to push the packages into the OCI repository and to update the description files into the hub repo... but I won't go into details about this process here.

I thought on upstreaming this workflow, but it didn't made sense since I changed the structure of the project a lot for this to work. I hope that at the very least this helps :)

[0] https://github.com/grillo-delmal/inochi2d-flatpak-devtest
[1] https://github.com/gasinvein/proton-flatpak/blob/master/.github/workflows/flatpak.yml#L18-L70
[2] https://github.com/gasinvein/proton-flatpak/blob/master/.github/workflows/flatpak.yml#L102-L132
[3] https://github.com/gasinvein/proton-flatpak/blob/master/.github/workflows/flatpak.yml#L134-L186

Make workflows easier to manage

Editing two workflows is a PITA. Making a file that can echo in the workflow and auto update will be very useful and much more convenient.

New remotes asking for login credentials

❯ flatpak install psst com.github.jpochyla.Psst//nightly
Looking for matches…

com.github.jpochyla.Psst permissions:
    ipc      network     fallback-x11     pulseaudio     wayland     x11
    dri



        ID                             Branch        Op       Remote      Download
 1.     com.github.jpochyla.Psst       nightly       i        psst        < 4.2 MB

Proceed with these changes to the user installation? [Y/n]: 
Login required remote psst (realm https://ghcr.io/)
User: 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.