ci: automate versioning, changelog and Modrinth releases - #4
Merged
Conversation
Wire up release-please so Conventional Commits drive the version bump and the CHANGELOG, and publish the resulting release to Modrinth with Minotaur. The version moves out of build.gradle into gradle.properties, which is now the single source of truth for Gradle, paper-plugin.yml and the Modrinth version number. publish.yml is folded into release.yml: a release created with GITHUB_TOKEN does not fire `release: published`, so a separate publish workflow would never run without a PAT. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pull_request_target runs with a writable token in the base-branch context; this check only needs to read the PR title, so the safer trigger is enough. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Summary
Modrinth へのリリースに向けて、バージョン管理・CHANGELOG 生成・公開を全自動化する。
Details
バージョンの単一管理点を
gradle.propertiesへbuild.gradleのversion = '1.0.0'を削除し、gradle.propertiesに移した。Gradle が自動で読み、processResourcesがpaper-plugin.ymlに展開し、Minotaur が Modrinth のバージョン番号として再利用する。release-please の generic updater 用にブロック注釈で囲んでいる。行末注釈形式(
version=1.0.0 # x-release-please-version)だと Java Properties では#以降も値に含まれて壊れるため。release-please
release-please-config.json—simplestrategy、extra-filesでgradle.propertiesを更新、CHANGELOG のセクション定義.release-please-manifest.json—0.0.0で初期化。履歴にfeat:があるため初回リリースは自動的に 0.1.0 になる(1.0.0 未満では minor bump が既定)CHANGELOG.mdは初回リリース PR が自動生成するので事前作成は不要.github/workflows/release.yml(publish.ymlを統合)release-please ジョブと publish ジョブを 1 ワークフローに収めた。
GITHUB_TOKENが作成した Release は他ワークフローのrelease: publishedを発火させないため、publish を別ワークフローに分けると PAT なしでは永久に動かない。publish ジョブは
release_created == 'true'でガードし、build → GitHub Packages → Modrinth → Release への JAR 添付を行う。workflow_dispatchにタグ名を渡せば既存タグの再 publish もできる。Modrinth (Minotaur 2.9.0)
modernvillagershop/ loader:papergradle.propertiesのmodrinth.gameVersionsに集約。ハード依存である BedrockDialog の対応表(1.21.8〜1.21.11 / 26.1 系 / 26.2)に合わせているbedrockdialog(required)とplaceholderapi(optional)。Vault は Modrinth にプロジェクトが存在しないため本文での案内のみmodrinthSyncBodyでREADME.mdをプロジェクト説明文として push する。README のリンクは既に全て絶対 URL なのでそのまま使えるbuild/modrinth-changelog.mdに書き出したものを使う.github/workflows/pr-title.ymlSquash merge では PR タイトルがそのまま
mainのコミットメッセージになり、それを release-please が読む。崩れると CHANGELOG とバージョン判定が壊れるため PR タイトルを検証する。ドキュメント
AGENTS.mdにリリース手順、CLAUDE.mdにリリース自動化の設計判断、README.mdに Modrinth バッジとダウンロードリンクを追記。Test plan
./gradlew build— テスト込みで成功./gradlew modrinth --dry-run— 設定が評価でき、shadowJarが依存として自動配線されることを確認unzip -p build/libs/ModernVillagerShop-0.0.0.jar paper-plugin.yml—version: "0.0.0"が埋め込まれることを確認pr-title.ymlが実際に走ることを確認マージ前に必要なリポジトリ設定
modernvillagershopプロジェクトを作成MODRINTH_TOKENに登録