Skip to content

Commit c2cc420

Browse files
chore: add bump-patch-version command and update documentation
- Add bump-patch-version justfile command for both Windows and Unix - Update RELEASE_PROCESS.md to document all three version bump types - Change "we" to "I" in CONTRIBUTING.md for consistency
1 parent 41daf6e commit c2cc420

3 files changed

Lines changed: 50 additions & 3 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Nightshade is currently in its early stages of development. The project is not a
88

99
## Future Contributions
1010

11-
Once the engine reaches a more mature and stable state, we will open up contributions and provide detailed contributor guidelines. At that time, this document will be updated with:
11+
Once the engine reaches a more mature and stable state, I will open up contributions and provide detailed contributor guidelines. At that time, this document will be updated with:
1212

1313
* Code style guidelines
1414
* Development setup instructions

RELEASE_PROCESS.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,23 @@ This project uses [git-cliff](https://git-cliff.org/) for automated changelog ge
44

55
## Creating a New Release
66

7-
1. Bump the version (patch version):
7+
1. Bump the version:
8+
9+
For a patch version bump (bug fixes, minor changes):
10+
```bash
11+
just bump-patch-version
12+
```
13+
14+
For a minor version bump (new features, backwards compatible):
815
```bash
916
just bump-minor-version
1017
```
11-
Or for a major version bump:
18+
19+
For a major version bump (breaking changes):
1220
```bash
1321
just bump-major-version
1422
```
23+
1524
This will:
1625
- Update version in `Cargo.toml` and `crates/nightshade/README.md`
1726
- Create a commit with the version bump
@@ -30,6 +39,16 @@ This project uses [git-cliff](https://git-cliff.org/) for automated changelog ge
3039
```
3140
This creates a GitHub release titled `nightshade-vX.Y.Z` with the full changelog as release notes.
3241

42+
## Pre-1.0 Versioning
43+
44+
While Nightshade is in pre-1.0 development (0.x.x versions), semantic versioning is interpreted differently:
45+
46+
- **Patch version (0.x.Y)**: Bug fixes, minor changes, and breaking changes
47+
- **Minor version (0.X.0)**: New features, improvements, and breaking changes
48+
- **Major version (X.0.0)**: Reserved for the 1.0 stable release
49+
50+
During pre-1.0 development, breaking changes may occur in both patch and minor version bumps. Once version 1.0 is reached, standard semantic versioning will apply where breaking changes require a major version bump.
51+
3352
## Utility Commands
3453

3554
- `just show-version` - Display current version

justfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,31 @@ bump-major-version:
206206
echo ""
207207
echo "Version bumped and tagged! To push, run:"
208208
echo " just push-version v$NEW_VERSION"
209+
210+
# Bumps the patch version, updates changelog, and creates a git tag (Windows)
211+
[windows]
212+
bump-patch-version:
213+
$currentVersion = (Select-String -Path 'Cargo.toml' -Pattern '^version = "(.+)"' | Select-Object -First 1).Matches.Groups[1].Value; $parts = $currentVersion.Split('.'); $newPatch = [int]$parts[2] + 1; $newVersion = "$($parts[0]).$($parts[1]).$newPatch"; Write-Host "Bumping version from $currentVersion to $newVersion"; (Get-Content 'Cargo.toml') -replace "^version = `"$currentVersion`"", "version = `"$newVersion`"" | Set-Content 'Cargo.toml'; (Get-Content 'Cargo.toml') -replace "nightshade = \{ version = `"$currentVersion`"", "nightshade = { version = `"$newVersion`"" | Set-Content 'Cargo.toml'; (Get-Content 'crates/nightshade/README.md') -replace "nightshade = `"$currentVersion`"", "nightshade = `"$newVersion`"" | Set-Content 'crates/nightshade/README.md'; git add Cargo.toml crates/nightshade/README.md; git commit -m "chore: bump version to v$newVersion"; git tag "v$newVersion"; git cliff --tag "v$newVersion" -o CHANGELOG.md; git add CHANGELOG.md; git commit -m "chore: update changelog for v$newVersion"; Write-Host ""; Write-Host "Version bumped and tagged! To push, run:" -ForegroundColor Green; Write-Host " just push-version v$newVersion" -ForegroundColor Green
214+
215+
# Bumps the patch version, updates changelog, and creates a git tag (Unix)
216+
[unix]
217+
bump-patch-version:
218+
#!/usr/bin/env bash
219+
set -euo pipefail
220+
CURRENT_VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
221+
IFS='.' read -ra PARTS <<< "$CURRENT_VERSION"
222+
NEW_PATCH=$((PARTS[2] + 1))
223+
NEW_VERSION="${PARTS[0]}.${PARTS[1]}.$NEW_PATCH"
224+
echo "Bumping version from $CURRENT_VERSION to $NEW_VERSION"
225+
sed -i "s/^version = \"$CURRENT_VERSION\"/version = \"$NEW_VERSION\"/" Cargo.toml
226+
sed -i "s/nightshade = { version = \"$CURRENT_VERSION\"/nightshade = { version = \"$NEW_VERSION\"/" Cargo.toml
227+
sed -i "s/nightshade = \"$CURRENT_VERSION\"/nightshade = \"$NEW_VERSION\"/" crates/nightshade/README.md
228+
git add Cargo.toml crates/nightshade/README.md
229+
git commit -m "chore: bump version to v$NEW_VERSION"
230+
git tag "v$NEW_VERSION"
231+
git cliff --tag "v$NEW_VERSION" -o CHANGELOG.md
232+
git add CHANGELOG.md
233+
git commit -m "chore: update changelog for v$NEW_VERSION"
234+
echo ""
235+
echo "Version bumped and tagged! To push, run:"
236+
echo " just push-version v$NEW_VERSION"

0 commit comments

Comments
 (0)