Repository navigation
Use GitHub Packages as a fallback for pull request builds and publish snapshots from prime - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes GitHub Packages a fallback for BonfireTrunk's own artifacts, so a library's pull request can build against another library's snapshot, published on request, or a release Central has not accepted yet, without spending a Maven Central release.
Pull request builds (
maven-build.yml)https://maven.pkg.github.com/<owner>/*second. Repositories in settings are searched before the POM's, so Central stays the source for everything it has.today.bonfire.oss. No other artifact can come from it.updatePolicy always), so a new snapshot is picked up even from a restored Maven cache.GITHUB_TOKEN, so no secret is needed and librarybuild.ymlfiles don't change.Release workflow (
maven-release.yml)snapshotjob, opt-in. It runs only when the squash title of a merge intoprimestarts withSnapshot:, for exampleSnapshot: Add a borrow timeout, the same way a release needsRelease X.Y.Z. GitHub matches the prefix without regard to case. It runsverify deploy:deployto GitHub Packages with the library'smaven-args, resolving like the PR build, and is not signed. If the pom version is not a-SNAPSHOT, it fails with an error, because the title asked for a snapshot. Other merges publish nothing and still show as skipped runs, so routine merges don't add snapshot builds. Callers already grantpackages: write, so no caller change is needed.releasejob still resolves from Central only. Its check step now also runsenforcer:enforce -Denforcer.rules=requireReleaseDeps. That fails early, with a clear error, on any SNAPSHOT dependency or SNAPSHOT parent.README: a "GitHub Packages as a fallback" section, an updated table, and how to use snapshots locally with a classic token that has
read:packages.Tested
GITHUB_TOKENdownloads public Maven packages published from other repositories in the organization. That held with and withoutpackages: read, and through theBonfireTrunk/*URL: 200 after a redirect to the registry file store, real POM content. A missing version returns 404.today.bonfire.ossartifact that is on Central came from Central, with no GitHub request.github("cached from a remote repository ID that is unavailable in current build context") and fails when Central lacks it. A release cannot pick up a GitHub-only artifact from a shared Maven cache.requireReleaseDepspasses with release dependencies. It fails on a SNAPSHOT dependency ("is not a release dependency") and on a SNAPSHOT parent ("Parent Cannot be a snapshot").maven-build.yml@github-packages-fallbacksucceeded.maven-release.yml@github-packages-fallbackparsed the new file, and both jobs skipped as designed.snapshotjob itself only runs on a push toprime, so its first real run will be the firstSnapshot:merge after this lands. The parse check above ran before the job became opt-in; that later change touches only itsifand its non-SNAPSHOT message. actionlint was not run on this change.