-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpublish.ps1
More file actions
39 lines (39 loc) · 1.13 KB
/
publish.ps1
File metadata and controls
39 lines (39 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
param(
[Parameter(Mandatory=$True)]
[ValidateSet('premajor','preminor','prepatch', 'prerelease', 'release')]
[string]
$type
)
pushd $PSScriptRoot
$x = (cat .\packages\string-fingerings\package.json | ConvertFrom-Json).version
$ispre = $x.Contains('-')
Write-Host -NoNewline "$x --> "
npx semver -i $type $x
popd
if ($type -eq "prerelease") {
if (-not $ispre) {
"The package is not in prerelease. Start with 'premajor', 'preminor' or 'prepatch'"
exit
}
}
elseif ($type -eq "release") {
if (-not $ispre) {
"The package is not in prerelease. Start with 'premajor', 'preminor' or 'prepatch'"
exit
}
"PLEASE CHECK EVERYTHING before final release"
}
else {
if ($ispre) {
"The package is already in prerelease. Start with 'premajor', 'preminor' or 'prepatch'"
exit
}
}
$response = Read-Host "Shall we proceed?"
if ($response -eq 'y') {
$branch = git rev-parse --abbrev-ref HEAD
echo "gh workflow run 121003104 -F version=$type -r $branch"
}
#- First release: `publish.ps1 pre<RTYPE>`
# - Rest of prereleases: `publish.ps1 prerelease`
# - Final release: `publish.ps1 release`