ghcup-hs/scripts/releasing/sftp-upload-artifacts.sh

54 lines
1.4 KiB
Bash
Raw Normal View History

2022-01-31 20:18:24 +00:00
#!/bin/bash
url=$1
ver=$2
2022-02-26 17:06:41 +00:00
artifacts_dir=$3
2022-01-31 20:18:24 +00:00
die() {
(>&2 printf "%s\\n" "$1")
exit 2
}
[ -z $url ] && die "no url set"
[ -z $ver ] && die "no version set"
2022-02-26 17:06:41 +00:00
[ -z "${artifacts_dir}" ] && die "artifacts_dir not set"
2022-02-26 17:47:07 +00:00
[ -e "${artifacts_dir}" ] || die "artifacts_dir \"${artifacts_dir}\" does not exist"
2022-02-26 17:06:41 +00:00
cd "${artifacts_dir}"
2022-01-31 20:18:24 +00:00
sftp $url <<EOF
cd ghcup
2022-02-26 17:06:41 +00:00
mkdir ${ver}
cd ${ver}
put SHA256SUMS
put SHA256SUMS.sig
put aarch64-apple-darwin-ghcup-${ver}
put aarch64-apple-darwin-ghcup-${ver}.sig
2023-01-13 04:07:32 +00:00
put aarch64-apple-darwin-ghcup.plan.json
2022-02-26 17:06:41 +00:00
put aarch64-linux-ghcup-${ver}
put aarch64-linux-ghcup-${ver}.sig
2023-01-13 04:07:32 +00:00
put aarch64-linux-ghcup.plan.json
2022-02-26 17:06:41 +00:00
put armv7-linux-ghcup-${ver}
put armv7-linux-ghcup-${ver}.sig
2023-01-13 04:07:32 +00:00
put armv7-linux-ghcup.plan.json
2022-02-26 17:06:41 +00:00
put i386-linux-ghcup-${ver}
put i386-linux-ghcup-${ver}.sig
2023-01-13 04:07:32 +00:00
put i386-linux-ghcup.plan.json
2022-02-26 17:06:41 +00:00
put x86_64-apple-darwin-ghcup-${ver}
put x86_64-apple-darwin-ghcup-${ver}.sig
2023-01-13 04:07:32 +00:00
put x86_64-apple-darwin-ghcup.plan.json
put x86_64-portbld-freebsd-ghcup-${ver}
put x86_64-portbld-freebsd-ghcup-${ver}.sig
put x86_64-portbld-freebsd-ghcup.plan.json
2022-02-26 17:06:41 +00:00
put x86_64-linux-ghcup-${ver}
put x86_64-linux-ghcup-${ver}.sig
2023-01-13 04:07:32 +00:00
put x86_64-linux-ghcup.plan.json
2022-02-26 17:06:41 +00:00
put x86_64-mingw64-ghcup-${ver}.exe
put x86_64-mingw64-ghcup-${ver}.exe.sig
2023-01-13 04:07:32 +00:00
put x86_64-mingw64-ghcup.plan.json
2022-01-31 20:18:24 +00:00
EOF
2022-02-26 17:06:41 +00:00
curl -X PURGE https://downloads.haskell.org/~ghcup/${ver}/
curl -X PURGE https://downloads.haskell.org/ghcup/${ver}/