Skip to content

Commit

Permalink
Final release.py polish for 9.6.3
Browse files Browse the repository at this point in the history
* throw better error when required env vars are not set
* move .env to root directory, since vars are now used by release.py
* commit_downloads step; more repos to tag; more details on website updates
  • Loading branch information
garfieldnate committed Jul 3, 2024
1 parent a79fbe6 commit 1c956cd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SoarShuffler/SoarRelease/
SoarShuffler/.env
.env
SoarShuffler/Soar*/
# changes often and is built in CI
pdf/SoarManual.pdf
46 changes: 37 additions & 9 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@

SOAR_SHUFFLER_OUTPUT_DIR = SOAR_SHUFFLER_DIR / f"Soar-Release-{SOAR_RELEASE_VERSION}"

SOAR_GROUP_REPOS_HOME = Path(environ.get("SOAR_GROUP_REPOS_HOME"))

SOAR_WIN_X86_64_COMPILED_DIR = Path(environ.get("SOAR_WIN_X86_64_COMPILED_DIR"))
SOAR_LINUX_X86_64_COMPILED_DIR = Path(environ.get("SOAR_LINUX_X86_64_COMPILED_DIR"))
SOAR_MAC_X86_64_COMPILED_DIR = Path(environ.get("SOAR_MAC_X86_64_COMPILED_DIR"))
SOAR_MAC_ARM64_COMPILED_DIR = Path(environ.get("SOAR_MAC_ARM64_COMPILED_DIR"))
def get_required_env_var_path(name):
if p := environ.get(name):
return Path(p)
else:
raise ValueError(f"{name} is not set")


SOAR_GROUP_REPOS_HOME = get_required_env_var_path("SOAR_GROUP_REPOS_HOME")
SOAR_WIN_X86_64_COMPILED_DIR = get_required_env_var_path("SOAR_WIN_X86_64_COMPILED_DIR")
SOAR_WIN_X86_64_COMPILED_DIR = get_required_env_var_path("SOAR_WIN_X86_64_COMPILED_DIR")
SOAR_LINUX_X86_64_COMPILED_DIR = get_required_env_var_path(
"SOAR_LINUX_X86_64_COMPILED_DIR"
)
SOAR_MAC_X86_64_COMPILED_DIR = get_required_env_var_path("SOAR_MAC_X86_64_COMPILED_DIR")
SOAR_MAC_ARM64_COMPILED_DIR = get_required_env_var_path("SOAR_MAC_ARM64_COMPILED_DIR")


@dataclass
Expand Down Expand Up @@ -239,7 +249,12 @@ def run_soar_shuffler(step: Step):
"between runs, just to make sure you aren't keeping any old files in the release."
)
)
step.proceed(check_function=lambda: (SOAR_SHUFFLER_OUTPUT_DIR/f"SoarSuite_{SOAR_RELEASE_VERSION}-Multiplatform.zip").resolve(strict=True))
step.proceed(
check_function=lambda: (
SOAR_SHUFFLER_OUTPUT_DIR
/ f"SoarSuite_{SOAR_RELEASE_VERSION}-Multiplatform.zip"
).resolve(strict=True)
)


def inspect_release(step: Step):
Expand Down Expand Up @@ -271,10 +286,12 @@ def upload_to_github(step: Step):
step.proceed()


def git_tag(step: Step):
def commit_downloads(step: Step):
print(
(
f"Step {step.value}: Push {SOAR_RELEASE_VERSION} tags for Release-Support and VisualSoar."
f"Step {step.value}: Commit the various generated zip files to the SoarGroup/website-downloads repo "
f"(except for Soar_{SOAR_RELEASE_VERSION}-Multiplatform.zip). "
"It's likely that nothing here will have changed."
)
)
step.proceed()
Expand All @@ -284,7 +301,17 @@ def update_website(step: Step):
print(
(
f"Step {step.value}: Update the website with the new release information: https://github.com/SoarGroup/SoarGroup.github.io. "
"This includes adding a release announcement and updating download links for the manual and tutorial."
"This includes adding a release announcement and updating soar_version (which updates download links for the manual and tutorial), "
"as well as updating the release notes on the 'latest' download page."
)
)
step.proceed()


def git_tag(step: Step):
print(
(
f"Step {step.value}: Push {SOAR_RELEASE_VERSION} tags for Release-Support, VisualSoar, SoarGroup.github.io, and website-downloads."
)
)
step.proceed()
Expand All @@ -305,6 +332,7 @@ def main(args):
run_soar_shuffler(step_counter)
inspect_release(step_counter)
upload_to_github(step_counter)
commit_downloads(step_counter)
git_tag(step_counter)
update_website(step_counter)

Expand Down

0 comments on commit 1c956cd

Please sign in to comment.