Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/android_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
description: "Crate name to build Android package from"
required: true
type: string
release:
description: "Whether to build a release version"
required: true
type: boolean
Comment on lines +10 to +13
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

release is a required input but is not used anywhere in the job (the build, artifact path, and publish behavior are currently identical regardless of its value). Either make it optional with a default (e.g., false) and use it to control release-only steps, or remove the input to avoid misleading callers.

Copilot uses AI. Check for mistakes.

env:
CRATE: ${{ inputs.crate }}
Expand Down Expand Up @@ -76,3 +80,17 @@ jobs:
with:
name: ${{ env.CRATE }}.aar
path: ${{ env.ANDROID_PACKAGE_DIR }}/build/outputs/aar/${{ env.CRATE }}-release.aar

- name: Build and Publish to Maven Central
working-directory: ${{ env.ANDROID_PACKAGE_DIR }}
env:
GITHUB_TAG: ${{ github.ref_name }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.RSA_GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.RSA_GPG_PASSPHRASE }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.CENTRAL_PASSWORD }}
run: |
export VERSION_TAG=${GITHUB_TAG#v} # Remove the leading 'v'
echo "Publishing version: $VERSION_TAG"
echo "Publishing to Maven Central (USER_MANAGED - requires manual release)..."
./gradlew publishToMavenCentral
Comment on lines +84 to +96
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Maven publish step runs unconditionally, so it will execute on pull_request and on normal pushes to main as well (where github.ref_name is main). That will both fail due to missing secrets on PRs and attempt to publish an invalid version derived from a non-tag ref. Gate this step with if: inputs.release (and ideally also github.ref_type == 'tag') and only derive the version from the tag when publishing.

Copilot uses AI. Check for mistakes.
3 changes: 3 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push: # A push indicates that a PR is merged and CD should be triggered
branches:
- main
tags:
- 'v*'
Comment on lines 4 to +8
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a push.tags trigger means this workflow now runs on tag pushes as well as branch pushes. Because other jobs in this workflow treat any push as a release signal (e.g., swift_ci uses release: ${{ github.event_name == 'push' }}), tagging will unintentionally enable those release behaviors too. If the intent is to release only Android on tag pushes, tighten those release: conditions to exclude tags (or split tag-triggered release into a separate workflow).

Copilot uses AI. Check for mistakes.
pull_request: # For PRs, we run CI, which is the same as CD without the release step(s)
branches:
- main
Expand Down Expand Up @@ -96,3 +98,4 @@ jobs:
include: ${{ fromJSON(needs.setup.outputs.ffi_packages) }}
with:
crate: ${{ matrix.crate_name }}
release: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
2 changes: 1 addition & 1 deletion packages/android/algokit_algo25/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

android {
namespace = "com.example.algokit_algo25"
namespace = "io.github.algorandecosystem.algokit_algo25"
compileSdk = 36

defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion packages/android/algokit_crypto/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

android {
namespace = "com.example.algokit_crypto"
namespace = "io.github.algorandecosystem.algokit_crypto"
compileSdk = 36

defaultConfig {
Expand Down
73 changes: 33 additions & 40 deletions packages/android/algokit_transact/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,49 @@
* Learn more about Gradle by exploring our Samples at https://docs.gradle.org/8.14.2/samples
*/
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
Comment on lines 7 to 11
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI workflow now expects these Android modules to be publishable to Maven Central, but this Gradle build file still only applies the Android/Kotlin plugins and doesn't define Maven publishing/signing configuration or a version. Unless publishing is configured elsewhere, publishToMavenCentral will not exist and the release workflow will fail; add the necessary publishing plugin/configuration here (or in a shared convention plugin) to match the CI expectations.

Copilot uses AI. Check for mistakes.

android {
namespace = "com.example.algokit_transact"
compileSdk = 36
namespace = "io.github.algorandecosystem.algokit_transact"
compileSdk = 36

defaultConfig {
minSdk = 28
defaultConfig {
minSdk = 28

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
kotlinOptions {
jvmTarget = "21"
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
testOptions {
unitTests {
isIncludeAndroidResources = true
all {
it.systemProperty("jna.library.path", "src/test/resources")
}
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
kotlinOptions { jvmTarget = "21" }
testOptions {
unitTests {
isIncludeAndroidResources = true
all { it.systemProperty("jna.library.path", "src/test/resources") }
}
}
}

dependencies {
implementation("net.java.dev.jna:jna:5.14.0@aar")
// Use full JNA JAR for unit tests (includes native dispatch libraries)
testImplementation("net.java.dev.jna:jna:5.14.0")
implementation("net.java.dev.jna:jna:5.14.0@aar")
// Use full JNA JAR for unit tests (includes native dispatch libraries)
testImplementation("net.java.dev.jna:jna:5.14.0")

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.material)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
}
Loading