-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[github actions] Add a simple and easy-to-use CI build process. #3921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
In order to prove the build is a user will, there must be some user action in place (or better actions) |
|
Hello, Originally, the APK was uploaded to GitHub artifacts. However, since the repository is public, anyone who logs into a GitHub account (any account) can still download the files—even if they are not the repository owner. This raises potential concerns about violating medical regulations. (Initial testing assumed that artifacts couldn’t be downloaded without logging in.) To address this, I made a modification and moved the APK upload to Dropbox. A new DROPBOX_ACCESS_TOKEN needs to be added to the repository secrets to authenticate the upload process. This change also preserves the flexibility to support additional cloud storage providers in the future. With the APK now hosted on cloud storage, the AAPS main program can be designed to fetch updated versions directly from the cloud, making version updates more convenient. Thank you! |
Best would be only offer to download without storing anywhere |
|
Hello, Please see if option 2 would work. |
|
ad 1) this would force use PC to unzip the file (I don't believe most people are able to do it on phone) |
Hello, Here are my replies:
I’m planning to use a third-party file manager from Google Play to handle this task (a note about this will be included in the documentation in the future): I’ve also recorded a short video demonstrating the process. Users can easily extract the zip file and install the APK (the part showing the password has been excluded from the video): If we use GitHub Actions artifacts for delivery, the entire update process could be completed directly on a mobile device.
GitHub Actions artifacts become unavailable once the specified retention period expires. (Since the minimum retention is one day, the files were still accessible when you checked today.) After one day, the system will display a message like the one below. If GitHub allows shorter retention periods in the future (e.g., 1 hour), would you consider using artifacts for temporary storage?
I’d like to hear your thoughts. Thank you again for your reply. |
|
with google drive we could let apk there because it's accessible only by owner. And it could be apk backup as well |
|
I vote for Google drive as default location for storage as all users will have access to this by having Google account on their android device from before. Dropbox on the other hand is something that will require another step for many as it doesn't automatically follow a Google account. I really like the concept of this PR as it the way I understand it will make it less complicated and also not require a PC / Mac in order to build AAPS. 👍👌 |
Hello!I’ve now updated the system to upload APKs to Google Drive. Below are the setup steps for first-time use: 🔧 First-Time Setup1. Create a Project in Google Cloud
2. Basic OAuth SetupThe URL for Step 5 is: https://developers.google.com/oauthplayground/ Step 11 lets you copy the CLIENT SECRETS. You can copy it to a notepad first — you’ll need it later when setting things up on OAuth Playground and GitHub.
3. Get a Refresh Token
In Step 7, please select your own Google account. 4. Add Secrets to GitHubGo to your GitHub project: Add these secrets: 🔑 Keystore SetupVisit https://aaps-ci.duckdns.org:8443/. This is a one-time tool to help you prepare your keystore ( Option 1: You don’t have a JKS yet
Option 2: You already have a JKS
Go to your GitHub project:
Add these secrets: 🚀 Start BuildingEvery time you want to build:
The system will check:
If there are errors, you will see detailed reasons here. 📦 OutputAfter about 8 minutes, your APKs will be uploaded to your Google Drive:
✅ All steps can be done on your phone — no PC or Mac required! I will add common error messages later when this is published on the AAPS Docs. |
|
Since the steps to use each person’s own Google OAuth2 credentials are too many, I’m currently exploring some ideas to simplify the process—so for now, I’ve changed it to a draft. |
|
Hello, Option 1: Option 2: Then, build the AAPS APK. Support Website: AAPS-CI Preparation When officially released, we will add subtitles to make it even clearer. |
|
👍 it seems to be pretty straightforward |
|
@Angus-repo support website is down ..... can this be integrated to wiki/github/... or does it need https server? |
Hello, I have just tested the support website, and it is currently operating normally. However, since the server is deployed in Asia, it only takes about 0.5 seconds to respond locally. Accessing it from Europe or the Americas takes longer, around 3 to 5 seconds, which might cause users to mistakenly think the server is down (they may need to try a few more times). This support website uses Java Keytool to generate a JKS file, and therefore requires a Java server. I will first provide an alternative solution for Option 2, allowing you to complete the setup without relying on the support website. The steps are as follows: First, visit Then, go to your GitHub Action fork: Set up the required parameters for the keystore. After that, continue with the Google Drive authorization steps shown in the Option 2 video: First, install Google Play File Manager Go to GitHub Releases Download aaps-ci-auth.html , then use File Manager on your phone to open aaps-ci-html and allow aaps-ci from GitHub Actions to upload to your Google Drive. note: You must use a file manager to open aaps-ci-auth.html. This will launch a temporary local server on your phone to receive the Google OAuth2 refresh token. The newly added Earlier, I found a pure JavaScript solution that can generate a PKCS#12 file, which can replace the server-side JKS generation process. This means I can merge the two support pages into one, using a single pure frontend webpage. Users will then be able to download it directly from the GitHub Releases without worrying about website connection issues. I will prepare a new version of the support page accordingly. As for the GitHub Actions part (aaps-ci), it has already been completed, and you can proceed with testing using Option 2. |
|
Hello, AAPS-CI Option 1 – Generate JKShttps://youtube.com/shorts/Z8aSEXFqBBc?feature=share AAPS-CI Option 2 – Upload Existing JKSAAPS-CI – Run Workflowhttps://youtube.com/shorts/7en4SF9bt-E?feature=share Support Websitehttps://github.com/Angus-repo/aaps-ci-preparation/releases/latest |
|
When I test I get Run if [ -n "" ]; then https://github.com/TestManMars/AndroidAPS/actions/runs/14856835932/job/41712073439 Did i miss something? |
Hello, Support Website: aaps-ci-preparation There are two setup options available—please choose one based on your needs: AAPS-CI Option 1 – Generate JKS AAPS-CI Option 2 – Upload Existing JKS After the setup, you can directly use GitHub Actions to build the APK. |
|
Hello @MilosKozak , Please refer to the explanation below: PR reference types include two options:
merge:
|
|
When i download https://github.com/Angus-repo/aaps-ci-preparation/releases/tag/release-v1.1.0 and run docker build -t myapp . I get => ERROR [3/3] COPY target/aaps-ci-preparation-*.jar app.jar 0.0s
Dockerfile:53 | WORKDIR /app
|
Your steps are incorrect (you don’t need Docker, just download aaps-ci-preparation.html). AAPS-CI Option 1 – Generate JKS AAPS-CI Option 2 – Upload Existing JKS |
When you open the webpage using a file manager, a temporary local server is started on your phone. If there's no activity for a while, the local server will shut down, which is why you're seeing the screen in your screenshot. Please reopen your webpage using the file manager and start again from the "Start Auth" step. |
|
can you add an error for the user in the html file so its clear when the server has shut down and that they have to restart the server? |
|
When the local server is not running, you won't be able to see the HTML content (as shown in your screenshot), so it's not possible to show a message indicating that the server isn't running. As mentioned earlier in this thread, we will add usage steps and common issues in the future at: |
|
Hello everyone, I need some testers to help with testing. Please fork the following repository first: Then follow the steps described here: I appreciate any help from testers. If you encounter any issues, feel free to leave a comment here. Thank you all! |
|
I succeeded~ Thank you author |
|
|
I have followed the building process from Angus-repo and have successed to produce the updated AAPS apk . This apk really work without any problems. Thanks for Angus-repo. |
|
|
Hi Everyone, followed the AAPS-CI build process from Angus' repo and built latest apk - this will be a game-changer for most people. Also built another apk with cherry-picking commits 6153bc4 & 39dd2e6 related to issue 4027 (Android 16) and after 15h have now successfully initialized a new pod. Thank you to all involved ! ! ! References: |
|
can you prepare documentation for this? |
I have submitted the document. Kindly review it. |
|
|
is it possible to host html within docs? |
Hello, Currently, the Google OAuth2 authorization flow requires invoking a specific local web page (such as 127.0.0.1 or localhost), so it cannot be embedded or hosted within Read the Docs. |
|
isn't the page downloaded on click? then it can be downloaded from rtd. Or there is more files needed? |
Hello, Please review. |
|
Test successful, thanks to Angus for the tutorial. |




























Hello,
As mobile devices have become more widespread, many people no longer have access to a computer to build APKs. Therefore, I’m providing a GitHub Actions-based CI build process. I searched through Discord and noticed some users have also suggested adding GitHub Actions, so I’m submitting this PR for your review.
This CI setup only requires four Repository Secrets (including the JKS) to function.

The generated build artifacts can only be downloaded by the GitHub account owner, so it does not violate any medical regulations.
If you approve this PR, I will also update the instructions at
https://androidaps.readthedocs.io/en/latest/SettingUpAaps/BuildingAaps.html to include usage documentation.
Currently, this GitHub Actions workflow is automatically triggered whenever there’s a push, merge, or update branch(from sync fork) to the master or main branch. After about 8 minutes, it will generate fullRelease builds for both the app and wear modules.
Other build variants are currently set up to be triggered manually, allowing users to choose and build different versions freely.

Once the build is complete, the artifacts can be downloaded under the Actions > Artifacts section.

Thank you.