[Git][ghc/ghc][master] rel_eng/upload.sh cleanups
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Tue Oct 10 23:03:51 UTC 2023
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
a4f1a181 by Bryan Richter at 2023-10-10T19:02:37-04: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/a4f1a181a20abac1f71e8a1793a2d541dda3394f
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a4f1a181a20abac1f71e8a1793a2d541dda3394f
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/6fa79132/attachment-0001.html>
More information about the ghc-commits
mailing list