Skip to content

Commit 868c2c3

Browse files
committed
[release] Better error handling in .ps1 release script
1 parent 2efd096 commit 868c2c3

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

scripts/release.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def head(args: argparse.Namespace):
240240
if version is None:
241241
print("No currently tagged version number at HEAD", file=sys.stderr)
242242
sys.exit(1)
243+
print(version)
243244

244245

245246
def main():

scripts/upload_macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
set -e
66

7-
VERSION=$1
7+
VERSION=$(python3 scripts/release.py head)
88

99
cargo build -r
1010
cargo build -r --target x86_64-apple-darwin

scripts/upload_windows.ps1

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
$version = <python3 scripts/release.py head>
1+
$ErrorActionPreference = 'Stop'
2+
$version = python3 scripts/release.py head
3+
if ($LASTEXITCODE -ne 0) {
4+
throw "release.py head failed with exit code $LASTEXITCODE"
5+
}
26

37
cargo build -r
8+
if ($LASTEXITCODE -ne 0) {
9+
throw "cargo build failed with exit code $LASTEXITCODE"
10+
}
11+
412
cp docs/bdist_readme.txt README.txt
5-
Compress-Archive -Path target/release/coursepointer.exe,README.txt,LICENSE.txt,docs/third_party_licenses.md -Destination coursepointer-windows-v$version.zip
6-
#python3 scripts/release.py upload coursepointer-windows-v$version.zip
13+
Compress-Archive -Path target/release/coursepointer.exe,README.txt,LICENSE.txt,docs/third_party_licenses.md `
14+
-Destination coursepointer-windows-v${version}.zip
15+
16+
python3 scripts/release.py upload coursepointer-windows-v$version.zip
17+
if ($LASTEXITCODE -ne 0) {
18+
throw "release.py upload failed with exit code $LASTEXITCODE"
19+
}

0 commit comments

Comments
 (0)