-
Notifications
You must be signed in to change notification settings - Fork 28
Describe steps for publishing a release and starting a new release #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Author: @ralfhandl | ||
|
|
||
| # Run this script from the root of the repo. It is designed to be run manually in a release branch. | ||
|
|
||
| branch=$(git branch --show-current) | ||
| today=$(date +%Y-%m-%d) | ||
|
|
||
| if [[ ! $branch =~ ^v[0-9]+\.[0-9]+\.[0-9]+-rel$ ]]; then | ||
| echo "This script is intended to be run from a release branch, e.g. v1.1.0-rel" | ||
| exit 1 | ||
| fi | ||
|
|
||
| vVersion=$(basename "$branch" "-rel") | ||
| version=${vVersion:1} | ||
| echo Prepare release of $version | ||
|
|
||
| # create snapshot of current editors | ||
| cp EDITORS.md versions/$version-editors.md | ||
|
|
||
| # "move" dev version of spec to release version - git will treat this as a rename | ||
| # Replace release date placeholder with current date - should only appear in the history table | ||
| sed "s/| TBD |/| $today |/g" versions/$version-dev.md > versions/$version.md | ||
| # show what changed in the spec - should only be the history table line for the current release | ||
| diff -Z versions/$version-dev.md versions/$version.md | ||
| # remove dev version of spec | ||
| rm versions/$version-dev.md | ||
|
|
||
| # rename schemas dev folder and tests folder if present | ||
| vMinor=$(echo $vVersion | cut -d. -f1,2) | ||
| if [ -d "schemas/$vMinor-dev" ]; then | ||
| mv "schemas/$vMinor-dev" "schemas/$vMinor" | ||
| fi | ||
| if [ -d "tests/$vMinor-dev" ]; then | ||
| mv "tests/$vMinor-dev" "tests/$vMinor" | ||
| fi | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Author: @ralfhandl | ||
|
|
||
| # Run this script from the root of the repo. It is designed to be run manually in the main branch. | ||
|
|
||
| if [[ ! $1 =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
baywet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo "Usage: $0 <nextVersion>" | ||
| echo "Example: $0 1.1.1" | ||
| exit 1 | ||
| fi | ||
|
|
||
| nextVersion=$1 | ||
| minor=$(echo $nextVersion | cut -d. -f1,2) | ||
| nextPatch=$(echo $nextVersion | cut -d. -f3) | ||
|
|
||
| # Find last published spec version for this minor version | ||
| lastSpec=$(ls -1 versions/*.md | grep -E "/$minor\.[0-9].md" | tail -1) | ||
|
|
||
| if [ -z "$lastSpec" ]; then | ||
| # Find last published spec version | ||
| lastSpec=$(ls -1 versions/*.md | grep -E "/.+\.[0-9].md" | tail -1) | ||
| releaseType="Release" | ||
| else | ||
| lastPatch=$(basename "$lastSpec" ".md" | cut --delimiter=. --fields=3) | ||
| releaseType="Patch release" | ||
| fi | ||
|
|
||
| if [ -z "$lastSpec" ]; then | ||
| echo "Could not find any published specification version" | ||
| exit 1 | ||
| fi | ||
|
|
||
| lastVersion=$(basename "$lastSpec" ".md") | ||
| echo === Initialize src/oas.md for $nextVersion from $lastVersion | ||
|
|
||
| # Create PR branch from development branch | ||
| branch=$(git branch --show-current) | ||
| prBranch="start-$nextVersion" | ||
| if ! git checkout -b "$prBranch"; then | ||
| echo "=== Failed: PR branch $prBranch already exists locally, please delete it and try again" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # create dev version of spec from last published spec | ||
| temp=$(mktemp) | ||
|
|
||
| # bump version headline, add line to history table | ||
| historyTableHeader="\n| Version | Date | Notes |\n| ---- | ---- | ---- |\n" | ||
| sed -z -e "s/\n## Version $lastVersion\n/\n## Version $nextVersion\n/" \ | ||
| -z -e "s/$historyTableHeader/$historyTableHeader| $nextVersion | TBD | $releaseType of the Overlay Specification $nextVersion |\n/" \ | ||
| "$lastSpec" > versions/$nextVersion-dev.md | ||
|
|
||
| git add versions/$nextVersion-dev.md | ||
| git commit -m "initialize $nextVersion from $lastVersion" | ||
|
|
||
| echo === Initialized versions/$nextVersion-dev.md | ||
|
|
||
| # when starting a new major or minor version | ||
| if [ "$nextPatch" == "0" ]; then | ||
| lastMinor=$(echo "$lastVersion" | cut -d . -f 1,2) | ||
|
|
||
| echo === Initialize schemas for new version $minor | ||
| cp -r "schemas/v$lastMinor" "schemas/v$minor-dev" | ||
|
|
||
| minorRegex=$(echo "$minor" | sed 's/\./\\\\\\./') | ||
| lastMinorRegex=$(echo "$lastMinor" | sed 's/\./\\\\\\./') | ||
|
|
||
| for file in schemas/v$minor-dev/*.yaml; do | ||
| sed -e "s/$lastMinor/$minor/g" \ | ||
| -e "s/\^$lastMinorRegex\\\./\^$minorRegex\\\./g" \ | ||
| "$file" > "$temp" | ||
| mv -f "$temp" "$file" | ||
| done | ||
|
|
||
| for file in schemas/v$minor-dev/*.md; do | ||
| sed -e "s/$lastMinor/$minor/g" \ | ||
| "$file" > "$temp" | ||
| mv -f "$temp" "$file" | ||
| done | ||
|
|
||
| echo === Initialize tests for new version $minor | ||
| cp -r "tests/v$lastMinor" "tests/v$minor-dev" | ||
|
|
||
| for file in tests/v$minor-dev/{pass,fail}/*.yaml; do | ||
| sed -e "s/$lastMinor/$minor/g" "$file" > "$temp" | ||
| mv -f "$temp" "$file" | ||
| done | ||
|
|
||
| git add schemas/v$minor-dev tests/v$minor-dev | ||
| git commit -m "adjust schemas, test script, and test data" | ||
|
|
||
| echo === Adjusted schemas and tests | ||
| fi | ||
|
|
||
| # Clean up | ||
| git switch "$branch" | ||
| echo === Done | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.