diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 929fed8..0b45234 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release Maven version +name: Release BetterRTP Maven version on: push: branches: [online-editor] @@ -21,7 +21,7 @@ jobs: distribution: temurin java-version: '17' cache: maven - - name: Read Maven versions + - name: Read BetterRTP Maven version id: version shell: bash run: | @@ -30,13 +30,8 @@ jobs: [[ "$version0" =~ ^[0-9][A-Za-z0-9._-]*$ ]] || { echo "Invalid Maven version"; exit 1; } [[ "$version0" != *SNAPSHOT* ]] || { echo "Snapshot versions are not released"; exit 1; } echo "version0=$version0" >> "$GITHUB_OUTPUT" - mvn -B -q -f BetterRTPAddons/pom.xml help:evaluate -Dexpression=project.version -Doutput="$RUNNER_TEMP/version-1" - version1=$(cat "$RUNNER_TEMP/version-1") - [[ "$version1" =~ ^[0-9][A-Za-z0-9._-]*$ ]] || { echo "Invalid Maven version"; exit 1; } - [[ "$version1" != *SNAPSHOT* ]] || { echo "Snapshot versions are not released"; exit 1; } - echo "version1=$version1" >> "$GITHUB_OUTPUT" - echo "tag=v$version0-addons-$version1" >> "$GITHUB_OUTPUT" - echo "title=BetterRTP $version0 / BetterRTPAddons $version1" >> "$GITHUB_OUTPUT" + echo "tag=v$version0" >> "$GITHUB_OUTPUT" + echo "title=BetterRTP $version0" >> "$GITHUB_OUTPUT" - name: Check for an existing release id: existing env: @@ -53,16 +48,16 @@ jobs: - name: Build and test if: steps.existing.outputs.exists != 'true' run: | - mvn -B clean verify + mvn -B -pl :BetterRTP clean verify mvn -B -f tests/editor/pom.xml verify - - name: Prepare JARs and schemas + - name: Prepare BetterRTP JAR and editor schemas if: steps.existing.outputs.exists != 'true' env: + # The website still needs Addons field metadata; this does not build its JAR. SCHEMA_PATHS: BetterRTP-Core/src/main/resources/META-INF/editor-schema.json BetterRTPAddons/src/main/resources/META-INF/editor-schema.json run: | mkdir release-assets cp "dist/BetterRTP-${{ steps.version.outputs.version0 }}.jar" release-assets/ - cp "dist/BetterRTPAddons-${{ steps.version.outputs.version1 }}.jar" release-assets/ python3 - <<'PYTHON' import json, os, pathlib, re for path in os.environ['SCHEMA_PATHS'].split(): diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index fe144fe..ac75b17 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -18,4 +18,4 @@ jobs: run: cp settings.xml $HOME/.m2/settings.xml - name: Build and test with Maven - run: mvn test + run: mvn -B -pl :BetterRTP test diff --git a/README.md b/README.md index 57ed163..78fa96c 100644 --- a/README.md +++ b/README.md @@ -90,12 +90,18 @@ Use the website's schema-version database migrations before deploying these clie ### Automatic Maven releases `.github/workflows/release.yml` runs on pushes to `online-editor` (or manually from -that branch). It reads the effective Maven project versions, builds the plugin JARs, -runs the editor tests, and publishes a stable GitHub release with the JARs and schemas -attached together. For the current POMs the title is `BetterRTP 3.6.13 / BetterRTPAddons 1.8.10` and the tag is -`v3.6.13-addons-1.8.10`. BetterRTP includes both module versions so an Addons-only version bump -can produce a new release containing both schemas. +that branch). It reads only the Core POM version, builds and verifies BetterRTP Core, +runs the editor tests, and publishes a stable GitHub release with exactly one plugin +JAR. For the current Core POM the title is `BetterRTP 3.6.13` and the tag is `v3.6.13`. +This single-JAR release is compatible with the website's GitHub release importer. -An existing release is left untouched. Bump the owning plugin's POM version to publish -again; SNAPSHOT versions are rejected. GitHub's built-in token needs Contents write +Both Core and Addons editor-schema JSON files remain attached for the website editor. +Copying Addons metadata does not compile or publish its plugin binary. GitHub's Maven +test workflow also selects Core only. Build and upload the Addons plugin manually; +do not attach its JAR to the automated BetterRTP release, which must contain one JAR. +Local root Maven builds still build both modules. + +An existing release is left untouched. Bump `BetterRTP-Core/pom.xml` to publish the next +Core release. An Addons-only version bump does not create a new Core release. +SNAPSHOT versions are rejected. GitHub's built-in token needs Contents write permission, which the workflow declares. No extra publishing token is required.