ghcup-metadata/scripts/release/cabal/download-gh-artifacts.sh

36 lines
841 B
Bash
Raw Permalink Normal View History

2023-11-17 12:59:09 +00:00
#!/bin/bash
set -eu
set -o pipefail
RELEASE=$1
VERSION=${RELEASE#cabal-install-v}
SIGNER=$2
echo "RELEASE: $RELEASE"
echo "SIGNER: $SIGNER"
for com in gh gpg curl sha256sum ; do
command -V ${com} >/dev/null 2>&1
done
[ ! -e "gh-release-artifacts/cabal-${VERSION}" ]
mkdir -p "gh-release-artifacts/cabal-${VERSION}"
cd "gh-release-artifacts/cabal-${VERSION}"
# github
gh release download "$RELEASE"
# cirrus
curl --fail -L -o "cabal-install-${VERSION}-x86_64-portbld-freebsd.tar.xz" \
2023-11-17 13:23:02 +00:00
"https://api.cirrus-ci.com/v1/artifact/github/haskell/ghcup-metadata/build/binaries/out/cabal-install-${VERSION}-x86_64-portbld-freebsd.tar.xz?branch=develop"
2023-11-17 12:59:09 +00:00
sha256sum ./* > SHA256SUMS
gpg --detach-sign -u "${SIGNER}" SHA256SUMS
gh release upload "$RELEASE" "cabal-install-${VERSION}-x86_64-portbld-freebsd.tar.xz" SHA256SUMS SHA256SUMS.sig