diff --git a/do-release.sh b/do-release.sh deleted file mode 100755 index 9e4ee9dcc2..0000000000 --- a/do-release.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/sh - -set -e - -DOCKER_IMAGE=swiftnav/libsbp-build:2023-12-19 -RUN_DOCKER="docker run -it --rm -v $PWD:/mnt/workspace -t ${DOCKER_IMAGE}" -VERSION=$(./scripts/get_release_version.py $(git describe --match 'v*' --always --tags)) - -if [ $# -ne 0 ]; then - VERSION=$1 - shift -fi - -if [ -z "${CHANGELOG_GITHUB_TOKEN}" ]; then - echo "You must set CHANGELOG_GITHUB_TOKEN in your environment before running this command" - exit 1 -fi - -git diff --exit-code >/dev/null 2>&1 -if [ $? -ne 0 ]; then - echo "Working directory is not clean. Remove any and all changes before running this command" - exit 1 -fi - -echo "Releasing libsbp version ${VERSION}" - -echo "Creating initial commit and tag" -git commit --allow-empty -m "Release ${VERSION}" -git tag -a ${VERSION} -m "Version ${VERSION} of libsbp." - -echo "Building python" -${RUN_DOCKER} make gen-python - -echo "Updating tag" -git add . -git commit --amend -a -m "Release ${VERSION}" -git tag -f -a ${VERSION} -m "Version ${VERSION} of libsbp." - -echo "Building language bindings" -${RUN_DOCKER} make gen-java gen-javascript gen-protobuf -${RUN_DOCKER} make gen-c gen-haskell gen-javascript gen-rust - -echo "Updating tag" -git add . -git commit --amend -a -m "Release ${VERSION}" -git tag -f -a ${VERSION} -m "Version ${VERSION} of libsbp." - -echo "Rebuilding javascript" -${RUN_DOCKER} make gen-javascript -${RUN_DOCKER} make gen-javascript - -echo "Updating tag" -git add . -git commit --amend -a -m "Release ${VERSION}" -git tag -f -a ${VERSION} -m "Version ${VERSION} of libsbp." - -echo "Buliding kaitai" -${RUN_DOCKER} make gen-kaitai - -echo "Updating tag" -git add . -git commit --amend -a -m "Release ${VERSION}" -git tag -f -a ${VERSION} -m "Version ${VERSION} of libsbp." - -echo "Building documentation" -${RUN_DOCKER} make docs - -echo "Updating tag" -git add . -git commit --amend -a -m "Release ${VERSION}" -git tag -f -a ${VERSION} -m "Version ${VERSION} of libsbp." - -echo "Generating changelog" -make release -./scripts/merge_changelogs.py ${VERSION} -rm -f DRAFT_CHANGELOG.md - -echo "Updating tag" -git add . -git commit --amend -a -m "Release ${VERSION}" -git tag -f -a ${VERSION} -m "Version ${VERSION} of libsbp." - -git diff HEAD~1 - -cat < -git commit --amend -a -m "Release ${VERSION}" -git tag -f -a ${VERSION} -m "Version ${VERSION} of libsbp." - -Once you have fixed everything you can push to master - -Once pushed prepare for the next release by running ./scripts/prep_for_next_release.sh -EOF diff --git a/scripts/get_release_version.py b/scripts/get_release_version.py deleted file mode 100755 index 41b1eb2f3c..0000000000 --- a/scripts/get_release_version.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python -import sys - -major, minor, patch = sys.argv[1].split(".")[:3] -if "-" in patch: - patch = patch.split("-")[0] -print(f"{major}.{minor}.{int(patch) + 1}") diff --git a/scripts/merge_changelogs.py b/scripts/merge_changelogs.py deleted file mode 100755 index d726213a41..0000000000 --- a/scripts/merge_changelogs.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env python -import re -import sys -from datetime import datetime - -with open("DRAFT_CHANGELOG.md", "r") as f: - draft = f.readlines() - -# The first 4 lines are just the title and "unreleased" headers which we will recreate later -draft = draft[4:] - -# The first line should now be the first real line of the "unreleased" section which is always a link to the full changelog. Find the next heading and discard everything afterwards -assert draft[0].startswith("[Full Changelog]") - -for i in range(1, len(draft)): - if draft[i].startswith("## [v"): - draft = draft[: i - 1] - break - -proposed = [ - f"## [{sys.argv[1]}](https://github.com/swift-nav/libsbp/tree/{sys.argv[1]}) ({datetime.today().strftime('%Y-%m-%d')})\n", - "\n", -] - -# Strip out anything which looks like a Jira ticket number -for i in range(len(draft)): - proposed.append(re.sub(r"\\\[[A-Z]*-[0-9]*\\\](?=[^(])", r"", draft[i])) -proposed.append("\n") - -print("Proposed new changelog section") -print("\n".join(proposed)) - -with open("CHANGELOG.md", "r") as f: - changelog = f.readlines() - -with open("CHANGELOG.md", "w") as f: - # Keep the first 2 lines from the original changelog - f.writelines(changelog[0:2]) - - # Then the new section - f.writelines(proposed) - - # Then the rest of the original - f.writelines(changelog[2:]) diff --git a/scripts/prep_for_next_release.sh b/scripts/prep_for_next_release.sh deleted file mode 100755 index 717d689625..0000000000 --- a/scripts/prep_for_next_release.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -set -e - -DOCKER_IMAGE=swiftnav/libsbp-build:2023-12-19 -RUN_DOCKER="docker run -it --rm -v $PWD:/mnt/workspace -t ${DOCKER_IMAGE}" -VERSION=$(./scripts/get_release_version.py $(git describe --match 'v*' --always --tags)) - -git diff --exit-code >/dev/null 2>&1 -if [ $? -ne 0 ]; then - echo "Working directory is not clean. Remove any and all changes before running this command" - exit 1 -fi - -echo "Creating initial commit" -git commit --allow-empty -m "prep for next release #no_auto_pr" - -echo "Building python" -${RUN_DOCKER} make gen-python - -echo "Updating commit" -git add . -git commit --amend -a -m "prep for next release #no_auto_pr" - -echo "Building language bindings" -${RUN_DOCKER} make gen-java gen-javascript gen-protobuf -${RUN_DOCKER} make gen-c gen-haskell gen-javascript gen-rust - -echo "Updating commit" -git add . -git commit --amend -a -m "prep for next release #no_auto_pr" - -echo "Rebuilding javascript" -${RUN_DOCKER} make gen-javascript -${RUN_DOCKER} make gen-javascript - -echo "Updating commit" -git add . -git commit --amend -a -m "prep for next release #no_auto_pr" - -echo "Buliding kaitai" -${RUN_DOCKER} make gen-kaitai - -echo "Updating commit" -git add . -git commit --amend -a -m "prep for next release #no_auto_pr" - -git diff HEAD~1 - -cat < -git commit --amend -a -m "prep for next release #no_auto_pr" - -Once you have fixed everything you can push to master -EOF