From d2a678bed6585a97da000ad7cbb4d7382cec54a8 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 25 Jan 2021 15:58:11 +0000 Subject: [PATCH] Remove stale files Building releases of and manifests for dcrinstall, as well as signing and notarizing a dcrinstall installer for macOS, have been superseded by the build process and scripts in the github.com/decred/release repository. --- compile_manifest.sh | 71 ----------------------- dcrinstall_manifest_urls.txt | 6 -- package.sh | 108 ----------------------------------- release.sh | 53 ----------------- 4 files changed, 238 deletions(-) delete mode 100755 compile_manifest.sh delete mode 100644 dcrinstall_manifest_urls.txt delete mode 100755 package.sh delete mode 100755 release.sh diff --git a/compile_manifest.sh b/compile_manifest.sh deleted file mode 100755 index 4c98c5d..0000000 --- a/compile_manifest.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/sh - -set -e -set -o pipefail - -usage() { - echo "usage: $0 output manifest1 [manifest2...]" 2>&1 - exit 2 -} - -# download a file over HTTPS and dump to standard output -# arg1: the url -dl_stdout() { - local _url=$1 - case $(uname) in - "OpenBSD") - ftp -VMo- ${_url} - ;; - *) - curl -Lf ${_url} - ;; - esac -} - -# compute SHA256 hash of standard input -# returns: the SHA256 hash -sha256_sum() { - openssl sha256 | awk '{print $2}' -} - -# download file from a url and compute its SHA256 hash -# arg1: the url -# returns: the SHA256 hash -dl_hash() { - local _url=$1 - dl_stdout ${_url} | sha256_sum -} - -find_url() { - NAME="$1" perl -lane 'print if /${ENV{NAME}}$/' <${URLFILE} -} - -[ $# -gt 1 ] || usage -OUTPUT=$1 -URLFILE=dcrinstall_manifest_urls.txt -shift -FILES="$@" - -# sort filenames -export FILES -FILES=$(perl -e 'print join("\n", sort(split(/\s+/, $ENV{FILES})))') - -[ -e ${OUTPUT} ] && rm ${OUTPUT} -for _file in ${FILES}; do - _what=$(basename ${_file}) - _url=$(find_url ${_what}) - [ -z "${_url}" ] && { - echo "${_what} not found in url file" 2>&1 - exit 1 - } - _hash=$(sha256_sum <${_file}) - [ ${_hash} = $(dl_hash ${_url}) ] || { - echo "download of ${_what} does not match local file" 2>&1 - exit 1 - } - echo "${_hash} ${_url}" >> ${OUTPUT} -done - -echo "Manifest:" -cat ${OUTPUT} -echo "Manifest hash: $(sha256_sum<${OUTPUT})" diff --git a/dcrinstall_manifest_urls.txt b/dcrinstall_manifest_urls.txt deleted file mode 100644 index 81b6c0e..0000000 --- a/dcrinstall_manifest_urls.txt +++ /dev/null @@ -1,6 +0,0 @@ -https://github.com/decred/decred-binaries/releases/download/v1.6.0-rc1/dexc-v0.1.0-manifest.txt -https://github.com/decred/decred-release/releases/download/v1.6.0-rc1/dcrinstall-v1.6.0-rc1-manifest.txt -https://github.com/decred/decred-binaries/releases/download/v1.6.0-rc1/decred-v1.6.0-rc1-manifest.txt -https://bitcoincore.org/bin/bitcoin-core-0.20.1/SHA256SUMS.asc -https://github.com/decred/decred-binaries/releases/download/v1.6.0-rc2/decred-v1.6.0-rc2-manifest.txt -https://github.com/decred/decred-binaries/releases/download/v1.6.0-rc2/dexc-v0.1.1-manifest.txt diff --git a/package.sh b/package.sh deleted file mode 100755 index d67d69e..0000000 --- a/package.sh +++ /dev/null @@ -1,108 +0,0 @@ -#!/bin/sh - -# submit a package to be notarized -# returns: notarization uuid -notary_submit() { - xcrun altool -f release/dcrinstall-${VERSION}/${EXE}.pkg \ - --notarize-app \ - --primary-bundle-id org.decred.dcrinstall.pkg \ - --asc-provider ${IDENTITY} \ - -p @keychain:${KEYCHAIN} 2>&1 \ - | perl -ne 'print if s/^RequestUUID = //' -} - -# check notarization status after successful submission -# arg 1: uuid -# returns: altool output -notary_status() { - local _uuid=$1 - xcrun altool --notarization-info ${_uuid} -p @keychain:${KEYCHAIN} 2>&1 -} - -# write an install script read from stdin -# arg 1: script name -installscript() { - local _script=${SCRIPTS}/$1 - cat >${_script} - chmod 0755 ${_script} -} - -[ $(uname) = Darwin ] || { - echo "$0 must be run from darwin" 2>&1 - exit 1 -} -[ $# = 2 ] || { - echo "usage: $0 version identity" 2>&1 - exit 2 -} - -VERSION=$1 -IDENTITY=$2 -KEYCHAIN=${KEYCHAIN:-signer} -DIST=dist/darwin -SCRIPTS=darwin/scripts -EXE=dcrinstall-darwin-amd64-${VERSION} -BUILD=release/dcrinstall-${VERSION}/${EXE} -PREFIX=${PREFIX:-/usr/local} - -[ -x ${BUILD} ] || { - echo "execute './release.sh ${VERSION}' first" 2>&1 - exit 1 -} - -set -ex -[ -d ${DIST} ] && rm -rf ${DIST} -[ -d ${SCRIPTS} ] && rm -rf ${SCRIPTS} -mkdir -p ${DIST} -mkdir -p ${SCRIPTS} - -# prepare directory with package files -install -m 0755 ${BUILD} ${DIST}/dcrinstall -codesign -s ${IDENTITY} --options runtime ${DIST}/dcrinstall -installscript postinstall < /etc/paths.d/decred -EOF - -# generate signed package for notarization -pkgbuild --identifier org.decred.dcrinstall \ - --version ${VERSION} \ - --root ${DIST} \ - --install-location ${PREFIX}/decred \ - --scripts ${SCRIPTS} \ - --sign ${IDENTITY} \ - release/dcrinstall-${VERSION}/${EXE}.pkg - -# submit notarization -_uuid=$(notary_submit) - -# poll notarization status until no longer in-progress -set +ex -while :; do - sleep 60 - _date=$(date) - _output=$(notary_status ${_uuid}) - _status=$(echo "${_output}" | perl -ne 'print if s/^\s*Status: //') - echo "check at ${_date}: Status: ${_status}" - case ${_status} in - "in progress") - continue - ;; - "success") - # move on to stapling - break - ;; - "") - echo "warn: unknown status -- full output:\n${_output}" 2>&1 - continue - ;; - *) - echo "${_output}" 2>&1 - exit 1 - ;; - esac -done -set -ex - -# staple package with notarization ticket -stapler staple release/dcrinstall-${VERSION}/${EXE}.pkg diff --git a/release.sh b/release.sh deleted file mode 100755 index d1cfc6d..0000000 --- a/release.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# Copyright (c) 2019 The Decred developers -# Use of this source code is governed by the ISC -# license. - -set -e - -usage() { - echo "usage: release.sh version" 1>&2 - exit 2 -} - -[ $# -eq 1 ] || usage -TAG=$1 - -set -x - -GOVERSION=$(go version) -LDFLAGS="-buildid= -X main.appBuild=release" -SYS="darwin-amd64 freebsd-amd64 linux-386 linux-amd64 linux-arm linux-arm64 openbsd-amd64 windows-386 windows-amd64" - -PWD=$(pwd) -PACKAGE=dcrinstall -MAINDIR=$PWD/release/$PACKAGE-$TAG -MANIFEST=dcrinstall-${TAG}-manifest.txt - -[ -d ${MAINDIR} ] && rm -rf ${MAINDIR} -mkdir -p $MAINDIR - -for i in $SYS; do - OS=$(echo $i | cut -f1 -d-) - ARCH=$(echo $i | cut -f2 -d-) - OUT="$MAINDIR/dcrinstall-$i-$TAG" - if [[ $OS = "windows" ]]; then - OUT="$OUT.exe" - fi - ARM= - if [[ $ARCH = "arm" ]]; then - ARM=7 - fi - echo "Building:" $OS $ARCH - env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM GOFLAGS= \ - go build -trimpath -tags 'safe,netgo' -o $OUT -ldflags="${LDFLAGS}" ./cmd/dcrinstall -done - -( - cd ${MAINDIR} - openssl sha256 -r * > ${MANIFEST} - set +x - MANIFESTHASH=$(openssl sha256 ${MANIFEST}) - echo "${MANIFESTHASH} (${GOVERSION})" -)