Skip to content

Commit

Permalink
Fix release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer committed Mar 10, 2024
1 parent 61a011d commit 8677468
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions scripts/release-pkg.nu
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ if $os == 'ubuntu-latest' {
if $target == 'aarch64-unknown-linux-gnu' {
sudo apt-get install gcc-aarch64-linux-gnu -y
# This is very important here, Otherwise will cause `error adding symbols: file in wrong format`
let-env CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER = 'aarch64-linux-gnu-gcc'
$env.CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER = 'aarch64-linux-gnu-gcc'
cargo-build-musd $flags

} else if $target == 'armv7-unknown-linux-gnueabihf' {
sudo apt-get install pkg-config gcc-arm-linux-gnueabihf -y
let-env CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER = 'arm-linux-gnueabihf-gcc'
$env.CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER = 'arm-linux-gnueabihf-gcc'
cargo-build-musd $flags

} else {
Expand Down Expand Up @@ -78,7 +78,7 @@ let info = if $os == 'windows-latest' {
} else {
(do -i { ./musd -b }) | str join
}
if ($info | str trim | empty?) {
if ($info | str trim | is-empty) {
print $'(ansi r)Incompatible nu binary...(ansi reset)'
} else { $info }

Expand Down Expand Up @@ -114,14 +114,14 @@ if $os in ['ubuntu-latest', 'macos-latest'] {
7z a $archive *
print $'archive: ---> ($archive)';
let pkg = (ls -f $archive | get name)
if not ($pkg | empty?) {
if not ($pkg | is-empty) {
echo $'::set-output name=archive::($pkg | get 0)'
}
}
}

def 'cargo-build-musd' [ options: string ] {
if ($options | str trim | empty?) {
if ($options | str trim | is-empty) {
cargo rustc --bin $bin --target $target --release --features=static-link-openssl
} else {
cargo rustc --bin $bin --target $target --release --features=static-link-openssl $options
Expand Down
12 changes: 6 additions & 6 deletions scripts/release-ssl.nu
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ if $os == 'ubuntu-latest' {
wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
tar xzf openssl-1.1.1o.tar.gz; cd openssl-1.1.1o

let-env OPENSSL_LIB_DIR = '/usr/share/openssl-1.1.1o/'
let-env OPENSSL_INCLUDE_DIR = '/usr/share/openssl-1.1.1o/include'
$env.OPENSSL_LIB_DIR = '/usr/share/openssl-1.1.1o/'
$env.OPENSSL_INCLUDE_DIR = '/usr/share/openssl-1.1.1o/include'
if $target == 'aarch64-unknown-linux-gnu' {
sudo apt-get install gcc-aarch64-linux-gnu -y
let configure = (./config shared no-asm no-async --cross-compile-prefix=aarch64-linux-gnu- | complete)
Expand All @@ -44,7 +44,7 @@ if $os == 'ubuntu-latest' {
sed '/-m64/d' Makefile | save Makefile.bk; mv Makefile.bk Makefile
let make = (make | complete); print ($make | get stderr)
# This is very important here, Otherwise will cause `error adding symbols: file in wrong format`
let-env CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER = 'aarch64-linux-gnu-gcc'
$env.CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER = 'aarch64-linux-gnu-gcc'
cd $src; cargo rustc --bin $bin --target $target --release

} else if $target == 'armv7-unknown-linux-gnueabihf' {
Expand All @@ -53,7 +53,7 @@ if $os == 'ubuntu-latest' {
print ($configure | get stderr)
sed '/-m64/d' Makefile | save Makefile.bk; mv Makefile.bk Makefile
let make = (make | complete); print ($make | get stderr)
let-env CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER = 'arm-linux-gnueabihf-gcc'
$env.CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER = 'arm-linux-gnueabihf-gcc'
cd $src; cargo rustc --bin $bin --target $target --release

} else {
Expand Down Expand Up @@ -93,7 +93,7 @@ let info = if $os == 'windows-latest' {
} else {
(do -i { ./musd -b }) | str join
}
if ($info | str trim | empty?) {
if ($info | str trim | is-empty) {
print $'(ansi r)Incompatible nu binary...(ansi reset)'
} else { $info }

Expand Down Expand Up @@ -129,7 +129,7 @@ if $os in ['ubuntu-latest', 'macos-latest'] {
7z a $archive *
print $'archive: ---> ($archive)';
let pkg = (ls -f $archive | get name)
if not ($pkg | empty?) {
if not ($pkg | is-empty) {
echo $'::set-output name=archive::($pkg | get 0)'
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.nu
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def 'release' [
exit 1
}
let statusCheck = (git status --porcelain)
if not ($statusCheck | empty?) {
if not ($statusCheck | is-empty) {
print $'You have uncommit changes, please commit them and try `release` again!(char nl)'
exit 1
}
Expand Down

0 comments on commit 8677468

Please sign in to comment.