Skip to content

Commit

Permalink
Hardcode JSON Schema version in action.yml (#52)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
  • Loading branch information
jviotti authored Jun 3, 2024
1 parent 8db8e40 commit 95686a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ if(JSONSCHEMA_TESTS)
add_subdirectory(test)
endif()

# As a sanity check
file(READ "${PROJECT_SOURCE_DIR}/action.yml" ACTION_YML)
string(FIND "${ACTION_YML}" "${PROJECT_VERSION}" ACTION_YML_HAS_VERSION)
if(${ACTION_YML_HAS_VERSION} EQUAL -1)
message(FATAL_ERROR
"The GitHub Action definition must set the correct version: ${PROJECT_VERSION}")
endif ()

# Packaging
find_program(GIT_BIN NAMES git)
if(GIT_BIN AND JSONSCHEMA_CONTINUOUS)
Expand Down
6 changes: 5 additions & 1 deletion CONTRIBUTING.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ Releasing

```sh
git checkout main

# Update the VERSION in CMakeLists.txt
vim CMakeLists.txt
git add CMakeLists.txt
# Update the version in action.yml
vim action.yml

git add CMakeLists.txt action.yml
git commit -m "vX.Y.Z"
git tag -a "vX.Y.Z" -m "vX.Y.Z"
git push
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ runs:
--output "${GITHUB_WORKSPACE}/install.sh" \
"https://raw.githubusercontent.com/intelligence-ai/jsonschema/main/install"
chmod +x "${GITHUB_WORKSPACE}/install.sh"
"${GITHUB_WORKSPACE}/install.sh" "${GITHUB_REF#refs/tags/v}"
"${GITHUB_WORKSPACE}/install.sh" 0.1.3
rm "${GITHUB_WORKSPACE}/install.sh"

0 comments on commit 95686a5

Please sign in to comment.