From 3f5a19c63e9667dc4f39c24482b9cdf533222e80 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 13 Jan 2023 12:07:32 +0800 Subject: [PATCH] Post release cleanup --- .github/scripts/build.sh | 4 +- scripts/bootstrap/bootstrap-haskell | 2 +- scripts/releasing/pull_release_artifacts.sh | 57 ++++++++------------- scripts/releasing/sftp-symlink-artifacts.sh | 3 +- scripts/releasing/sftp-upload-artifacts.sh | 14 +++-- 5 files changed, 35 insertions(+), 45 deletions(-) diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index 68d3176..a455a10 100644 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -70,7 +70,7 @@ binary=$(cabal list-bin ghcup) binary_test=$(cabal list-bin ghcup-test) ver=$("${binary}" --numeric-version) strip_binary "${binary}" -cp "${binary}" "out/${ARTIFACT}-${ver}" -cp "${binary_test}" "out/test-${ARTIFACT}-${ver}" +cp "${binary}" "out/${ARTIFACT}-${ver}${ext}" +cp "${binary_test}" "out/test-${ARTIFACT}-${ver}${ext}" cp ./dist-newstyle/cache/plan.json "out/${ARTIFACT}.plan.json" diff --git a/scripts/bootstrap/bootstrap-haskell b/scripts/bootstrap/bootstrap-haskell index 31bfd92..65d7506 100755 --- a/scripts/bootstrap/bootstrap-haskell +++ b/scripts/bootstrap/bootstrap-haskell @@ -28,7 +28,7 @@ plat="$(uname -s)" arch=$(uname -m) -ghver="0.1.18.0" +ghver="0.1.19.0" : "${GHCUP_BASE_URL:=https://downloads.haskell.org/~ghcup}" export GHCUP_SKIP_UPDATE_CHECK=yes diff --git a/scripts/releasing/pull_release_artifacts.sh b/scripts/releasing/pull_release_artifacts.sh index 2e28812..f28899d 100755 --- a/scripts/releasing/pull_release_artifacts.sh +++ b/scripts/releasing/pull_release_artifacts.sh @@ -1,49 +1,34 @@ +#!/bin/bash set -eu +set -o pipefail -tag=v$1 -ver=$1 +shopt -s extglob -dest=$2 -gpg_user=$3 +RELEASE=$1 +SIGNER=$2 -mkdir -p "${dest}" +echo "RELEASE: $RELEASE" +echo "SIGNER: $SIGNER" -cd "${dest}" +for com in gh gpg curl sha256sum ; do + command -V ${com} >/dev/null 2>&1 +done -base_url="https://gitlab.haskell.org/api/v4/projects/618/jobs/artifacts/${tag}/raw" +[ ! -e "gh-release-artifacts/${RELEASE}" ] -curl -f -o "x86_64-apple-darwin-ghcup-${ver}" \ - "${base_url}/out/x86_64-apple-darwin-ghcup-${ver}?job=release:darwin" +mkdir -p "gh-release-artifacts/${RELEASE}" +cd "gh-release-artifacts/${RELEASE}" -curl -f -o "aarch64-apple-darwin-ghcup-${ver}" \ - "${base_url}/out/aarch64-apple-darwin-ghcup-${ver}?job=release:darwin:aarch64" +# github +gh release download $RELEASE -curl -f -o "x86_64-freebsd12-ghcup-${ver}" \ - "${base_url}/out/x86_64-portbld-freebsd-ghcup-${ver}?job=release:freebsd12" - -curl -f -o "x86_64-freebsd13-ghcup-${ver}" \ - "${base_url}/out/x86_64-portbld-freebsd-ghcup-${ver}?job=release:freebsd13" - -curl -f -o "i386-linux-ghcup-${ver}" \ - "${base_url}/out/i386-linux-ghcup-${ver}?job=release:linux:32bit" - -curl -f -o "x86_64-linux-ghcup-${ver}" \ - "${base_url}/out/x86_64-linux-ghcup-${ver}?job=release:linux:64bit" - -curl -f -o "aarch64-linux-ghcup-${ver}" \ - "${base_url}/out/aarch64-linux-ghcup-${ver}?job=release:linux:aarch64" - -curl -f -o "armv7-linux-ghcup-${ver}" \ - "${base_url}/out/armv7-linux-ghcup-${ver}?job=release:linux:armv7" - -curl -f -o "x86_64-mingw64-ghcup-${ver}.exe" \ - "${base_url}/out/x86_64-mingw64-ghcup-${ver}.exe?job=release:windows" - -rm -f *.sig -sha256sum *-ghcup-* > SHA256SUMS -gpg --detach-sign -u ${gpg_user} SHA256SUMS -for f in *-ghcup-* ; do gpg --detach-sign -u ${gpg_user} $f ; done +rm test-* +# cirrus +curl -L -o x86_64-portbld-freebsd-ghcup-${RELEASE} \ + "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 diff --git a/scripts/releasing/sftp-symlink-artifacts.sh b/scripts/releasing/sftp-symlink-artifacts.sh index fa06b05..12a1c69 100755 --- a/scripts/releasing/sftp-symlink-artifacts.sh +++ b/scripts/releasing/sftp-symlink-artifacts.sh @@ -29,8 +29,7 @@ symlink ${ver}/aarch64-linux-ghcup-${ver} aarch64-linux-ghcup symlink ${ver}/armv7-linux-ghcup-${ver} armv7-linux-ghcup symlink ${ver}/i386-linux-ghcup-${ver} i386-linux-ghcup symlink ${ver}/x86_64-apple-darwin-ghcup-${ver} x86_64-apple-darwin-ghcup -symlink ${ver}/x86_64-freebsd12-ghcup-${ver} x86_64-freebsd12-ghcup -symlink ${ver}/x86_64-freebsd13-ghcup-${ver} x86_64-freebsd13-ghcup +symlink ${ver}/x86_64-portbld-freebsd-ghcup-${ver} x86_64-portbld-freebsd-ghcup symlink ${ver}/x86_64-linux-ghcup-${ver} x86_64-linux-ghcup symlink ${ver}/x86_64-mingw64-ghcup-${ver}.exe x86_64-mingw64-ghcup.exe EOF diff --git a/scripts/releasing/sftp-upload-artifacts.sh b/scripts/releasing/sftp-upload-artifacts.sh index effbc9d..eff6289 100755 --- a/scripts/releasing/sftp-upload-artifacts.sh +++ b/scripts/releasing/sftp-upload-artifacts.sh @@ -25,22 +25,28 @@ put SHA256SUMS put SHA256SUMS.sig put aarch64-apple-darwin-ghcup-${ver} put aarch64-apple-darwin-ghcup-${ver}.sig +put aarch64-apple-darwin-ghcup.plan.json put aarch64-linux-ghcup-${ver} put aarch64-linux-ghcup-${ver}.sig +put aarch64-linux-ghcup.plan.json put armv7-linux-ghcup-${ver} put armv7-linux-ghcup-${ver}.sig +put armv7-linux-ghcup.plan.json put i386-linux-ghcup-${ver} put i386-linux-ghcup-${ver}.sig +put i386-linux-ghcup.plan.json put x86_64-apple-darwin-ghcup-${ver} put x86_64-apple-darwin-ghcup-${ver}.sig -put x86_64-freebsd12-ghcup-${ver} -put x86_64-freebsd12-ghcup-${ver}.sig -put x86_64-freebsd13-ghcup-${ver} -put x86_64-freebsd13-ghcup-${ver}.sig +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 put x86_64-linux-ghcup-${ver} put x86_64-linux-ghcup-${ver}.sig +put x86_64-linux-ghcup.plan.json put x86_64-mingw64-ghcup-${ver}.exe put x86_64-mingw64-ghcup-${ver}.exe.sig +put x86_64-mingw64-ghcup.plan.json EOF curl -X PURGE https://downloads.haskell.org/~ghcup/${ver}/