Skip to content

Commit

Permalink
collection of release scripts. (#1513)
Browse files Browse the repository at this point in the history
* collection of release scripts.

* Remove duplicate script

Co-authored-by: Gabe Jackson <[email protected]>
Co-authored-by: Sam Scott <[email protected]>
  • Loading branch information
3 people authored Aug 4, 2022
1 parent c7c5275 commit bd75514
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/release/01-promote_changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -eou pipefail

if [[ "$#" -ne 1 ]]; then
echo "$0: RELEASE"
exit 1
fi

SCRIPT_DIR=`dirname "$0"`
OSO_DIR="${SCRIPT_DIR}/../.."
RELEASE=$1

pushd $OSO_DIR
pushd docs/content/any/project/changelogs

cp NEXT.md "${RELEASE}".md
cp TEMPLATE.md NEXT.md
16 changes: 16 additions & 0 deletions scripts/release/02-bump-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -eou pipefail

if [[ "$#" -ne 1 ]]; then
echo "$0: VERSION"
exit 1
fi

SCRIPTDIR=`dirname "$0"`
VERSION="$1"
pushd $SCRIPTDIR

python ./bump_versions.py --oso_version "${VERSION}" \
--sqlalchemy_version "${VERSION}" \
--flask_version "${VERSION}" \
--django_version "${VERSION}"
32 changes: 32 additions & 0 deletions scripts/release/03-push-tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -eou pipefail

if [[ "$#" -ne 1 ]]; then
echo "$0: VERSION"
exit 1
fi

if [[ `git branch --show-current` != "main" ]]; then
echo "Must create tags from main."
echo "Switch to main and pull to ensure the release commit is included."
exit 1
fi

SCRIPTDIR=`dirname "$0"`
VERSION="$1"
pushd $SCRIPTDIR

OSO_TAG="v${VERSION}"
DJANGO_TAG="django-v${VERSION}"
FLASK_TAG="flask-v${VERSION}"
SQLALCHEMY_TAG="sqlalchemy-v${VERSION}"

git tag -a "${OSO_TAG}" -m "${OSO_TAG}"
git tag -a "${DJANGO_TAG}" -m "${DJANGO_TAG}"
git tag -a "${FLASK_TAG}" -m "${FLASK_TAG}"
git tag -a "${SQLALCHEMY_TAG}" -m "${SQLALCHEMY_TAG}"

git push origin ${OSO_TAG}
git push origin ${DJANGO_TAG}
git push origin ${FLASK_TAG}
git push origin ${SQLALCHEMY_TAG}
51 changes: 51 additions & 0 deletions scripts/release/04-publish-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
set -eou pipefail

if [[ "$#" -ne 1 ]]; then
echo "$0: VERSION"
exit 1
fi

VERSION=$1

function check_status () {
out=$(mktemp /tmp/osorelease.XXXXX)
RES=$(gh api -X GET repos/{owner}/{repo}/actions/runs -f "q='branch:v${VERSION}'" | \
jq ".workflow_runs[] | {name, id, conclusion, head_branch} | select((.name | contains(\"Release\")) and (.head_branch | contains(\"${VERSION}\")))" | tee "$out" | jq '.conclusion == "success"')

echo "Status"
cat "${out}"
rm "${out}"

echo -n "${RES}" | jq -es 'all'
}

echo "Waiting for release jobs to succeed..."

until check_status
do
echo "Waiting..."
sleep 5
done

echo "Jobs done"

echo "Running oso release workflow"

gh workflow run publish.yml -f version=${VERSION}

echo 'Watching main release job'
sleep 10
WORKFLOW_ID=$(gh api -X GET repos/{owner}/{repo}/actions/workflows/publish.yml/runs -f q='branch:v0.25.1' | jq '.workflow_runs | first | .id')

gh run watch "${WORKFLOW_ID}"

echo 'Checking main release result'
gh api -X GET repos/{owner}/{repo}/actions/workflows/publish.yml/runs -f q='branch:v0.25.1' | jq -e '.workflow_runs | first | .conclusion == "success"'

echo 'Running package releases...'
gh workflow run publish-django-release.yml -f version=${VERSION}
gh workflow run publish-sqlalchemy-release.yml -f version=${VERSION}
gh workflow run publish-flask-release.yml -f version=${VERSION}

echo 'Check status of releases before publishing documentation.'
5 changes: 5 additions & 0 deletions scripts/release/05-publish-docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -eou pipefail

echo 'Publishing docs...'
gh workflow run publish-docs.yml -f url=docs.oso.dev
File renamed without changes.

2 comments on commit bd75514

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: bd75514 Previous: c7c5275 Ratio
indexed/10000 30476 ns/iter (± 2628) 15500 ns/iter (± 3479) 1.97

This comment was automatically generated by workflow using github-action-benchmark.

CC: @osohq/eng

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust Benchmark

Benchmark suite Current: bd75514 Previous: c7c5275 Ratio
rust_get_attribute 52196 ns/iter (± 2419) 42219 ns/iter (± 1256) 1.24
n_plus_one/100 2628533 ns/iter (± 16672) 2294754 ns/iter (± 12016) 1.15
n_plus_one/500 12661305 ns/iter (± 85977) 11080823 ns/iter (± 25932) 1.14
n_plus_one/1000 25236715 ns/iter (± 221845) 22025196 ns/iter (± 55492) 1.15
unify_once 1109 ns/iter (± 269) 938 ns/iter (± 17) 1.18
unify_twice 2974 ns/iter (± 64) 2661 ns/iter (± 696) 1.12
many_rules 73553 ns/iter (± 1620) 64942 ns/iter (± 986) 1.13
fib/5 617982 ns/iter (± 8699) 522227 ns/iter (± 7146) 1.18
prime/3 20956 ns/iter (± 843) 18240 ns/iter (± 551) 1.15
prime/23 21045 ns/iter (± 790) 18270 ns/iter (± 544) 1.15
prime/43 20978 ns/iter (± 881) 18241 ns/iter (± 678) 1.15
prime/83 21000 ns/iter (± 868) 18284 ns/iter (± 649) 1.15
prime/255 19359 ns/iter (± 759) 16750 ns/iter (± 462) 1.16
indexed/100 7003 ns/iter (± 696) 5939 ns/iter (± 408) 1.18
indexed/500 9243 ns/iter (± 1835) 6845 ns/iter (± 1465) 1.35
indexed/1000 11300 ns/iter (± 426) 8117 ns/iter (± 161) 1.39
indexed/10000 30476 ns/iter (± 2628) 15500 ns/iter (± 3479) 1.97
not 6951 ns/iter (± 714) 5928 ns/iter (± 102) 1.17
double_not 14421 ns/iter (± 235) 12319 ns/iter (± 190) 1.17
De_Morgan_not 9272 ns/iter (± 209) 7955 ns/iter (± 126) 1.17
load_policy 1050445 ns/iter (± 5952) 895201 ns/iter (± 2401) 1.17
partial_and/1 37155 ns/iter (± 1654) 30929 ns/iter (± 1106) 1.20
partial_and/5 131180 ns/iter (± 3748) 106728 ns/iter (± 2631) 1.23
partial_and/10 251038 ns/iter (± 4837) 205473 ns/iter (± 5698) 1.22
partial_and/20 508423 ns/iter (± 7327) 420961 ns/iter (± 7652) 1.21
partial_and/40 1081233 ns/iter (± 13122) 910222 ns/iter (± 13453) 1.19
partial_and/80 2444504 ns/iter (± 7505) 2074621 ns/iter (± 14880) 1.18
partial_and/100 3234059 ns/iter (± 8835) 2758047 ns/iter (± 20789) 1.17
partial_rule_depth/1 120745 ns/iter (± 4974) 96708 ns/iter (± 3424) 1.25
partial_rule_depth/5 397468 ns/iter (± 8851) 325122 ns/iter (± 6460) 1.22
partial_rule_depth/10 871816 ns/iter (± 13297) 717216 ns/iter (± 12084) 1.22
partial_rule_depth/20 2449120 ns/iter (± 6456) 2038688 ns/iter (± 10604) 1.20
partial_rule_depth/40 9057300 ns/iter (± 94254) 7388162 ns/iter (± 57930) 1.23
partial_rule_depth/80 51985353 ns/iter (± 331864) 38875046 ns/iter (± 358898) 1.34
partial_rule_depth/100 95040371 ns/iter (± 18643469) 72397595 ns/iter (± 432669) 1.31

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.