Skip to content

ci: trigger maven release for new tags#337

Open
joe-p wants to merge 5 commits intomainfrom
ci/maven
Open

ci: trigger maven release for new tags#337
joe-p wants to merge 5 commits intomainfrom
ci/maven

Conversation

@joe-p
Copy link
Copy Markdown
Collaborator

@joe-p joe-p commented Mar 22, 2026

For now releases will be triggered manually. Any time a new tag is push there will be a maven release

Based on https://github.com/michaeltchuangllc/algokit-walletsdk-kmp/blob/main/.github/workflows/publish-sdk-maven.yml

@joe-p joe-p requested a review from lempira as a code owner March 22, 2026 20:26
Copilot AI review requested due to automatic review settings March 22, 2026 20:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates CI/CD to trigger Android Maven Central publishing on version tag pushes and aligns Android library namespaces with the intended io.github.algorandecosystem.* package naming.

Changes:

  • Trigger .github/workflows/ci_cd.yml on v* tag pushes and pass a release flag to the Android reusable workflow for tag-based releases.
  • Extend .github/workflows/android_ci.yml with a Maven Central publish step and a new release input.
  • Update Android module namespace values from com.example.* to io.github.algorandecosystem.*.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
packages/android/algokit_transact/build.gradle.kts Updates Android namespace to the intended publishable package domain.
packages/android/algokit_crypto/build.gradle.kts Updates Android namespace to the intended publishable package domain.
packages/android/algokit_algo25/build.gradle.kts Updates Android namespace to the intended publishable package domain.
.github/workflows/ci_cd.yml Adds tag triggers and wires release signal for Android releases on tags.
.github/workflows/android_ci.yml Adds release input and attempts to publish artifacts to Maven Central.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +84 to +96
- 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
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.
Comment on lines +10 to +13
release:
description: "Whether to build a release version"
required: true
type: boolean
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.
Comment on lines 4 to +8
push: # A push indicates that a PR is merged and CD should be triggered
branches:
- main
tags:
- 'v*'
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.
Comment on lines 7 to 10
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
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.
@michaeltchuang
Copy link
Copy Markdown
Member

michaeltchuang commented Mar 22, 2026

@joe-p you need some sort of mavenPublishing or maven node block too for each of the packages in build.gradle.kts...i think that's what copilot is also referring to

example
https://github.com/michaeltchuangllc/algokit-walletsdk-kmp/blob/main/wallet-sdk-core/build.gradle.kts#L291

also are we merging algo25 into crypto package or keeping it separate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants