Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tools with new files and folders #234

Merged
merged 1 commit into from
Jul 2, 2024
Merged
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
4 changes: 2 additions & 2 deletions tools/event-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ SPLIT_EVENT=(${EVENT_SUBJECT_PREDICATE//./ })
SUBJECT=${SPLIT_EVENT[0]}
PREDICATE=${SPLIT_EVENT[1]}
SCHEMA_FILE="schemas/${SUBJECT}${PREDICATE}.json"
EXAMPLE_FILE="examples/${SUBJECT}_${PREDICATE}.json"
EXAMPLE_FILE="conformance/${SUBJECT}_${PREDICATE}.json"

# Evaluate the event version
OLD_VERSION=$(sed -n -e '/"default": "dev.cdevents.'${SUBJECT}'.'${PREDICATE}'./s/.*\.\([0-9]\.[0-9]\.[0-9]\(-draft\)\{0,1\}\)"/\1/p' ${SCHEMA_FILE})
Expand All @@ -145,7 +145,7 @@ fi
if [[ "${COMMAND}" == "${START_COMMAND}" ]]; then
if [[ -n ${DRAFT_VERSION} ]]; then
echo "Cannot start release ${VERSION}, already in ${DRAFT_VERSION}"
# Still ensure examples are up to date with OLD_VERSION
# Still ensure conformance files are up to date with OLD_VERSION
VERSION=${OLD_VERSION}
replace_example
# Cleanup backup files
Expand Down
9 changes: 6 additions & 3 deletions tools/spec-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,20 @@ VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${DRAFT_VERSION}"
find schemas -name '*json' | \
xargs sed -i ".backup" -e 's,https://cdevents.dev/'${OLD_VERSION}'/schema/,https://cdevents.dev/'${VERSION}'/schema/,g'

# Replace the version in the examples
find examples -name '*json' | \
# Replace the version in the conformance files
find conformance -name '*json' | \
xargs sed -i ".backup" -e 's,"version": "'${OLD_VERSION}'","version": "'${VERSION}'",g'

# Replace the version in the custom events schema ID
find custom -name '*json' | \
xargs sed -i ".backup" -e 's,https://cdevents.dev/'${OLD_VERSION}'/schema/,https://cdevents.dev/'${VERSION}'/schema/,g'

# Replace the version in the custom events conformance file
find custom -name '*json' | \
xargs sed -i ".backup" -e 's,"version": "'${OLD_VERSION}'","version": "'${VERSION}'",g'

# Update examples in docs
for doc in cloudevents-binding spec; do
for doc in cloudevents-binding spec links; do
sed -i ".backup" -e 's;"version": "'${OLD_VERSION}'",;"version": "'${VERSION}'",;g' "${doc}.md"
done

Expand Down
Loading