-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
239 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Make release | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
runs-on: [dataplane, self-hosted, linux, x64, small] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check release | ||
id: check | ||
run: | | ||
last_commit_msg="$(git log -1 --pretty=%B|head -n1)" | ||
echo "Last commit msg = '${last_commit_msg}'" | ||
if [[ $last_commit_msg == \[RELEASE* ]] | ||
then | ||
version="$(echo "$last_commit_msg" | cut -d"]" -f1 | cut -d" " -f2)" | ||
else | ||
echo "Latest commit does not look like a release commit" | ||
echo "release-version=null" >> $GITHUB_OUTPUT | ||
exit 0 | ||
fi | ||
# strip any leading "v" from the release. | ||
version="${version#v}" | ||
# validate semver. | ||
if [[ $version =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then | ||
echo "Preparing release $version" | ||
else | ||
echo "Invalid semver $version in branch name" | ||
exit 1 | ||
fi | ||
echo "release-version=${version}" >> $GITHUB_OUTPUT | ||
- name: Create tag | ||
if: ${{ steps.check.outputs.release-version != 'null' }} | ||
run: | | ||
tag="disabled-v${{ steps.check.outputs.release-version }}" | ||
git tag $tag | ||
git push origin $tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Prepare release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
required: true | ||
description: "The semver formatted version for the new release i.e 0.3.1" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
bump: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
runs-on: [dataplane, self-hosted, linux, x64, small] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Bump provider version in examples | ||
id: bump | ||
run: | | ||
version="${{ inputs.version }}" | ||
# strip any leading "v" from the release. | ||
version="${version#v}" | ||
# validate semver. | ||
if [[ $version =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]]; then | ||
echo "Preparing release $version" | ||
else | ||
echo "Invalid semver $version in branch name" | ||
exit 1 | ||
fi | ||
echo "release-version=${version}" >> $GITHUB_OUTPUT | ||
# Bump semver in examples | ||
export CLICKHOUSE_TERRAFORM_PROVIDER_VERSION="$version" | ||
for f in `find examples -name provider.tf.template` | ||
do | ||
dst="${f%.template}" | ||
cat $f | envsubst > $dst | ||
sed -i '1s/^/# This file is generated automatically please do not edit\n/' $dst | ||
done | ||
- name: Open PR with changes | ||
id: pr | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
branch: "bump-provider-to-${{ steps.bump.outputs.release-version }}" | ||
title: "[RELEASE ${{ steps.bump.outputs.release-version }}] Bump provider version in examples" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_providers { | ||
clickhouse = { | ||
version = "0.0.10" | ||
source = "ClickHouse/clickhouse" | ||
} | ||
} | ||
} | ||
|
||
provider "clickhouse" { | ||
organization_id = var.organization_id | ||
token_key = var.token_key | ||
token_secret = var.token_secret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_providers { | ||
clickhouse = { | ||
version = "${CLICKHOUSE_TERRAFORM_PROVIDER_VERSION}" | ||
source = "ClickHouse/clickhouse" | ||
} | ||
} | ||
} | ||
|
||
provider "clickhouse" { | ||
organization_id = var.organization_id | ||
token_key = var.token_key | ||
token_secret = var.token_secret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
terraform { | ||
required_providers { | ||
clickhouse = { | ||
version = "0.0.10" | ||
source = "ClickHouse/clickhouse" | ||
} | ||
|
||
azapi = { | ||
source = "Azure/azapi" | ||
version = "1.13.1" | ||
} | ||
|
||
} | ||
} | ||
|
||
provider "clickhouse" { | ||
organization_id = var.organization_id | ||
token_key = var.token_key | ||
token_secret = var.token_secret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
terraform { | ||
required_providers { | ||
clickhouse = { | ||
version = "${CLICKHOUSE_TERRAFORM_PROVIDER_VERSION}" | ||
source = "ClickHouse/clickhouse" | ||
} | ||
|
||
azapi = { | ||
source = "Azure/azapi" | ||
version = "1.13.1" | ||
} | ||
|
||
} | ||
} | ||
|
||
provider "clickhouse" { | ||
organization_id = var.organization_id | ||
token_key = var.token_key | ||
token_secret = var.token_secret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_providers { | ||
clickhouse = { | ||
version = "0.0.10" | ||
source = "ClickHouse/clickhouse" | ||
} | ||
} | ||
} | ||
|
||
provider "clickhouse" { | ||
organization_id = var.organization_id | ||
token_key = var.token_key | ||
token_secret = var.token_secret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_providers { | ||
clickhouse = { | ||
version = "${CLICKHOUSE_TERRAFORM_PROVIDER_VERSION}" | ||
source = "ClickHouse/clickhouse" | ||
} | ||
} | ||
} | ||
|
||
provider "clickhouse" { | ||
organization_id = var.organization_id | ||
token_key = var.token_key | ||
token_secret = var.token_secret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_providers { | ||
clickhouse = { | ||
version = "0.0.10" | ||
source = "ClickHouse/clickhouse" | ||
} | ||
} | ||
} | ||
|
||
provider clickhouse { | ||
organization_id = var.organization_id | ||
token_key = var.token_key | ||
token_secret = var.token_secret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_providers { | ||
clickhouse = { | ||
version = "${CLICKHOUSE_TERRAFORM_PROVIDER_VERSION}" | ||
source = "ClickHouse/clickhouse" | ||
} | ||
} | ||
} | ||
|
||
provider clickhouse { | ||
organization_id = var.organization_id | ||
token_key = var.token_key | ||
token_secret = var.token_secret | ||
} |