Skip to content
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

Add GitHub publishing and CI publishing #195

Merged
merged 4 commits into from
Jun 10, 2024

Conversation

MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented Apr 4, 2024

Summary

This PR consists of three parts:

1. Configure modpublisher for GitHub Releases

Some recent Modpublisher PRs added support for configuring the github release tag separately from the "version". This allows use to use 1.2.3+mc1.20.4 as our curseforge/modrinth version, while publishing to a GitHub Release tagged as v1.2.3.

Support for marking the Release as "draft" was also added. This has the advantage of allowing a release to be created before the tag exists, without GitHub automatically creating an (unsigned) tag.

Now, running ./gradlew publishMod will also publish a draft release to GitHub.

Currently untested.

2. Auto publish when pushing +mc* tags

This is pretty simple; automatically run ./gradlew publishMod whenever a tag ending in +mc* is pushed to one of the release branches (main and 1.*).

Currently untested.

3. Publish GH releases when pushing "canonical" tags

This is still WIP, and may be postponed until a follow up PR.

The concept is simple; set draft=false on the github release when a "release tag" gets pushed.

However, we may also want to create the release if it doesn't exist yet? Alternatively, we might want a new modpublisher feature where the release is marked draft only if the tag doesn't exist yet. firstdarkdev/modpublisher#16

Currently WIP & untested.

Extra notes

See Filter pattern cheat sheet, because it turns out the on tag/branch/path filters aren't actually globs. It's some weird custom mash-up of regex & glob...

@MattSturgeon MattSturgeon force-pushed the ci/publish branch 2 times, most recently from 4c64170 to 9611a77 Compare April 4, 2024 21:34
@MattSturgeon MattSturgeon added the dev Only affects developers label Apr 4, 2024
@MattSturgeon MattSturgeon self-assigned this Apr 4, 2024
@MattSturgeon MattSturgeon force-pushed the ci/publish branch 2 times, most recently from 887ce28 to fd38718 Compare June 3, 2024 21:07
@MattSturgeon MattSturgeon marked this pull request as ready for review June 3, 2024 21:08
@MattSturgeon MattSturgeon requested a review from hashalite June 3, 2024 21:08
build.gradle Outdated Show resolved Hide resolved
modpublisher 2.1.0 added support for Gradle's `JavaVersion` class in
`setJavaVersion`.
Publish to Modrinth & Curseforge if tokens are present.

Publish to GitHub draft release, using "canonical" tag.
Releases are published by setting `draft=false`

We need to set the `title` too, because modpublisher will have set a
build-specific title (e.g. `[Fabric] Freecam 1.2.3 for MC 1.20.4`).
@MattSturgeon MattSturgeon merged commit a8332f4 into MinecraftFreecam:main Jun 10, 2024
1 check passed
@MattSturgeon MattSturgeon deleted the ci/publish branch June 10, 2024 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev Only affects developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants