From: Rigel Date: Fri, 30 Mar 2018 11:59:26 +0000 (+0200) Subject: refactoring archive creation step to reduce code duplication and be less error-prone X-Git-Tag: v1.0.0-beta.4~104 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d788291d2aa0dd0241958b05f2aecff886b42149;p=oweals%2Fpeertube.git refactoring archive creation step to reduce code duplication and be less error-prone --- diff --git a/scripts/release.sh b/scripts/release.sh index dbc348cb2..87ac89131 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -61,25 +61,27 @@ rm "./client/dist/stats.json" # Creating the archives ( + # local variables + directories_to_archive = ("$directory_name/CREDITS.md" "$directory_name/FAQ.md" \ + "$directory_name/LICENSE" "$directory_name/README.md" \ + "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \ + "$directory_name/client/package.json" "$directory_name/config" \ + "$directory_name/dist" "$directory_name/package.json" \ + "$directory_name/scripts" "$directory_name/support" \ + "$directory_name/tsconfig.json" "$directory_name/yarn.lock") + maintainer_pubkey = "583A612D890159BE" + + # temporary setup cd .. ln -s "PeerTube" "$directory_name" - zip -r "PeerTube/$zip_name" "$directory_name/CREDITS.md" "$directory_name/FAQ.md" \ - "$directory_name/LICENSE" "$directory_name/README.md" \ - "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \ - "$directory_name/client/package.json" "$directory_name/config" \ - "$directory_name/dist" "$directory_name/package.json" \ - "$directory_name/scripts" "$directory_name/support" \ - "$directory_name/tsconfig.json" "$directory_name/yarn.lock" - gpg --armor --detach-sign -u 583A612D890159BE "PeerTube/$zip_name" - tar cfJ "PeerTube/$tar_name" "$directory_name/CREDITS.md" "$directory_name/FAQ.md" \ - "$directory_name/LICENSE" "$directory_name/README.md" \ - "$directory_name/client/dist/" "$directory_name/client/yarn.lock" \ - "$directory_name/client/package.json" "$directory_name/config" \ - "$directory_name/dist" "$directory_name/package.json" \ - "$directory_name/scripts" "$directory_name/support" \ - "$directory_name/tsconfig.json" "$directory_name/yarn.lock" - gpg --armor --detach-sign -u 583A612D890159BE "PeerTube/$tar_name" + # archive creation + signing + zip -r "PeerTube/$zip_name" "${directories_to_archive[@]}" + gpg --armor --detach-sign -u $maintainer_pubkey "PeerTube/$zip_name" + XZ_OPT=-e9 tar cfJ "PeerTube/$tar_name" "${directories_to_archive[@]}" + gpg --armor --detach-sign -u $maintainer_pubkey "PeerTube/$tar_name" + + # temporary setup destruction rm "$directory_name" )