Skip to content

feat(examples): ✨ add a publish workflow for AWS CodeArtifact - #27

Merged
robertodr merged 2 commits into
mainfrom
feat/codeartifact-stub
Nov 4, 2026
Merged

robertodr merged 2 commits into
mainfrom
feat/codeartifact-stub

Conversation

@robertodr

@robertodr robertodr commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

🤖 AI text below 🤖

Stacked on #26 (test/leak-checks); review only the last commit. GitHub retargets this PR to main once that one is merged; then rebase it onto main.

Summary

A publish workflow for packages on the organisation's private index on AWS CodeArtifact: examples/stubs/deploy-codeartifact.yml, shown in docs/adopting.md. Same structure as the PyPI example; the upload job attests the files with GitHub build provenance, assumes an IAM role with GitHub's OIDC token and runs uv publish. uv gets the index as a configuration file (--index), so it reads it with the same credentials and skips files already uploaded: a failed run can be re-run, and no repository's pyproject.toml changes. PEP 740 attestations are left out (--no-attestations): CodeArtifact has no Trusted Publishing to verify them against. The domain, account, region, repository and roles are organisation variables (CODEARTIFACT_*, new step 5 of the one-time organisation setup), so nothing is configured per repository.

Checklist

  • Bug fix for the current release: add the backport label (or ask a maintainer to)
  • just lint and just test pass
  • docs/adopting.md, docs/organisation-setup.md, and docs/repository-setup.md updated if the stubs, inputs or setup changed
  • Breaking change or deprecation: the Migration section says what consumers must change

@robertodr

Copy link
Copy Markdown
Member Author

🤖 AI text below 🤖

New commit 0dd0df2: the CodeArtifact upload now uses uv publish instead of pipx run twine, and the upload job attests the distributions with actions/attest-build-provenance.

  • Re-runnable uploads. uv publish --check-url alone reads the check URL without credentials, so against a private index it can't see existing files and a re-run fails with "already exists". The step therefore writes a small uv configuration ([[index]] with url and publish-url) to $RUNNER_TEMP and publishes with --index codeartifact, with UV_INDEX_CODEARTIFACT_USERNAME/_PASSWORD: uv then reads the index with those credentials and skips the files already there. Checked with the step itself and the real uv against a local index that requires authentication to read: the first run uploads, the second skips both files and succeeds.
  • No changes to pyproject.toml in adopting repositories; the URL comes from the organisation variables, the token stays in the environment.
  • --trusted-publishing never avoids a pointless OIDC exchange with CodeArtifact; --no-attestations because PEP 740 attestations need an index with Trusted Publishing.
  • tests/test_codeartifact_stub.py runs the step with stand-ins for aws and uv: arguments, the generated index configuration, credentials only in the environment, the token masked, build provenance, shellcheck.

#28 and #29 are rebased on it; #29 also updates the skill's description of the upload.

@robertodr
robertodr force-pushed the feat/codeartifact-stub branch from 0dd0df2 to f5c14b6 Compare November 3, 2026 15:59
Base automatically changed from test/leak-checks to main November 4, 2026 08:44
Same structure as the PyPI example; the upload assumes an IAM role with OIDC and runs twine. The domain, account, region, repository and roles are organisation variables, set once.

Assisted-by: Pi:claude-opus-5-5
…he distributions

uv publish replaces pipx run twine. The job hands uv the index as a configuration file (--index), so uv reads it with the same credentials and skips the files already uploaded: a failed run can be re-run, with no change to the repository's pyproject.toml. (--check-url alone reads the index without credentials, so it can't see a private index.) The distributions get GitHub build provenance; PEP 740 attestations are left out, since CodeArtifact has no Trusted Publishing.

Assisted-by: Pi:claude-opus-5-5
@robertodr
robertodr force-pushed the feat/codeartifact-stub branch from f5c14b6 to 6dcba50 Compare November 4, 2026 08:44
@robertodr
robertodr merged commit e77ae3e into main Nov 4, 2026
5 checks passed
@robertodr
robertodr deleted the feat/codeartifact-stub branch November 4, 2026 14:57
robertodr added a commit that referenced this pull request Nov 4, 2026
…tions (#28)

🤖 _AI text below_ 🤖

Stacked on #27 (`feat/codeartifact-stub`); review only its own two
commits. Rebase onto `main` once the PRs below it are merged.

## Summary

Per-repository setup for repositories that released by hand before: the
baseline is the newest final `vX.Y.Z` tag (`v0.0.0` only without one),
with what to do about a dangling pre-release tag or an untagged
published version; the releases before the baseline go into
`CHANGELOG.md`, generated with git-cliff from a worktree at the baseline
tag (pinned by a new test in `tests/test_cliff.py`). A new caveat:
workflows on `release:` events stop running once releases are published
with `GITHUB_TOKEN`. The default branch must be `main`.
docs/central-vs-local.md now agrees with the baseline rule.

## Checklist

- [ ] Bug fix for the current release: add the `backport` label (or ask
a maintainer to)
- [x] `just lint` and `just test` pass
- [x] docs/adopting.md, docs/organisation-setup.md, and
docs/repository-setup.md updated if the stubs, inputs or setup changed
- [ ] Breaking change or deprecation: the Migration section says what
consumers must change
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.

1 participant