From 4fdf5c663c767f5ce29223d424b9278fe8645f3b Mon Sep 17 00:00:00 2001 From: nibon7 Date: Sun, 23 Oct 2022 00:39:11 +0800 Subject: [PATCH] Prepend directory to the binary tarball (#6701) * Prepend directory to the binary tarball According to https://www.gnu.org/software/tar/manual/html_section/transform.html, use `--transform` parameter to prepend directory to each file name. Closes #6676 * Don't depend on GNU tar --- .github/workflows/release-pkg.nu | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-pkg.nu b/.github/workflows/release-pkg.nu index 5911b9b558..8b7613d2b9 100755 --- a/.github/workflows/release-pkg.nu +++ b/.github/workflows/release-pkg.nu @@ -90,10 +90,16 @@ if ($ver | str trim | is-empty) { cd $dist; $'(char nl)Creating release archive...'; hr-line if $os in ['ubuntu-latest', 'macos-latest'] { - $'(char nl)(ansi g)Archive contents:(ansi reset)'; hr-line; ls + let files = (ls | get name) + let dest = $'($bin)-($version)-($target)' + let archive = $'($dist)/($dest).tar.gz' - let archive = $'($dist)/($bin)-($version)-($target).tar.gz' - tar czf $archive * + mkdir $dest + $files | each {|it| mv $it $dest } | ignore + + $'(char nl)(ansi g)Archive contents:(ansi reset)'; hr-line; ls $dest + + tar -czf $archive $dest print $'archive: ---> ($archive)'; ls $archive echo $'::set-output name=archive::($archive)'