This message was deleted.
# community-support
s
This message was deleted.
j
github packages is what you are looking for
but if I am correct, they are not public (you need to pass auth to be able to download artifacts)
e
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry although I think their documentation is bad, the conventional way to handle it in Gradle would be
Copy code
maven(url = "<https://maven.pkg.github.com/USER/REPO/>") {
    name = "GitHubPackages"
    credentials(PasswordCredentials::class)
}
and
Copy code
env:
  ORG_GRADLE_PROJECT_GitHubPackagesUsername: ${{ github.actor }}
  ORG_GRADLE_PROJECT_GitHubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}
in your workflows
yes, even public packages require GitHub authentication
i
Hmm, is there an alternative? - a popular public maven repo to upload artefacts and access them without credentials?
e
nothing special about a maven repo, any static HTTP host will work (although Gradle requires it to support the HEAD method, so GitHub pages won't work)
long-term, if it's public you'll probably want to upload to Maven Central, which takes some initial account set up, but isn't that hard. you can find lots of guides about it online
j
sonatype snapshots repository or maven central repository using alpha, beta and so on
v
Please don't post alphas and betas to Maven Central. Maven Central should imho only be used for real releases, not snapshot or preview builds. For that, there is the Sonatype snapshots repository that you also have access to when having access to publish to Maven Central.
j
you can’t publish alphas or betas to snapshots repository as it only accept -snapshot versions
v
Oh, right. πŸ˜•
j
I think it is common to publish those versions on maven central tho, for example kotlin ones are there
e
they upload dev releases to their own https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/
v
I think it is common to publish those versions on maven central tho, for example kotlin ones are there
That some projects do it, does not mean I need to like it. πŸ˜„ That always requires to then again filter them out from things like
gradle-versions
plugin,
refreshVersions
, dependabot, renovate bot, ...
πŸ‘ 1
j
@ephemient I was referring to alpha, beta and rc
i
This is the main reason why I am asking - I preffer not to upload alpha/beta/snapshoot
j
but for snapshot you have the snapshots repository
you want to avoid to renovate use the snapshot versions? If you keep a stable version on the remote, renovate will not update it to snapshot even if it is higher
e
sonatype has staging repos. I think creating a maven central account also gives you one
but if you don't want them in maven central, it really is easy to set up your own repo anywhere
Gradle has built-in S3/GCS support, https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:s3-repositories https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:gcs-repositories, so you can easily publish to there, and if you make your buckets public, they can be consumed without auth over http
v
you want to avoid to renovate use the snapshot versions? If you keep a stable version on the remote, renovate will not update it to snapshot even if it is higher
Yeah, but it had to get special logic to not use such versions. And this logic is usually also driven by version string matching which might or might not be correct, ... If Maven Central just had production versions, everything could just use it. πŸ™‚
j
I mean, renovate avoids using any non final version by default, except if you are using a non stable version, and a version which is higher but has the same major, minor and path is released Supposing you are using 1.0.0-alpha.1 β€’ release 1.0.0-alpha.2 would be updated by renovate β€’ release 1.0.1-alpha.1 wouldn't be updated by renovate β€’ release any final version would be updated by renovate Supposing you are using final version, 1.0.0 β€’ release 1.0.1-alpha.1 wouldn't be updated by renovate β€’ release any final version would be updated by renovate
πŸ‘ 1
v
Yes, I know and understood. Now try to read again what I said. They had to code that explicitly instead of just being able to use everything that is available in Maven Central. And other tools like
gradle-versions
plugin you have to configure accordingly.
j
I don't know what you mean with "had to code" πŸ€”
Renovate team or users?
v
team
i
I guess he means that because there is a lot of non-release versions in maven renovate team had to figure this flow out implement custom logic to handle all of that. If maven would contain only release artefacts then this implementation would be much simpler.
BTW Good thanks that we have semantic versioning - just imagine how all of this would wok without it πŸ˜‚
v
Just imagine everyone would actually use semantic versioning, that would be a dream.