This repository contains a GitHub Actions workflow that automates the build and release process for an Android application. The workflow compiles the application, generates APK and AAB files, and creates a new GitHub release with these files attached. It is triggered by tagging a commit with a specific pattern (release/*
).
The .github/workflows/android-build-and-release.yml
file defines the CI/CD pipeline. It performs the following actions:
- Checks out the code.
- Sets up the JDK environment.
- Builds the APK and AAB files using Gradle.
- Creates a GitHub release.
- Attaches the APK and AAB files to the GitHub release.
- Android Studio project set up with Gradle.
- JDK 21 configured in the project.
- A
release
branch or appropriate branch strategy to initiate the release process.
To trigger the workflow and create a new release:
- Ensure your changes are merged into the
main
orrelease
branch (as per your project's branching strategy). - Tag the commit you want to release with a
release/*
pattern, e.g.,release/1.0.0
.
git tag release/1.0.0
git push origin release/1.0.0
- The workflow will be triggered automatically, building the application and creating a new release named after the tag, with the APK and AAB files attached.
You may need to adjust the android-build-and-release.yml
workflow file to match your project's specific requirements, such as changing the JDK version or modifying the Gradle build tasks.
This workflow uses a Personal Access Token (PAT) with repo
scope for creating releases. Store your PAT in the repository's secrets with the name PAT_FOR_RELEASES
.
Contributions to this project are welcome! Please fork the repository, make your changes, and submit a pull request.
Apache 2.0
- GitHub Actions for providing the automation platform.
- All contributors who help maintain and improve this project.
For support or questions about using this workflow, please open an issue in this repository.