From c43bc9b0512de3b323ce6a62df5d0ff0c3b79f15 Mon Sep 17 00:00:00 2001 From: jcpitre Date: Fri, 14 Aug 2026 14:42:30 -0400 Subject: [PATCH] Added docs and simplified the pom a bit. --- README.md | 15 +++++++++++++++ gbfs-validator-java/bin/gbfs-download-extract.sh | 11 ++++++++--- gbfs-validator-java/pom.xml | 2 -- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c2f276e6..7da462bb 100644 --- a/README.md +++ b/README.md @@ -73,3 +73,18 @@ List of additional rules: * `NoMissingCurrentRangeMetersInVehicleStatusForMotorizedVehicles` * `NoMissingStoreUriInSystemInformation` +## Releasing + +The recommended way to release is via the repository's [Releases](https://github.com/MobilityData/gbfs-validator-java/releases) page. +Publishing from there with tag `vX.Y.Z` triggers `release.yml`, which sets the version from the tag, signs and deploys the artifacts to Maven Central, and attaches the CLI jar to the release. +The project version is derived from that tag, so no version is ever edited in a pom. + +Every push to `master` already publishes `X.Y.Z-SNAPSHOT` to Maven Central, to let developers have the most recent code. +Cut a release only when you want the changes to make their way to the user. + +### Picking up a new schema version + +To pick up a new [gbfs-json-schema](https://github.com/MobilityData/gbfs-json-schema) release, point this property in `gbfs-validator-java/pom.xml` at the new tag and merge to `master`: + + https://github.com/MobilityData/gbfs-json-schema/archive/refs/tags/v4.3.0.zip + diff --git a/gbfs-validator-java/bin/gbfs-download-extract.sh b/gbfs-validator-java/bin/gbfs-download-extract.sh index a770efc5..a04f324e 100755 --- a/gbfs-validator-java/bin/gbfs-download-extract.sh +++ b/gbfs-validator-java/bin/gbfs-download-extract.sh @@ -13,7 +13,6 @@ validate () { } validate "GITHUB_URL" ${GITHUB_URL} -validate "SCHEMA_VERSION" ${SCHEMA_VERSION} validate "DESTINATION_PATH" ${DESTINATION_PATH} ZIP_FILE=downloaded.zip @@ -51,9 +50,15 @@ if [ -f ${ZIP_FILE} ]; then echo "Remove zipfile ${ZIP_FILE}" && rm ${ZIP_FILE} && + # This script empties $DESTINATION_PATH before downloading, so the unzip + # leaves exactly one gbfs-json-schema- folder in it. Resolve that + # folder rather than naming the version, so the version does not have to be + # repeated outside the download URL. Resolve it before the move, since the + # move can lift up entries that would themselves match the glob. echo "Remove intermediate folder" && - mv ${DESTINATION_PATH}/gbfs-json-schema-${SCHEMA_VERSION}/* ${DESTINATION_PATH} && - rm -rf ${DESTINATION_PATH}/gbfs-json-schema-${SCHEMA_VERSION} + SCHEMA_DIR=$(ls -d ${DESTINATION_PATH}/gbfs-json-schema-*) && + mv "${SCHEMA_DIR}"/* ${DESTINATION_PATH} && + rm -rf "${SCHEMA_DIR}" echo "JSON schema extracted to $DESTINATION_PATH" } || diff --git a/gbfs-validator-java/pom.xml b/gbfs-validator-java/pom.xml index 78e20724..53a2f8cb 100644 --- a/gbfs-validator-java/pom.xml +++ b/gbfs-validator-java/pom.xml @@ -52,7 +52,6 @@ 17 https://github.com/MobilityData/gbfs-json-schema/archive/refs/tags/v4.3.0.zip - 4.3.0 1.14.6 2.0.17 @@ -199,7 +198,6 @@ ${gbfsGithubUrl} - ${schemaVersion} src/main/resources/schema ./bin/gbfs-download-extract.sh