-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
release.ps1
26 lines (22 loc) · 942 Bytes
/
release.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function invoke {
$exe, $argsForExe = $Args
$ErrorActionPreference = 'Continue'
try { & $exe $argsForExe } catch { Throw }
if ($LASTEXITCODE) { Throw "$exe indicated failure (exit code $LASTEXITCODE; full command: $Args)." }
}
Write-Output "Deploying FREE version"
if (!((invoke git rev-parse --abbrev-ref HEAD) -eq "free")) {
throw "not on free"
}
try { invoke git diff-index --quiet HEAD -- } catch { Throw "index is not clean" }
$version = "1.3.$(invoke git rev-list HEAD --count)"
clj -A:build -M -m version $version $(invoke git rev-parse HEAD)
clj -Spom
invoke git tag "v$version"
invoke git push
invoke git push free-remote free:master
invoke git push free-remote "v$version"
clj -M:depstar "$version.jar"
clj -A:build -M -m deploy "$version.jar" (Read-Host -Prompt "Username") (Read-Host -Prompt "Token" -AsSecureString | ConvertFrom-SecureString -AsPlainText)
rm "$version.jar"
invoke git checkout -- pom.xml