-
Notifications
You must be signed in to change notification settings - Fork 0
chore(release): enforce release readiness #474
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/bin/sh | ||
| #MISE description="Verify synchronized server release metadata" | ||
|
|
||
| set -eu | ||
|
|
||
| root=$(CDPATH='' cd -- "$(dirname -- "$0")/../../../.." && pwd) | ||
| manifest="$root/.release-please-manifest.json" | ||
| config="$root/release-please-config.json" | ||
| props="$root/src/Directory.Build.props" | ||
| runtime_properties="$root/src/EventStore.Common/Utils/version.properties" | ||
|
|
||
| manifest_version=$(jq -er '."."' "$manifest") | ||
| file_version=$(tr -d '\r\n' <"$root/version.txt") | ||
| props_version=$(sed -n 's:.*<VersionPrefix>\([^<]*\)</VersionPrefix>.*:\1:p' "$props") | ||
| props_suffix=$(sed -n 's:.*<VersionSuffix>\([^<]*\)</VersionSuffix>.*:\1:p' "$props") | ||
| runtime_suffix=$(sed -n 's/^version_suffix=//p' "$runtime_properties") | ||
| bootstrap_sha=$(jq -er '."bootstrap-sha"' "$config") | ||
|
|
||
| if ! printf '%s\n' "$manifest_version" | grep -Eq '^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$'; then | ||
| echo "The release manifest must contain a stable semantic version." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ "$manifest_version" != "$file_version" ] || [ "$manifest_version" != "$props_version" ]; then | ||
| echo "Release versions must match across the manifest, version.txt, and Directory.Build.props." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! grep -Eq '<VersionSuffix([[:space:]]*/>|></VersionSuffix>)' "$props" || | ||
| ! grep -q '^version_suffix=$' "$runtime_properties" || | ||
| [ -n "$props_suffix" ] || [ -n "$runtime_suffix" ]; then | ||
| echo "Stable release metadata cannot carry a prerelease suffix." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! printf '%s\n' "$bootstrap_sha" | grep -Eq '^[0-9a-f]{40}$'; then | ||
| echo "The release bootstrap must be a full lowercase commit SHA." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| git -C "$root" cat-file -e "$bootstrap_sha^{commit}" | ||
|
|
||
| jq -e ' | ||
| .packages["."]."release-type" == "simple" and | ||
| .packages["."]."include-component-in-tag" == false and | ||
| .packages["."]."include-v-in-tag" == true and | ||
| .packages["."]."include-v-in-release-name" == false and | ||
| any(.packages["."]."extra-files"[]; | ||
| .type == "xml" and | ||
| .path == "src/Directory.Build.props" and | ||
| .xpath == "//VersionPrefix") | ||
| ' "$config" >/dev/null | ||
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 |
|---|---|---|
| @@ -1,22 +1,2 @@ | ||
| # Each line is a file pattern followed by one or more owners. | ||
|
|
||
| # database-mergers team is the default owner for everything in | ||
| # the repo. Unless a later match takes precedence. | ||
| * @EventStore/database-mergers | ||
|
|
||
| # documentation and database-mergers teams own any files in the 'docs' | ||
| # directory at the root of the repository and any of its | ||
| # subdirectories. | ||
| /docs/ @EventStore/documentation @EventStore/database-mergers | ||
|
|
||
| # documentation and database-mergers teams own any markdown files | ||
| # in the root of the repository (README, CONTRIBUTING, LICENSING, etc.) | ||
| # Either team will be able to approve PRs changing these files. | ||
| /*.md @EventStore/documentation @EventStore/database-mergers | ||
|
|
||
| # eventstore-admin team owns the codeowners file to prevent | ||
| # unauthorized changes to it. | ||
| /.github/CODEOWNERS @EventStore/eventstore-admin | ||
|
|
||
| # protected because it contains license rules | ||
| /qodana.yaml @EventStore/eventstore-admin | ||
| # Review ownership belongs to human maintainers rather than individual or automation accounts. | ||
| * @TrogonStack/trogon-eventstore-maintainers |
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
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,25 @@ | ||
| name: Release Please | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| issues: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| release-please: | ||
| name: Release Please | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Create release pull request or release | ||
| uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 | ||
| with: | ||
| token: ${{ secrets.GH_PAT_RELEASE_PLEASE_ACTION }} | ||
| config-file: release-please-config.json | ||
| manifest-file: .release-please-manifest.json |
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,3 @@ | ||
| { | ||
| ".": "0.0.1" | ||
| } |
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,26 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
| "bootstrap-sha": "10b210b00594fb80a99730991a91b29699094e44", | ||
| "group-pull-request-title-pattern": "chore${scope}: release${component} ${version}", | ||
| "signoff": "SHT Bot <61149376+sht-bot@users.noreply.github.com>", | ||
| "packages": { | ||
| ".": { | ||
| "release-type": "simple", | ||
| "package-name": "TrogonEventStore", | ||
| "component": "TrogonEventStore", | ||
| "include-component-in-tag": false, | ||
| "include-v-in-tag": true, | ||
| "include-v-in-release-name": false, | ||
| "pull-request-title-pattern": "chore${scope}: release${component} ${version}", | ||
| "bump-minor-pre-major": false, | ||
| "bump-patch-for-minor-pre-major": false, | ||
| "extra-files": [ | ||
| { | ||
| "type": "xml", | ||
| "path": "src/Directory.Build.props", | ||
| "xpath": "//VersionPrefix" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } |
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 |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| version_suffix=prerelease | ||
| version_suffix= | ||
| edition=local |
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 @@ | ||
| 0.0.1 |
Oops, something went wrong.
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.