Skip to content

Commit 6389ee6

Browse files
chore(crc32c): set up release scripts (#18400)
This PR: - restores the release scripts for crc32c that were removed as part of the monorepo migration - adds extra validation to make sure sdist-only releases will not accidentally be published - adds a release block on crc32c, until we add matching backend configs - move the supported versions list into a centralized location for build scripts, instead of having each script encode it separately
1 parent 11bdf92 commit 6389ee6

21 files changed

Lines changed: 453 additions & 117 deletions
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Store built wheels for audit/SBOM/dry-run inspection
11+
action {
12+
define_artifacts {
13+
regex: "github/google-cloud-python/packages/google-crc32c/wheels/*.whl"
14+
strip_prefix: "github/google-cloud-python/packages/google-crc32c"
15+
}
16+
}
17+
18+
# Fetch the token needed for reporting release status to GitHub
19+
before_action {
20+
fetch_keystore {
21+
keystore_resource {
22+
keystore_config_id: 73713
23+
keyname: "yoshi-automation-github-key"
24+
}
25+
}
26+
}
27+
28+
# Fetch PyPI password
29+
before_action {
30+
fetch_keystore {
31+
keystore_resource {
32+
keystore_config_id: 73713
33+
keyname: "google-cloud-pypi-token-keystore-3"
34+
}
35+
}
36+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "PACKAGE"
5+
value: "crc32c"
6+
}
7+
8+
build_file: "google-cloud-python/.kokoro/release/crc32c/release-manylinux-wheel.sh"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Store built wheels for audit/SBOM/dry-run inspection
11+
action {
12+
define_artifacts {
13+
regex: "github/google-cloud-python/packages/google-crc32c/wheels/*.whl"
14+
strip_prefix: "github/google-cloud-python/packages/google-crc32c"
15+
}
16+
}
17+
18+
# Fetch the token needed for reporting release status to GitHub
19+
before_action {
20+
fetch_keystore {
21+
keystore_resource {
22+
keystore_config_id: 73713
23+
keyname: "yoshi-automation-github-key"
24+
}
25+
}
26+
}
27+
28+
# Fetch PyPI password
29+
before_action {
30+
fetch_keystore {
31+
keystore_resource {
32+
keystore_config_id: 73713
33+
keyname: "google-cloud-pypi-token-keystore-3"
34+
}
35+
}
36+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "PACKAGE"
5+
value: "crc32c"
6+
}
7+
8+
build_file: "google-cloud-python/.kokoro/release/crc32c/release-osx-wheel.sh"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "PACKAGE"
5+
value: "crc32c"
6+
}
7+
8+
build_file: "google-cloud-python/.kokoro/release/crc32c/release-osx-wheel.sh"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# Copyright 2026 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
cd github/google-cloud-python/packages/google-crc32c
19+
20+
export PUBLISH_WHEELS="${PUBLISH_WHEELS:-true}"
21+
22+
# Build and publish ManyLinux wheels
23+
./scripts/manylinux/build.sh
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# Copyright 2026 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# https://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
export REPO_ROOT=$(pwd)/github/google-cloud-python/packages/google-crc32c
19+
cd "${REPO_ROOT}"
20+
21+
export PUBLISH_WHEELS="${PUBLISH_WHEELS:-true}"
22+
23+
# Build and publish OSX wheels
24+
./scripts/osx/build.sh
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
@rem Copyright 2019 Google LLC. All rights reserved.
2+
@rem
3+
@rem Licensed under the Apache License, Version 2.0 (the "License");
4+
@rem you may not use this file except in compliance with the License.
5+
@rem You may obtain a copy of the License at
6+
@rem
7+
@rem http://www.apache.org/licenses/LICENSE-2.0
8+
@rem
9+
@rem Unless required by applicable law or agreed to in writing, software
10+
@rem distributed under the License is distributed on an "AS IS" BASIS,
11+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
@rem See the License for the specific language governing permissions and
13+
@rem limitations under the License.
14+
15+
@echo "Starting Windows release"
16+
17+
cd /d %~dp0..\..\..\packages\google-crc32c || goto :error
18+
19+
if "%PUBLISH_WHEELS%"=="" set PUBLISH_WHEELS=true
20+
21+
@echo "Build and Test Wheels"
22+
call scripts\windows\build.bat || goto :error
23+
24+
@echo "Ensure that we have the latest versions of Twine, Wheel, Setuptools, and pkginfo."
25+
call py -3 -m pip install --upgrade twine wheel setuptools pkginfo || goto :error
26+
27+
@echo "Build the source distribution (sdist) and validate with twine check"
28+
call py -3 setup.py sdist || goto :error
29+
call py -3 -m twine check dist/* wheels/google_crc32c* || goto :error
30+
31+
if "%PUBLISH_WHEELS%"=="true" (
32+
@echo "Start the releasetool reporter"
33+
call py -3 -m pip install gcp-releasetool || goto :error
34+
if not exist C:\temp mkdir C:\temp
35+
call py -3 -m releasetool publish-reporter-script > C:\temp\publisher-script || goto :error
36+
37+
@echo "Disable buffering, so that the logs stream through."
38+
set PYTHONUNBUFFERED=1
39+
40+
@echo "## RELEASE WORKFLOW SUCCESSFUL ##"
41+
@echo "## Uploading Wheels and sdist ##"
42+
43+
set /p TWINE_PASSWORD=<%KOKORO_KEYSTORE_DIR%/73713_google-cloud-pypi-token-keystore-3
44+
call py -3 -m twine upload --skip-existing --username __token__ --password "%TWINE_PASSWORD%" dist/* wheels/google_crc32c* || goto :error
45+
dir wheels
46+
dir dist
47+
) else (
48+
@echo "PUBLISH_WHEELS is '%PUBLISH_WHEELS%'. Skipping PyPI upload after sdist and wheel validation."
49+
)
50+
51+
goto :EOF
52+
53+
:error
54+
exit /b 1
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Build logs will be here
4+
action {
5+
define_artifacts {
6+
regex: "**/*sponge_log.xml"
7+
}
8+
}
9+
10+
# Store built wheels and sdist for audit/SBOM/dry-run inspection
11+
action {
12+
define_artifacts {
13+
regex: "github/google-cloud-python/packages/google-crc32c/wheels/*.whl"
14+
strip_prefix: "github/google-cloud-python/packages/google-crc32c"
15+
}
16+
}
17+
action {
18+
define_artifacts {
19+
regex: "github/google-cloud-python/packages/google-crc32c/dist/*.tar.gz"
20+
strip_prefix: "github/google-cloud-python/packages/google-crc32c"
21+
}
22+
}
23+
24+
# Fetch the token needed for reporting release status to GitHub
25+
before_action {
26+
fetch_keystore {
27+
keystore_resource {
28+
keystore_config_id: 73713
29+
keyname: "yoshi-automation-github-key"
30+
}
31+
}
32+
}
33+
34+
# Fetch PyPI password
35+
before_action {
36+
fetch_keystore {
37+
keystore_resource {
38+
keystore_config_id: 73713
39+
keyname: "google-cloud-pypi-token-keystore-3"
40+
}
41+
}
42+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "PACKAGE"
5+
value: "crc32c"
6+
}
7+
8+
build_file: "google-cloud-python/.kokoro/release/crc32c/release-windows-wheel.bat"

0 commit comments

Comments
 (0)