Fix release candidate script (#1024)

Just use gh for all.
This commit is contained in:
Tamas Cservenak
2024-06-14 16:06:17 +02:00
committed by GitHub
parent 0d2c63ad0e
commit 0e60f9ba39

View File

@@ -36,31 +36,23 @@ then
exit 1
fi
rm -Rf target/releases/${VERSION}
mkdir -p target/releases/${VERSION}
pushd target/releases
rm -Rf target/releases/mvnd/${VERSION}
mkdir -p target/releases/mvnd/${VERSION}
pushd target/releases/mvnd/${VERSION}
runsUrl=$(echo "https://api.github.com/repos/apache/maven-mvnd/actions/runs" | sed -e 's?https://api.github.com??g')
artifactsUrl=$(gh api -H "Accept: application/vnd.github.v3+json" $runsUrl --jq '.workflow_runs[] | select(.name=="Release" and .head_branch=="'${VERSION}'") | .artifacts_url' | sed -e 's?https://api.github.com??g')
downloadUrl=$(gh api -H "Accept: application/vnd.github.v3+json" $artifactsUrl --jq '.artifacts[] | select(.name = "artifacts") | .archive_download_url' | sed -e 's?https://api.github.com??g')
echo "Downloading artifacts from $downloadUrl"
gh api $downloadUrl > artifacts-${VERSION}.zip
unzip artifacts-${VERSION}.zip -d ${VERSION}
cd ${VERSION}
gh release download ${VERSION}
for dist in darwin-amd64.zip darwin-amd64.tar.gz darwin-aarch64.zip darwin-aarch64.tar.gz linux-amd64.zip linux-amd64.tar.gz windows-amd64.zip windows-amd64.tar.gz src.zip src.tar.gz
for dist in maven-mvnd*.*
do
FILE=maven-mvnd-${VERSION}-${dist}
echo "Processing ${dist}"
# sha256 are used by homebrew which does not support sha512 atm
shasum -a 256 -b ${FILE} | cut -d ' ' -f 1 > ${FILE}.sha256
shasum -a 512 -b ${FILE} | cut -d ' ' -f 1 > ${FILE}.sha512
gpg --detach-sign --armor ${FILE}
shasum -a 256 -b ${dist} | cut -d ' ' -f 1 > ${dist}.sha256
shasum -a 512 -b ${dist} | cut -d ' ' -f 1 > ${dist}.sha512
gpg --detach-sign --armor ${dist}
done
cd ..
svn co https://dist.apache.org/repos/dist/dev/maven/mvnd
mv ${VERSION} mvnd
cd mvnd
svn add ${VERSION}
svn commit -m "Release Apache Maven Daemon ${VERSION}"