-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an easy way to create only one repo when using multiple machines #59
Comments
Related: #19 |
It might be fun if "1" was not needed:
|
Should be interesting but for open source projects. But for private repositories one machine we will be spending minutes doing "nothing" |
That is not minutes. "initialize staging repository" could easily be one of the first actions, so wait time would be close to zero. |
Tentative API: nexusPublishing {
repositories {
sonatype {
username = "your-username"
password = "your-password"
// Will wait for a repository with the given "description" to come online before publishing
selectRepository(pollingIntervalMillis = 10000) {
// here this is an instance of some NexusRepository class with id and description fields
// this lambda gets called every 10s with the existing repositories
// if it returns true, publishing will start with the given one
if (description == githubRunId) {
// select this repository
true
} else {
// This lambda return style might be too Kotlin specific so maybe make something more Groovy-comatible?
false
}
}
// Also provide an API to force a repository id and avoid looking up the repositories
// For an example created by https://github.com/nexus-actions/create-nexus-staging-repo
repositoryId.set("someExternalRespositoryId")
}
}
} |
Functionality described by @JavierSegoviaCordoba is already available. Thank you devs! I'm pretty sure this is answered in other issues, but I found myself here, somehow, others might come here too, so I'll just share how it works for me. release.yml implements (with a lot of extra stuff) a GitHub Actions workflow that is executed in 3 jobs (each of them is a separate VM):
All jobs from the same run share the same repository description. It doesn't even have to be the same workflow, if you can share repository description string somehow. Repository description is supplied to publish-plugins using this code: nexusPublishing {
project.findProperty("repoDescription")?.toString()?.let {
if (it.isNotEmpty()) {
repositoryDescription.set(it)
}
}
repositories {
sonatype()
}
} |
Use case
A Kotlin Multiplatform library needs two machines to generate all artifacts, Windows and macOS, so providing a way to use the same repository should be great to let us close/release that repository via CLI.
What I want to do
Using GitHub Actions with a matrix of Windows and macOS, the workflow should do:
The text was updated successfully, but these errors were encountered: