Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release candidate script #1024

Merged
merged 4 commits into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 9 additions & 17 deletions build/release-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down