[Git][ghc/ghc][wip/upload.sh-cleanups] rel_eng/upload.sh cleanups

Bryan R (@chreekat) gitlab at gitlab.haskell.org
Tue Oct 10 08:09:36 UTC 2023



Bryan R pushed to branch wip/upload.sh-cleanups at Glasgow Haskell Compiler / GHC


Commits:
d638df45 by Bryan Richter at 2023-10-10T11:08:41+03:00
rel_eng/upload.sh cleanups

- - - - -


1 changed file:

- .gitlab/rel_eng/upload.sh


Changes:

=====================================
.gitlab/rel_eng/upload.sh
=====================================
@@ -1,6 +1,7 @@
-#!/usr/bin/env bash
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash -p moreutils lzip zip lftp gnupg
 
-set -e
+set -Eeuo pipefail
 
 # This is a script for preparing and uploading a release of GHC.
 #
@@ -30,21 +31,15 @@ set -e
 #
 # Prerequisites: moreutils
 
-if [ -z "$SIGNING_KEY" ]; then
-    SIGNING_KEY="=Benjamin Gamari <ben at well-typed.com>"
-fi
+: ${SIGNING_KEY:="=Benjamin Gamari <ben at well-typed.com>"}
 
 
 # Infer release name from directory name
-if [ -z "$rel_name" ]; then
-    rel_name="$(basename $(pwd))"
-fi
+: ${rel_name:=$(basename $(pwd))}
 
 # Infer version from tarball names
-if [ -z "$ver" ]; then
-    ver="$(ls ghc-*.tar.* | sed -ne 's/ghc-\([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).\+/\1/p' | head -n1)"
-    if [ -z "$ver" ]; then echo "Failed to infer \$ver"; exit 1; fi
-fi
+: ${ver:=$(ls ghc-*.tar.* | sed -ne 's/ghc-\([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).\+/\1/p' | head -n1)}
+if [ -z "$ver" ]; then echo "Failed to infer \$ver"; exit 1; fi
 
 host="gitlab-storage.haskell.org"
 
@@ -141,6 +136,7 @@ function upload() {
 }
 
 function purge_all() {
+    dir="$(echo $rel_name | sed s/-release//)"
     # Purge CDN cache
     curl -X PURGE http://downloads.haskell.org/ghc/
     curl -X PURGE http://downloads.haskell.org/~ghc/
@@ -196,6 +192,7 @@ function prepare_docs() {
 }
 
 function recompress() {
+    set -Eeuo pipefail
     combine <(basename -s .xz *.xz) not <(basename -s .lz *.lz) | \
         parallel 'echo "Recompressing {}.xz to {}.lz"; unxz -c {}.xz | lzip - -o {}.lz'
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d638df45b2d4956edac4e3354ddf73f2135a88b1

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d638df45b2d4956edac4e3354ddf73f2135a88b1
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231010/c605a95d/attachment-0001.html>


More information about the ghc-commits mailing list