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

Fix missing v prefix in versions #39

Merged
merged 1 commit into from
Oct 30, 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
14 changes: 7 additions & 7 deletions .github/workflows/deploy-stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ jobs:
BRANCH_NAME="clickhouse/release-$GITHUB_REF_NAME"

# These exported env vars are used for templating
# Release version is the same as tag name, minus leading v.
export RELEASE_VERSION="${GITHUB_REF_NAME:1}"
# Release version is the same as tag name.
export RELEASE_VERSION="${GITHUB_REF_NAME}"
export RELEASE_HASH="$(cd ndc-clickhouse && git rev-parse HEAD)"
export CONNECTOR_DEFINITION_HASH=$(sha256sum ${ROOT}/release/artifacts/connector-definition.tgz | cut -f1 -d' ')

Expand All @@ -332,21 +332,21 @@ jobs:

# create new connector definition
mkdir "${ROOT}/ndc-hub/registry/hasura/clickhouse/releases/v$RELEASE_VERSION"
cat "${ROOT}/ndc-clickhouse/ci/templates/connector-packaging.json" | envsubst > "${ROOT}/ndc-hub/registry/hasura/clickhouse/releases/v$RELEASE_VERSION/connector-packaging.json"
cat "${ROOT}/ndc-clickhouse/ci/templates/connector-packaging.json" | envsubst > "${ROOT}/ndc-hub/registry/hasura/clickhouse/releases/$RELEASE_VERSION/connector-packaging.json"

# modify metadata file to add new entry
UPDATED_METADATA= jq --arg RELEASE_VERSION "$GITHUB_REF_NAME" '.overview.latest_version = $RELEASE_VERSION' "${ROOT}/ndc-hub/registry/hasura/clickhouse/metadata.json" |
jq --arg RELEASE_VERSION "$GITHUB_REF_NAME" --arg RELEASE_HASH "$RELEASE_HASH" '.source_code.version |= [{tag: $RELEASE_VERSION, hash: $RELEASE_HASH, is_verified: true}] + .' > metadata.tmp.json
UPDATED_METADATA= jq --arg RELEASE_VERSION "$RELEASE_VERSION" '.overview.latest_version = $RELEASE_VERSION' "${ROOT}/ndc-hub/registry/hasura/clickhouse/metadata.json" |
jq --arg RELEASE_VERSION "$RELEASE_VERSION" --arg RELEASE_HASH "$RELEASE_HASH" '.source_code.version |= [{tag: $RELEASE_VERSION, hash: $RELEASE_HASH, is_verified: true}] + .' > metadata.tmp.json

mv metadata.tmp.json "${ROOT}/ndc-hub/registry/hasura/clickhouse/metadata.json"

git add .
git commit -m "Release ClickHouse $GITHUB_REF_NAME"
git commit -m "Release ClickHouse $RELEASE_VERSION"
git push origin $BRANCH_NAME --force

# create a pull-requests containing the updates.
gh pr create \
--body "Commit in ndc-clickhouse: https://github.com/hasura/ndc-clickhouse/commit/$RELEASE_HASH" \
--title "Release ClickHouse $GITHUB_REF_NAME" \
--title "Release ClickHouse $RELEASE_VERSION" \
--head "$BRANCH_NAME" \
--base "main"
2 changes: 1 addition & 1 deletion ci/templates/connector-packaging.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "$RELEASE_VERSION",
"uri": "https://github.com/hasura/ndc-clickhouse/releases/download/v$RELEASE_VERSION/connector-definition.tgz",
"uri": "https://github.com/hasura/ndc-clickhouse/releases/download/$RELEASE_VERSION/connector-definition.tgz",
"checksum": {
"type": "sha256",
"value": "$CONNECTOR_DEFINITION_HASH"
Expand Down