Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add GitHub Actions artifact support
This PR adds support for installing apps from GitHub Actions workflow artifacts, rather than requiring builds to be published as GitHub Releases.
This is my best attempt at a response to #102, and is the result of multiple iterations of design/re-design, considerations, and back and forth with significant help from GPT 6. While the code is written with AI assistance, this is not a "zero shot" project by any means whatsoever. I had to make many design decisions/critiques/redirections, hammer things out, and nip slop in the bud through my own review of it across several days of work on/off over the past few weeks, and Gemini Neon also did a final audit/bug check that I utilized as well.
I hope you like it, and I will definitely be using it for myself as I feel it's now finally in a state that is useable and reliable. I have also given you PR edit access as well if you wish to make any tweaks. If you want to download a test release, please use this action run only: https://github.com/xmicro/Obtainium/actions/runs/45359892982 (as older ones were previous iterations; also ignore that it's technically failed—I just never bothered configuring a signature, but the artifact is built properly). However, from my testing, I can confirm it works with APKs/XAPK/etc., simple and regex name matching for artifact upload, raw APK files, and even files inside ZIPs. And it also properly updates with new action runs as I have tested as well. If you want to test this yourself, I have a repo here I used to manually test packages against here https://github.com/xmicro/obtainium-actions-fixtures/. It also passes flutter checks here https://github.com/xmicro/Obtainium/actions/runs/45359573086.
The general scheme is: select workflow run -> select upload name (optionally filter) -> observe files (optionally filter if >1) -> save. It supports the ability to check across multiple runs as well to ensure your choice is correct. It is fully and separately configurable without interfering with the rest of Obtainium via a toggle in the menu with all other settings.
Btw, re the flutter tests, I was going to have those just be local so it wasn't part of the actual PR/merge, but I saw before making the PR that you required these, so I included them with the build itself. But sorry if I misunderstood that; I can remove them as well if needed.
See a full list of features below:
Features
Workflow selection: Choose a branch, workflow, and eligible trigger events (push, workflow dispatch, PR, etc.). Updates are sourced from successful workflow runs.
Flexible artifact matching: Select an exact artifact name, portions of unchanging text (like portions around version numbers), or regex matching to accommodate changing build names.
APK selection: Filter APK filenames independently from artifact names, with support for files directly inside an artifact or within nested ZIPs, as some GitHub projects use one over the other. Supports selecting APK, XAPK, APKM, and APKS packages.
Interactive preview: Browse recent workflow runs, see matching and nonmatching uploads to test your text selections/regex, and inspect archive contents on demand before saving the configuration.
Configuration preservation: Retain saved artifact names even when they no longer appear in recent uploads, and preserve existing GitHub Releases settings when switching modes.
Implementation considerations
API efficiency: Fetches artifact metadata in batches of up to 100, caches results, and limits searches to avoid excessive GitHub API requests.
Matching safeguards: Detects ambiguous artifact matches, warns when few matching runs are available, and excludes expired artifacts.
Download handling: Supports authenticated downloads with API keys with fallback to nightly.link where appropriate, including rate-limit handling.
Resource management: Streams archive previews to disk, supports cancellation and temporary-file cleanup, and avoids extracting APK contents just to display filenames.
Installer integration: Reuses Obtainium's existing installation and certificate-verification pipeline rather than introducing a separate installer.
Intentional design flow: Designed in a way that should hopefully make it clear how to use it, what is optional, and things to consider based on how many matches are found, etc.
Also, I know it all appearing as one commit may make it seem like it was fully AI made in one shot, but trust me, it's not XD. I just hated the ugly, ugly commit history that I would've had if I uploaded it directly as it was locally, so I wanted to keep it clean appearing for the actual pushes lol.
I realize it's quite long overall, and honestly I never intended it to be from the beginning. However, when I began realizing all of the pitfalls of having a simpler implementation, such as how many different forms developers can upload their APKs re artifacts, it felt more and more necessary to make the process as simple and straightforward for the end user, which although it ended up adding more code to the back end, I hope the efforts of which I was able to communicate through the design at least somewhat well. And this way, the user can make sure that they actually have the correct settings without having to wait for an update to realize that their app just stopped updating.