Skip to content

Workflow and Gradle based publishing setup with changelog system#3575

Merged
douira merged 7 commits into
CaffeineMC:devfrom
IThundxr:publishing
Apr 21, 2026
Merged

Workflow and Gradle based publishing setup with changelog system#3575
douira merged 7 commits into
CaffeineMC:devfrom
IThundxr:publishing

Conversation

@IThundxr
Copy link
Copy Markdown
Contributor

@IThundxr IThundxr commented Apr 3, 2026

Implements automatic publishing trigged by running a workflow, and then using "me.modmuss50.mod-publish-plugin" on the gradle side of things

For this to actually work some things need to be done:

  • CURSEFORGE_API_KEY needs to be added to the repo secrets and set to a curseforge api key from a user with write perms for the sodium curseforge
  • MODRINTH_API_KEY same as above, but modrinth, the token should have the permissions "Read User Data" and "Create versions"
  • CHANGELOG.md needs to be filled out before making a release, instructions are included inside on how to use it
  • This PR currently does not include any automatic version bumping due to the fact that it's not really easy to guess what the next version should be, so developers need to be mindful to update the version either right before publishing, or right after a release has been published

@IThundxr IThundxr requested a review from jellysquid3 as a code owner April 3, 2026 15:34
@IThundxr IThundxr marked this pull request as draft April 3, 2026 15:34
@douira douira requested review from IMS212 and douira April 3, 2026 16:08
@douira
Copy link
Copy Markdown
Contributor

douira commented Apr 4, 2026

Is this ready? Once it is, I would like Jelly and IMS to also review this, and then it would be nice if we could try it out for Sodium 0.8.10, which is an upcoming bugfix release.

@IThundxr
Copy link
Copy Markdown
Contributor Author

IThundxr commented Apr 4, 2026

Is this ready? Once it is, I would like Jelly and IMS to also review this, and then it would be nice if we could try it out for Sodium 0.8.10, which is an upcoming bugfix release.

Mostly yes, it just needs to be tested and when this is merged 2 secrets for the curseforge and modrinth api keys will need to be added

@douira
Copy link
Copy Markdown
Contributor

douira commented Apr 4, 2026

You can mark the PR as ready for review when you think it's complete and correct. Thanks for the work so far!

@IThundxr IThundxr marked this pull request as ready for review April 6, 2026 14:46
Comment thread CHANGELOG.md Outdated
Comment thread build.gradle.kts
Copy link
Copy Markdown
Member

@jellysquid3 jellysquid3 left a comment

Choose a reason for hiding this comment

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

The workflow file needs to be updated so that it runs on the restricted prod environment, otherwise it can't obtain the access tokens during build.

There is a current example of this here.

@jellysquid3
Copy link
Copy Markdown
Member

Related, but not blocking: #2174

This greatly reduces the risks of malicious code getting into the CI/CD and gaining access to the credentials.

@douira douira added this to the Sodium 0.8.10 milestone Apr 16, 2026
@IThundxr
Copy link
Copy Markdown
Contributor Author

The workflow file needs to be updated so that it runs on the restricted prod environment, otherwise it can't obtain the access tokens during build.

There is a current example of this here.

Already does that over here https://github.com/CaffeineMC/sodium/pull/3575/changes#diff-232ead425069ad86b523a739aa18b77f9088cd61a4b40c6a374d9774ff78cfc8L13-L14

@jellysquid3
Copy link
Copy Markdown
Member

Oh, OK. Somehow I missed that.

@shihyeon
Copy link
Copy Markdown

If you want to fix the publish order of Fabric and NeoForge, you need to write the code accordingly. If you run a dry run, you will see that the order is not guaranteed. If this does not bother you, you can ignore my opinion.

@douira
Copy link
Copy Markdown
Contributor

douira commented Apr 17, 2026

I think the publish order doesn't have any significant importance to us, thanks for pointing it out though. Since we've approved it, do we need to insert the API keys into the GH Actions before we merge this?

@shihyeon
Copy link
Copy Markdown

API keys are required when running this workflow.

Copy link
Copy Markdown
Member

@IMS212 IMS212 left a comment

Choose a reason for hiding this comment

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

Looks good.

@douira
Copy link
Copy Markdown
Contributor

douira commented Apr 18, 2026

Closes: #3404
Also there's a merge conflict now (idk why).

@jellysquid3
Copy link
Copy Markdown
Member

The production environment has been modified on the organizational side to supply the expected tokens now.

@jellysquid3
Copy link
Copy Markdown
Member

I think the publish order doesn't have any significant importance to us, thanks for pointing it out though...

It would be nice if Modrinth/CurseForge didn't randomly shuffle the order between NeoForge and Fabric updates, though. How difficult is it to prevent this?

@shihyeon
Copy link
Copy Markdown

It would be nice if Modrinth/CurseForge didn't randomly shuffle the order between NeoForge and Fabric updates, though. How difficult is it to prevent this?

I use it like this. (full code)

    val publishTasks = tasks.withType<me.modmuss50.mpp.PublishModTask>()
    val fabricPublishTasks = publishTasks.matching { it.platform.name.contains("fabric", ignoreCase = true) }
    publishTasks.matching { it.platform.name.contains("neoforge", ignoreCase = true) }.configureEach {
        mustRunAfter(fabricPublishTasks)
    }

@douira
Copy link
Copy Markdown
Contributor

douira commented Apr 21, 2026

Merging as the ordering thing isn't blocking. @IThundxr can maybe look into it in a follow-up.

@douira douira merged commit aa28d78 into CaffeineMC:dev Apr 21, 2026
1 check passed
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.

5 participants