add changelog, release.ps1
This commit is contained in:
7
changelog.md
Normal file
7
changelog.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# v0.2.2
|
||||
- fixed minor bugs in release script
|
||||
|
||||
# v0.2.1
|
||||
- Changed logging to use loguru
|
||||
- reworked cli arguments to be working
|
||||
- suppressed mkdocs server from hogging the cli and not showing debug info when requested
|
||||
47
release.ps1
Normal file
47
release.ps1
Normal file
@@ -0,0 +1,47 @@
|
||||
# Enable strict mode
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
# Run Python setup.py
|
||||
Write-Host "Running setup.py..."
|
||||
python setup.py
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Python script failed. Exiting."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Get the latest Git tag
|
||||
Write-Host "Fetching the latest Git tag..."
|
||||
$latestTag = git describe --tags --abbrev=0
|
||||
if (-not $latestTag) {
|
||||
Write-Error "No Git tags found. Exiting."
|
||||
exit 1
|
||||
}
|
||||
Write-Host "Latest tag: $latestTag"
|
||||
|
||||
# Read the changelog for the current version
|
||||
Write-Host "Reading changelog for version $latestTag..."
|
||||
$changelogPath = "changelog.md"
|
||||
if (-not (Test-Path $changelogPath)) {
|
||||
Write-Error "Changelog file not found at $changelogPath. Exiting."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Extract the changes for the current version from the changelog
|
||||
$changelogContent = Get-Content $changelogPath -Raw
|
||||
$changesPattern = "(?s)# $latestTag\b(.*?)(?=^#|\Z)"
|
||||
$changes = if ($changelogContent -match $changesPattern) {
|
||||
$matches[1].Trim()
|
||||
} else {
|
||||
Write-Error "No changes found for version $latestTag in the changelog. Exiting."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Create a new release with tea
|
||||
Write-Host "Creating a new release with tea..."
|
||||
$releaseTitle = "LibrarySystem - Version $latestTag"
|
||||
$rel_comment = "Changes in this release: `n$changes`n"
|
||||
$rel = tea release create --title $releaseTitle --note $rel_comment --tag $latestTag
|
||||
if (-not $rel) {
|
||||
Write-Error "Failed to create a new release. Exiting."
|
||||
exit 1
|
||||
}
|
||||
Reference in New Issue
Block a user