Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for building Linux AppImage binary. #133

Closed

Conversation

antoinevg
Copy link
Member

@antoinevg antoinevg commented Jul 16, 2024

This PR adds support for building the Linux AppImage binary during CI workflow.

Overview

The workflow file is .github/workflows/appimage.yml and is structured as follows:

Step 1: Checks if the docker container exists or needs to be updated, if not, go to Step 3.

Step 2: Builds the appimage/docker/Dockerfile for compiling packetry and creating an appimage.

Step 3: Runs pretty much the same workflow as the rust.yml workflow to compile & test packetry inside the docker container.

Step 4: Invokes a custom action appimage/action.yml to build the Linux AppImage binary.

Step 5: Uploads the Linux AppImage binary artifact.

Docker Image Notes

  • Docker image has two args:
    • GTK_VERSION sets the version of GTK sources to be downloaded and built.
    • NODE_VERSION sets the version of node to install for the use of Swatinem/rust-cache@v2
  • I took great care to build the image with minimal use of USER root but it turns out that was wasted because
    GitHub Actions does not support containers running as anything but root:
    • Worse than that, it overrides $HOME for the root user with /github/home which of course causes all the
      things to fail.
    • But even more worse than that, if you have the bright idea to provide /github/home in your container, GitHub actions will happily delete the contents.
    • Workaround is a combo of overriding the containers /etc/passwd to change root home dir to /github/home during the container build and then copying everything you need into $HOME before running the workflow.
    • Also see: Error: EACCES: permission denied in container on self hosted Linux runner  actions/checkout#1014
  • Docker images are stored on ghcr.io and have private visibility.
  • Docker images are named & tagged according to <repo>-gtk-<gtk-version>:<branch> so we don't run into issues when working on branches or PR's.

Outstanding issues

  • Licenses
  • Configure DOCKER_REGISTRY_TOKEN for the packetry repo.
  • Desktop Icon File

@antoinevg antoinevg changed the title Add icon and desktop file for linux appimage binary. Add support for building Linux AppImage binary. Jul 16, 2024
@antoinevg antoinevg force-pushed the antoinevg/linux-appimage branch 5 times, most recently from 68eb195 to 8abe941 Compare July 23, 2024 14:37
@antoinevg antoinevg force-pushed the antoinevg/linux-appimage branch 2 times, most recently from 8abe941 to 2e5a432 Compare July 23, 2024 14:56
@antoinevg antoinevg force-pushed the antoinevg/linux-appimage branch from 2e5a432 to c0dab44 Compare July 23, 2024 15:53
@antoinevg antoinevg force-pushed the antoinevg/linux-appimage branch 3 times, most recently from a6fd72b to 58e33e2 Compare July 24, 2024 09:50
@antoinevg antoinevg force-pushed the antoinevg/linux-appimage branch from 9475402 to 1c1c236 Compare July 24, 2024 12:54
@antoinevg
Copy link
Member Author

antoinevg commented Jul 24, 2024

Closed in favour of #140 so it can actually be tested.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant