Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

<gbfsGithubUrl>https://github.com/MobilityData/gbfs-json-schema/archive/refs/tags/v4.3.0.zip</gbfsGithubUrl>

11 changes: 8 additions & 3 deletions gbfs-validator-java/bin/gbfs-download-extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ validate () {
}

validate "GITHUB_URL" ${GITHUB_URL}
validate "SCHEMA_VERSION" ${SCHEMA_VERSION}
validate "DESTINATION_PATH" ${DESTINATION_PATH}

ZIP_FILE=downloaded.zip
Expand Down Expand Up @@ -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-<version> 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"
} ||
Expand Down
2 changes: 0 additions & 2 deletions gbfs-validator-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
<properties>
<jdk.version>17</jdk.version>
<gbfsGithubUrl>https://github.com/MobilityData/gbfs-json-schema/archive/refs/tags/v4.3.0.zip</gbfsGithubUrl>
<schemaVersion>4.3.0</schemaVersion>

<everit-json-schema.version>1.14.6</everit-json-schema.version>
<slf4j.version>2.0.17</slf4j.version>
Expand Down Expand Up @@ -199,7 +198,6 @@
<configuration>
<environmentVariables>
<GITHUB_URL>${gbfsGithubUrl}</GITHUB_URL>
<SCHEMA_VERSION>${schemaVersion}</SCHEMA_VERSION>
<DESTINATION_PATH>src/main/resources/schema</DESTINATION_PATH>
</environmentVariables>
<executable>./bin/gbfs-download-extract.sh</executable>
Expand Down
Loading