Skip to content

[FEATURE](ci) Add reusable CodeArtifact publish composite actions#25

Merged
John McCall (lowlydba) merged 8 commits into
mainfrom
lowlydba/scala-codeartifact-actions
Jun 9, 2026
Merged

[FEATURE](ci) Add reusable CodeArtifact publish composite actions#25
John McCall (lowlydba) merged 8 commits into
mainfrom
lowlydba/scala-codeartifact-actions

Conversation

@lowlydba

@lowlydba John McCall (lowlydba) commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Centralizes three composite GitHub Actions under .github/actions/ so any OvertureMaps repo publishing Maven/Scala artifacts to AWS CodeArtifact can reuse them. This is Phase 1 of generalizing the publish pipeline — extracted from overture-matchers, which will be repointed at these central actions in a parallel PR (overture-matchers#287).

Closes #26.
Part of OvertureMaps/ops-team#384 (reference, not Closes — multiple PRs span this issue).

Actions added

Action Purpose
setup-codeartifact Assumes an IAM role via OIDC, acquires a CodeArtifact token, writes Maven settings.xml. Echoes CodeArtifact metadata (domain/owner/repo/region + composed repository-url) as outputs for clean piping. Generic name kept (a pip/Python split may come later).
publish-maven-to-codeartifact Builds a Maven project from source and publishes it. Handles JDK setup + auth internally. Supports a subdirectory project via working-directory.
mirror-maven-jar Idempotently mirrors a single public JAR into CodeArtifact (skips if the version already exists).

Notable details

  • setup-codeartifact outputs — emits codeartifact-domain, codeartifact-domain-owner, codeartifact-repository, aws-region, and a fully-composed repository-url, so downstream steps pipe from one source of truth instead of re-specifying CA metadata. The auth token is deliberately not output — it stays in settings.xml.
  • working-directory inputpublish-maven-to-codeartifact can publish a project in a subdirectory (default .); threaded through setup-java paths and the mvn steps.
  • version input / dev-publish support — when set, the pom version is overridden via mvn versions:set and the build runs with -Denv=dev; when empty, the release version is published unchanged (-Denv=release). Folded in from overture-matchers.
  • Naming — both project-specific actions carry the maven qualifier (publish-maven-to-codeartifact, mirror-maven-jar); publish is the org's key verb for this pipeline (mvn deploy remains internally as the plugin name).
  • Self-referential @main — inside a composite action uses: ./... resolves against the caller's checkout, so publish-maven-to-codeartifact references OvertureMaps/workflows/.github/actions/setup-codeartifact@main by full path (with a zizmor: ignore[unpinned-uses] comment). This @main will be tightened to a commit SHA in a follow-up once merged.
  • Action pinning — this repo SHA-pins first-party actions, so configure-aws-credentials7474bc4... (v4.3.1) and setup-javac1e3236... (v4.8.0). whelk-io/maven-settings-xml-action was already SHA-pinned upstream (# v22).

Validation

  • All three action.yml files parse as valid YAML.
  • zizmor --persona=pedantic (and auditor) report no findings (2 justified inline ignores: the self-referential @main, and the archived-but-SHA-pinned whelk-io action).
  • run: blocks use env-var indirection (template-injection-safe), and the CodeArtifact token is passed via a masked step output rather than $GITHUB_ENV.
  • Actions cannot be executed here (require AWS OIDC), so static validation is the bar.

Review feedback addressed

  • Corrected the setup-codeartifact "token boundary" docs/comment (masked step output → settings.xml, not $GITHUB_ENV).
  • aws-region marked required: false (it has a default) to match repo convention.
  • mirror-maven-jar now enforces jar-url/jar-path mutual exclusivity with a fail-fast validation step, and documents the JDK + Maven runner prerequisite.

Each action folder includes a README documenting purpose, inputs/outputs, and usage in the repo's existing Diátaxis style.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Extract three composite actions from overture-matchers for org-wide reuse:

- setup-codeartifact: OIDC role assumption, token acquisition, Maven
  settings.xml generation. Token passed via masked step output instead of
  GITHUB_ENV to avoid exposing it to unrelated steps.
- deploy-maven-to-codeartifact: builds and publishes a Maven project; adds a
  version input for dev-publish (dev/release) support. References
  setup-codeartifact by full repo path (self-referential @main) since composite
  ./ paths resolve against the caller's checkout.
- mirror-maven-jar: idempotently mirrors a public JAR into CodeArtifact.

All run blocks use env-var indirection to satisfy zizmor template-injection;
first-party actions SHA-pinned to match repo convention.

Part of OvertureMaps/ops-team#384

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
Copilot AI review requested due to automatic review settings June 9, 2026 19:32
@lowlydba John McCall (lowlydba) requested a review from a team as a code owner June 9, 2026 19:32
@overture-projection

overture-projection Bot commented Jun 9, 2026

Copy link
Copy Markdown

Overture PRojection Review

Centralizes three composite GitHub Actions for Maven/Scala artifact publishing to AWS CodeArtifact, with clear documentation and static validation.

✅ Checks Passed

  • README for mirror-maven-jar is clear, accurate, and follows Diátaxis style.
  • Inputs, outputs, and prerequisites are well-documented.
  • Mutual exclusivity of jar-url and jar-path is explained, with fail-fast validation described.
  • Pinning guidance for action usage is included.
  • No broken links or ambiguous instructions.

🚩 Flags

  • .github/actions/mirror-maven-jar/action.yml, .github/actions/publish-maven-to-codeartifact/README.md, .github/actions/publish-maven-to-codeartifact/action.yml, .github/actions/setup-codeartifact/README.md, .github/actions/setup-codeartifact/action.yml: Not reviewed due to diff size. Recommend breaking into smaller PRs for focused review and easier validation.

❓ Open Questions

  • None from the visible README content.

Context Files

  • Org conventions and process are followed (linked issues present, MIT license, clear documentation).
  • No container or code consistency issues visible in the reviewed file.

If the non-reviewed files contain new code logic or workflows, ensure tests and error handling are present, and that AWS credentials are not hardcoded. For future PRs, splitting composite actions and their docs into separate PRs will streamline review and integration.

…smatch

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
…rectory input

- Align the action's folder name with the org's 'publish' key verb (the
  display name already read 'Publish'; mvn deploy stays as the plugin name).
- Add an optional working-directory input (default '.') so the action can
  publish a Maven project that lives in a subdirectory, not just repo root.
  Threaded through setup-java's java-version-file/cache-dependency-path and the
  mvn run steps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces three reusable composite GitHub Actions under .github/actions/ to standardize authentication to AWS CodeArtifact and publishing/mirroring Maven artifacts across OvertureMaps repositories.

Changes:

  • Adds setup-codeartifact composite action to assume an AWS role via OIDC, fetch a CodeArtifact token, and write Maven settings.xml.
  • Adds deploy-maven-to-codeartifact composite action to build and deploy a Maven project (with optional version override for dev publishing).
  • Adds mirror-maven-jar composite action to idempotently mirror a single public JAR into CodeArtifact.

Reviewed changes

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

Show a summary per file
File Description
.github/actions/setup-codeartifact/README.md Documents the setup-codeartifact action usage/inputs and security model.
.github/actions/setup-codeartifact/action.yml Implements CodeArtifact auth + Maven settings generation.
.github/actions/mirror-maven-jar/README.md Documents the JAR mirroring action, inputs, and idempotency behavior.
.github/actions/mirror-maven-jar/action.yml Implements existence check + optional download + deploy-file publishing.
.github/actions/deploy-maven-to-codeartifact/README.md Documents the Maven build+publish action and version override behavior.
.github/actions/deploy-maven-to-codeartifact/action.yml Implements Java setup, internal CodeArtifact auth, deploy, and manifest printing.

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

Comment thread .github/actions/setup-codeartifact/README.md Outdated
Comment thread .github/actions/setup-codeartifact/action.yml
Comment thread .github/actions/setup-codeartifact/action.yml
Comment thread .github/actions/mirror-maven-jar/action.yml
Comment thread .github/actions/mirror-maven-jar/README.md Outdated
Echo domain, domain-owner, repository, region, and a fully-composed
repository-url so downstream steps (mirror, publish, or a raw mvn) can pipe
from a single source of truth instead of re-specifying CodeArtifact metadata.
The authorization token is deliberately not output; it stays in settings.xml.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
- setup-codeartifact: correct the README 'token boundary' section and the
  step comment — token is passed via masked step output (not GITHUB_ENV) and
  embedded in settings.xml; the runner must still be trusted.
- setup-codeartifact / publish-maven-to-codeartifact: aws-region has a default,
  so mark it required: false to match this repo's convention and the docs.
- mirror-maven-jar: enforce jar-url/jar-path mutual exclusivity with a
  validation step (fails fast instead of a confusing Maven error); document
  the JDK + Maven runner prerequisite.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
On pull_request, github.sha is the merge-ref SHA, which diverges from the
commit a caller actually checked out (e.g. pull_request.head.sha). Default
build.commit to git rev-parse HEAD so the JAR manifest matches the built tree,
with an optional commit input to override for non-git build trees.

Reported by overture-matchers#287 review.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
…testing

Pre-merge testing on overture-matchers#287 cannot resolve the nested
setup-codeartifact@main reference because #25 is not on main yet. Temporarily
point the internal self-reference at the branch ref so the full deploy +
dev-publish path can be validated. MUST be reverted to @main before #25 merges
(then SHA-pinned in the post-merge follow-up).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
Pre-merge dev-publish testing on overture-matchers#287 is fully green against
the temporary branch self-ref. Revert the internal setup-codeartifact reference
to @main; it will be SHA-pinned in the post-merge follow-up.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Signed-off-by: John McCall <john@overturemaps.org>
@lowlydba John McCall (lowlydba) merged commit b15c481 into main Jun 9, 2026
9 checks passed
@lowlydba John McCall (lowlydba) deleted the lowlydba/scala-codeartifact-actions branch June 9, 2026 20:22
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.

Add reusable CodeArtifact publish composite actions

2 participants