mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-10 04:59:54 +00:00
Update release scripts
This commit is contained in:
@@ -28,15 +28,19 @@ rm -Rf target/releases/${VERSION}
|
||||
mkdir -p target/releases/${VERSION}
|
||||
pushd target/releases
|
||||
|
||||
darwinZipUrl="https://dist.apache.org/repos/dist/release/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-darwin-amd64.zip"
|
||||
darwinSha256="$(curl -L --silent "${darwinZipUrl}.sha256")"
|
||||
linuxZipUrl="https://dist.apache.org/repos/dist/release/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-linux-amd64.zip"
|
||||
darwinAmdZipUrl="https://downloads.apache.org/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-darwin-amd64.zip"
|
||||
darwinAmdSha256="$(curl -L --silent "${darwinAmdZipUrl}.sha256")"
|
||||
darwinArmZipUrl="https://downloads.apache.org/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-darwin-aarch64.zip"
|
||||
darwinArmSha256="$(curl -L --silent "${darwinArmZipUrl}.sha256")"
|
||||
linuxZipUrl="https://downloads.apache.org/maven/mvnd/${VERSION}/maven-mvnd-${VERSION}-linux-amd64.zip"
|
||||
linuxSha256="$(curl -L --silent "${linuxZipUrl}.sha256")"
|
||||
|
||||
echo "Updating Formula/mvnd.rb with"
|
||||
echo "version: ${VERSION}"
|
||||
echo "darwin-url: ${darwinZipUrl}"
|
||||
echo "darwin-sha256: ${darwinSha256}"
|
||||
echo "darwin-amd-url: ${darwinAmdZipUrl}"
|
||||
echo "darwin-amd-sha256: ${darwinAmdSha256}"
|
||||
echo "darwin-arm-url: ${darwinArmZipUrl}"
|
||||
echo "darwin-arm-sha256: ${darwinArmSha256}"
|
||||
echo "linux-url: ${linuxZipUrl}"
|
||||
echo "linux-sha256: ${linuxSha256}"
|
||||
|
||||
@@ -44,7 +48,8 @@ rm -Rf homebrew-mvnd
|
||||
git clone https://github.com/mvndaemon/homebrew-mvnd.git
|
||||
cd homebrew-mvnd
|
||||
|
||||
perl -i -0pe 's|(on_macos do\n\s+url )\"([^\"]+)\"(\n\s+sha256 )\"([^\"]+)\"|$1\"'${darwinZipUrl}'\"$3\"'${darwinSha256}'\"|g' Formula/mvnd.rb
|
||||
perl -i -0pe 's|(on_macos do[\s\S\n]+on_intel\n\s+url )\"([^\"]+)\"(\n\s+sha256 )\"([^\"]+)\"|$1\"'${darwinAmdZipUrl}'\"$3\"'${darwinAmdSha256}'\"|g' Formula/mvnd.rb
|
||||
perl -i -0pe 's|(on_macos do[\s\S\n]+on_arm\n\s+url )\"([^\"]+)\"(\n\s+sha256 )\"([^\"]+)\"|$1\"'${darwinArmZipUrl}'\"$3\"'${darwinArmSha256}'\"|g' Formula/mvnd.rb
|
||||
perl -i -0pe 's|(on_linux do\n\s+url )\"([^\"]+)\"(\n\s+sha256 )\"([^\"]+)\"|$1\"'${linuxZipUrl}'\"$3\"'${linuxSha256}'\"|g' Formula/mvnd.rb
|
||||
perl -i -0pe 's|(version )"([^\"]+)"|$1\"'${VERSION}'\"|g' Formula/mvnd.rb
|
||||
|
||||
|
@@ -38,7 +38,7 @@ function publishRelease() {
|
||||
MVND_PLATFORM=$3
|
||||
|
||||
FILE="maven-mvnd-${VERSION}-${MVND_PLATFORM}.zip"
|
||||
URL="https://dist.apache.org/repos/dist/release/maven/mvnd/${VERSION}/${FILE}"
|
||||
URL="https://downloads.apache.org/maven/mvnd/${VERSION}/${FILE}"
|
||||
RESPONSE="$(curl -s -X POST \
|
||||
-H "Consumer-Key: ${SDKMAN_CONSUMER_KEY}" \
|
||||
-H "Consumer-Token: ${SDKMAN_CONSUMER_TOKEN}" \
|
||||
@@ -60,6 +60,7 @@ function publishRelease() {
|
||||
|
||||
publishRelease ${VERSION} LINUX_64 linux-amd64
|
||||
publishRelease ${VERSION} MAC_OSX darwin-amd64
|
||||
publishRelease ${VERSION} MAC_ARM64 darwin-aarch64
|
||||
publishRelease ${VERSION} WINDOWS_64 windows-amd64
|
||||
|
||||
echo "Setting ${VERSION} as a default"
|
||||
@@ -81,7 +82,7 @@ node -pe "
|
||||
}
|
||||
" "${RESPONSE}"
|
||||
|
||||
RELEASE_URL=`curl -s -i https://git.io -F url=https://dist.apache.org/repos/dist/release/maven/mvnd/${VERSION} | grep Location | sed -e 's/Location: //g' | tr -d '\n' | tr -d '\r'`
|
||||
RELEASE_URL=`curl -s -i https://git.io -F url=https://downloads.apache.org/maven/mvnd/${VERSION} | grep Location | sed -e 's/Location: //g' | tr -d '\n' | tr -d '\r'`
|
||||
echo "RELEASE_URL = $RELEASE_URL"
|
||||
|
||||
RESPONSE="$(curl -s -X POST \
|
||||
|
@@ -48,7 +48,7 @@ gh api $downloadUrl > artifacts-${VERSION}.zip
|
||||
unzip artifacts-${VERSION}.zip -d ${VERSION}
|
||||
cd ${VERSION}
|
||||
|
||||
for dist in darwin-amd64.zip linux-amd64.zip windows-amd64.zip src.zip src.tar.gz
|
||||
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
|
||||
do
|
||||
FILE=maven-mvnd-${VERSION}-${dist}
|
||||
shasum -a 256 -b ${FILE} | cut -d ' ' -f 1 > ${FILE}.sha256
|
||||
|
Reference in New Issue
Block a user