Skip to content

Commit

Permalink
[8.2] Use major.minor-SNAPSHOT for STACK_VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Apr 13, 2022
1 parent 9e4ad2e commit bc5c881
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .ci/test-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
STACK_VERSION:
- 8.2.0-SNAPSHOT
- "8.2.0-SNAPSHOT"

TEST_SUITE:
- platinum
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unified-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Assemble
runs-on: ubuntu-latest
env:
STACK_VERSION: 8.2.0-SNAPSHOT
STACK_VERSION: "8.2-SNAPSHOT"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
18 changes: 14 additions & 4 deletions utils/bump-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,30 @@ def main():
print(f"Couldn't match the given stack version {stack_version!r}")
exit(1)

# Pad the version value with .0 until there
# we have the major, minor, and patch.
for _ in range(3):
if len(python_version.split(".")) >= 3:
break
python_version += ".0"

find_and_replace(
path=SOURCE_DIR / "elasticsearch/_version.py",
pattern=r"__versionstr__ = \"[0-9]+[0-9\.]*[0-9](?:\+dev)?\"",
replace=f'__versionstr__ = "{python_version}"',
)

# These values should always be the 'major.minor-SNAPSHOT'
major_minor_version = ".".join(python_version.split(".")[:2])
find_and_replace(
path=SOURCE_DIR / ".ci/test-matrix.yml",
pattern=r"STACK_VERSION:\s+\- [0-9]+[0-9\.]*[0-9]-SNAPSHOT",
replace=f"STACK_VERSION:\n - {stack_version}",
pattern=r'STACK_VERSION:\s+\- "[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"',
replace=f'STACK_VERSION:\n - "{major_minor_version}.0-SNAPSHOT"',
)
find_and_replace(
path=SOURCE_DIR / ".github/workflows/unified-release.yml",
pattern=r"stack_version: \['[0-9]+[0-9\.]*[0-9]-SNAPSHOT'\]",
replace=f"stack_version: ['{stack_version}']",
pattern=r'STACK_VERSION:\s+"[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"',
replace=f'STACK_VERSION: "{major_minor_version}-SNAPSHOT"',
)


Expand Down

0 comments on commit bc5c881

Please sign in to comment.