Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
workflow_dispatch:
inputs:
version:
description: Semantic version tag (vMAJOR.MINOR.PATCH[-PRERELEASE])
description: Semantic version tag (vMAJOR.MINOR.PATCH[-PRERELEASE][+BUILD])
required: true
type: string
prerelease:
Expand Down Expand Up @@ -39,19 +39,22 @@ jobs:

core_identifier='(0|[1-9][0-9]*)'
prerelease_identifier='(0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)'
version_pattern="^v${core_identifier}\\.${core_identifier}\\.${core_identifier}(-${prerelease_identifier}(\\.${prerelease_identifier})*)?$"
build_identifier='[0-9A-Za-z-]+'
version_pattern="^v${core_identifier}\\.${core_identifier}\\.${core_identifier}(-${prerelease_identifier}(\\.${prerelease_identifier})*)?(\\+${build_identifier}(\\.${build_identifier})*)?$"

if [[ ! "$VERSION" =~ $version_pattern ]]; then
echo "::error::Version must use vMAJOR.MINOR.PATCH with an optional prerelease suffix."
echo "::error::Version must use vMAJOR.MINOR.PATCH with optional prerelease and build metadata."
exit 1
fi

if [[ "$VERSION" == *-* && "$PRERELEASE" != "true" ]]; then
version_without_build="${VERSION%%+*}"

if [[ "$version_without_build" == *-* && "$PRERELEASE" != "true" ]]; then
echo "::error::A version with a prerelease suffix must be marked as a prerelease."
exit 1
fi

if [[ "$VERSION" != *-* && "$PRERELEASE" == "true" ]]; then
if [[ "$version_without_build" != *-* && "$PRERELEASE" == "true" ]]; then
echo "::error::A stable version cannot be marked as a prerelease."
exit 1
fi
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ modern experience at home or away.
## Releases and updates

Silo uses [Semantic Versioning](https://semver.org/) in the form
`vMAJOR.MINOR.PATCH`, with suffixes such as `-alpha.1` for prereleases. The
`vMAJOR.MINOR.PATCH`, with suffixes such as `-alpha.1` for prereleases and
optional `+build.7` metadata. The
[GitHub Releases](https://github.com/Silo-Server/silo-server/releases) page is
the canonical public history of shipped changes, with categorized notes,
contributors, and a full comparison for every version.
Expand Down
7 changes: 7 additions & 0 deletions docs/release-versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Release tags follow [Semantic Versioning](https://semver.org/) with a leading

- Stable release: `vMAJOR.MINOR.PATCH`, for example `v1.2.0`
- Prerelease: `vMAJOR.MINOR.PATCH-SUFFIX`, for example `v0.1.0-alpha.1`
- Build metadata: append `+IDENTIFIER`, for example `v1.2.0+build.7` or
`v0.1.0-alpha.1+build.7`

For releases below `v1.0.0`, a minor release may include breaking changes. Every
release note must call out upgrade, configuration, and compatibility impact when
Expand Down Expand Up @@ -51,5 +53,10 @@ The workflow rejects non-SemVer tags, mismatched prerelease settings, and runs
from branches other than `main`. It also refuses to reuse a release tag or create
a release when there are no commits since the previous one.

GitHub's manual-workflow permission is the release access boundary: only users
with repository write access can dispatch it. If Silo later requires a second
approval, maintainers should configure a protected release environment with
required reviewers and attach the release job to it before use.

This process does not choose or create Silo's first version. The first tag must
be agreed by the maintainers before the workflow is run.
Loading