Improve release script for github release workflow (#10502)

# Description

Improve release script for Github release workflow: Just some small
improvements
This commit is contained in:
Justin Ma 2023-09-25 19:55:51 +08:00 committed by GitHub
parent b39cca91e5
commit 5326e51e4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 10 deletions

View File

@ -63,11 +63,14 @@ const FULL_RLS_NAMING = {
x86_64-unknown-linux-musl: 'x86_64-linux-musl-full',
aarch64-unknown-linux-gnu: 'aarch64-linux-gnu-full',
aarch64-pc-windows-msvc: 'aarch64-windows-msvc-full',
riscv64gc-unknown-linux-gnu: 'riscv64-linux-gnu-full',
armv7-unknown-linux-gnueabihf: 'armv7-linux-gnueabihf-full',
}
# $env
let USE_UBUNTU = 'ubuntu-20.04'
let FULL_NAME = $FULL_RLS_NAMING | get -i $target | default 'unknown-target-full'
print $'(char nl)Packaging ($bin) v($version) for ($target) in ($src)...'; hr-line -b
if not ('Cargo.lock' | path exists) { cargo generate-lockfile }
@ -153,11 +156,7 @@ cd $dist; print $'(char nl)Creating release archive...'; hr-line
if $os in [$USE_UBUNTU, 'macos-latest'] {
let files = (ls | get name)
let dest = (
if $env.RELEASE_TYPE == 'full' {
$'($bin)-($version)-($FULL_RLS_NAMING | get $target)'
} else { $'($bin)-($version)-($target)' }
)
let dest = if $env.RELEASE_TYPE == 'full' { $'($bin)-($version)-($FULL_NAME)' } else { $'($bin)-($version)-($target)' }
let archive = $'($dist)/($dest).tar.gz'
mkdir $dest
@ -172,11 +171,7 @@ if $os in [$USE_UBUNTU, 'macos-latest'] {
} else if $os == 'windows-latest' {
let releaseStem = (
if $env.RELEASE_TYPE == 'full' {
$'($bin)-($version)-($FULL_RLS_NAMING | get $target)'
} else { $'($bin)-($version)-($target)' }
)
let releaseStem = if $env.RELEASE_TYPE == 'full' { $'($bin)-($version)-($FULL_NAME)' } else { $'($bin)-($version)-($target)' }
print $'(char nl)Download less related stuffs...'; hr-line
aria2c https://github.com/jftuga/less-Windows/releases/download/less-v608/less.exe -o less.exe

View File

@ -104,6 +104,7 @@ jobs:
uses: softprops/action-gh-release@v0.1.15
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
draft: true
files: ${{ steps.nu.outputs.archive }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}