Skip to content

Commit

Permalink
Exit the release job if creating binary package failed
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer committed Nov 24, 2023
1 parent db6c2f3 commit 3b53393
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/release-pkg.nu
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ print $'(char nl)Copying release files...'; hr-line
> register ./nu_plugin_query" | save $'($dist)/README.txt' -f
[LICENSE $executable] | each {|it| cp -rv $it $dist } | flatten
# Sleep a few seconds to make sure the cp process finished successfully
# sleep 3sec

print $'(char nl)Check binary release version detail:'; hr-line
let ver = if $os == 'windows-latest' {
Expand All @@ -156,19 +158,17 @@ cd $dist; print $'(char nl)Creating release archive...'; hr-line
if $os in [$USE_UBUNTU, 'macos-latest'] {

print 'Files in Current directory:'
print (ls -l)
print (ls)
let files = (ls | get name)
let dest = if $env.RELEASE_TYPE == 'full' { $'($bin)-($version)-($FULL_NAME)' } else { $'($bin)-($version)-($target)' }
let archive = $'($dist)/($dest).tar.gz'

mkdir $dest
$files | each {|it|
if not ($'(pwd)/($it)' | path exists) {
print $'(ansi r)($it) not exists, abort...(ansi reset)'
exit 1
}
mv $it $dest
} | ignore
try {
$files | each {|it| mv $it $dest } | ignore
} catch {
print $'(ansi r)Error creating release archive (ansi reset)'; exit 1
}

print $'(char nl)(ansi g)Archive contents:(ansi reset)'; hr-line; ls $dest

Expand Down

0 comments on commit 3b53393

Please sign in to comment.