Skip to content

Commit 8e08a44

Browse files
authored
Merge pull request OpenAPITools#76 from bu3/release_script
Release script
2 parents aaa1dbe + dd257ce commit 8e08a44

File tree

4 files changed

+76
-49
lines changed

4 files changed

+76
-49
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
bazel-*
2+
.DS_Store
3+
.ijwb/

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "openapi_tools_generator_bazel",
3-
version = "0.2.1",
3+
version = "0.0.0",
44
compatibility_level = 0,
55
)
66

MODULE.bazel.lock

Lines changed: 11 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
# Check if running from repository root
4+
if [ ! -f "MODULE.bazel" ]; then
5+
echo "Error: This script must be run from the repository root directory"
6+
echo "Expected file MODULE.bazel not found in current directory"
7+
exit 1
8+
fi
9+
10+
# Check if version parameter is provided
11+
if [ -z "$1" ]; then
12+
echo "Usage: $0 <version>"
13+
echo "Example: $0 1.0.0"
14+
exit 1
15+
fi
16+
17+
version="$1"
18+
tarball_name="openapi-generator-bazel-v${version}.tar.gz"
19+
20+
# Create tarball with specific files in a subdirectory
21+
temp_dir="openapi-generator-bazel-${version}"
22+
mkdir -p "$temp_dir/internal/test/bcr"
23+
24+
# Copy files to temp directory
25+
cp BUILD.bazel "$temp_dir/"
26+
cp LICENSE "$temp_dir/"
27+
cp MODULE.bazel "$temp_dir/"
28+
29+
# Update version in MODULE.bazel
30+
sed -i.bak "s/version = \"[^\"]*\"/version = \"$version\"/" "$temp_dir/MODULE.bazel"
31+
rm -f "$temp_dir/MODULE.bazel.bak"
32+
cp MODULE.bazel.lock "$temp_dir/"
33+
cp defs.bzl "$temp_dir/"
34+
cp extension.bzl "$temp_dir/"
35+
cp internal/openapi_generator.bzl "$temp_dir/internal/"
36+
cp internal/BUILD.bazel "$temp_dir/internal/"
37+
cp internal/test/bcr/petstore.yaml "$temp_dir/internal/test/bcr/"
38+
cp internal/test/bcr/config.yaml "$temp_dir/internal/test/bcr/"
39+
cp internal/test/bcr/BUILD "$temp_dir/internal/test/bcr/"
40+
cp internal/test/bcr/MODULE.bazel.lock "$temp_dir/internal/test/bcr/"
41+
cp internal/test/bcr/MODULE.bazel "$temp_dir/internal/test/bcr/"
42+
43+
# Create tarball from temp directory (list files explicitly to avoid intermediate directories)
44+
tar czf "$tarball_name" -C . \
45+
"$temp_dir/BUILD.bazel" \
46+
"$temp_dir/LICENSE" \
47+
"$temp_dir/MODULE.bazel" \
48+
"$temp_dir/MODULE.bazel.lock" \
49+
"$temp_dir/defs.bzl" \
50+
"$temp_dir/extension.bzl" \
51+
"$temp_dir/internal/openapi_generator.bzl" \
52+
"$temp_dir/internal/BUILD.bazel" \
53+
"$temp_dir/internal/test/bcr/petstore.yaml" \
54+
"$temp_dir/internal/test/bcr/config.yaml" \
55+
"$temp_dir/internal/test/bcr/BUILD" \
56+
"$temp_dir/internal/test/bcr/MODULE.bazel.lock" \
57+
"$temp_dir/internal/test/bcr/MODULE.bazel"
58+
59+
# Clean up temp directory
60+
rm -rf "$temp_dir"
61+
62+
echo "Created tarball: $tarball_name"

0 commit comments

Comments
 (0)