Improve pull_release_artifacts

This commit is contained in:
Julian Ospald 2023-02-24 19:52:41 +08:00
parent 89ae54a083
commit ae625b181c
Signed by: hasufell
GPG Key ID: 3786C5262ECB4A3F

View File

@ -7,6 +7,7 @@ shopt -s extglob
RELEASE=$1
SIGNER=$2
TAG=${RELEASE/v/}
echo "RELEASE: $RELEASE"
echo "SIGNER: $SIGNER"
@ -19,7 +20,7 @@ done
mkdir -p "gh-release-artifacts/${RELEASE}"
git archive --format=tar.gz -o "gh-release-artifacts/${RELEASE}/ghcup-${RELEASE}-src.tar.gz" --prefix="ghcup-${RELEASE}/" HEAD
git archive --format=tar.gz -o "gh-release-artifacts/${RELEASE}/ghcup-${TAG}-src.tar.gz" --prefix="ghcup-${TAG}/" HEAD
cd "gh-release-artifacts/${RELEASE}"
@ -27,10 +28,10 @@ cd "gh-release-artifacts/${RELEASE}"
gh release download "$RELEASE"
# cirrus
curl -L -o "x86_64-portbld-freebsd-ghcup-${RELEASE}" \
curl -L -o "x86_64-portbld-freebsd-ghcup-${TAG}" \
"https://api.cirrus-ci.com/v1/artifact/github/haskell/ghcup-hs/build/binaries/out/x86_64-portbld-freebsd-ghcup-${RELEASE}?branch=${RELEASE}"
sha256sum ./*-ghcup-* > SHA256SUMS
gpg --detach-sign -u "${SIGNER}" SHA256SUMS
gh release upload "$RELEASE" "ghcup-${RELEASE}-src.tar.gz" "x86_64-portbld-freebsd-ghcup-${RELEASE}" SHA256SUMS SHA256SUMS.sig
gh release upload "$RELEASE" "ghcup-${TAG}-src.tar.gz" "x86_64-portbld-freebsd-ghcup-${TAG}" SHA256SUMS SHA256SUMS.sig