release: finalize unified particle.7
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
This commit is contained in:
@@ -23,7 +23,7 @@ if [[ -d /usr/local/opt/gnu-sed/libexec/gnubin ]]; then
|
||||
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
|
||||
fi
|
||||
|
||||
for cmd in git python3 node npm java curl ssh scp shasum bazel xcodebuild ruby tar cmp awk sed; do require "$cmd"; done
|
||||
for cmd in git python3 node npm java curl ssh shasum bazel xcodebuild ruby tar cmp awk sed; do require "$cmd"; done
|
||||
[[ -d "$ANDROID_NDK_HOME" ]] || die "NDK missing: $ANDROID_NDK_HOME"
|
||||
[[ -x "$ROOT/platform/android/gradlew" ]] || die "Gradle wrapper missing"
|
||||
|
||||
@@ -129,20 +129,61 @@ publish_release() {
|
||||
require_absent "$ANDROID_URL"
|
||||
require_absent "$RN_URL"
|
||||
require_absent "$IOS_URL"
|
||||
ssh nas "test ! -e /volume1/work/pbf/maven/cc/navsea/maplibre/android-sdk-particle-opengl/$ANDROID_VERSION" || die "remote Android version exists"
|
||||
ssh nas "test ! -e /volume1/work/pbf/npm/$TGZ_NAME" || die "remote RN tgz exists"
|
||||
ssh nas "test ! -e /volume1/work/pbf/swift/maplibre-particle/$IOS_VERSION" || die "remote iOS version exists"
|
||||
ssh nas "mkdir -p /volume1/work/pbf/maven/cc/navsea/maplibre/android-sdk-particle-opengl/$ANDROID_VERSION /volume1/work/pbf/swift/maplibre-particle/$IOS_VERSION"
|
||||
scp "$M2_DIR"/* "nas:/volume1/work/pbf/maven/cc/navsea/maplibre/android-sdk-particle-opengl/$ANDROID_VERSION/"
|
||||
scp "$ARTIFACT_DIR/$TGZ_NAME" "nas:/volume1/work/pbf/npm/$TGZ_NAME"
|
||||
scp "$ARTIFACT_DIR/$IOS_ZIP_NAME" "nas:/volume1/work/pbf/swift/maplibre-particle/$IOS_VERSION/$IOS_ZIP_NAME"
|
||||
IOS_SHA="$(shasum -a 256 "$ARTIFACT_DIR/$IOS_ZIP_NAME" | awk '{print $1}')"
|
||||
printf '%s %s\n' "$IOS_SHA" "$IOS_ZIP_NAME" > "$ARTIFACT_DIR/$IOS_ZIP_NAME.sha256"
|
||||
scp "$ARTIFACT_DIR/$IOS_ZIP_NAME.sha256" "nas:/volume1/work/pbf/swift/maplibre-particle/$IOS_VERSION/$IOS_ZIP_NAME.sha256"
|
||||
|
||||
local source_commit
|
||||
local android_root android_final android_tmp
|
||||
local rn_final rn_tmp
|
||||
local ios_root ios_final ios_tmp
|
||||
local aar_sha rn_sha ios_sha
|
||||
local remote_aar_sha remote_rn_sha remote_ios_sha
|
||||
local pom_name module_name
|
||||
|
||||
source_commit="$(git -C "$ROOT" rev-parse HEAD)"
|
||||
android_root="/volume1/work/pbf/maven/cc/navsea/maplibre/android-sdk-particle-opengl"
|
||||
android_final="$android_root/$ANDROID_VERSION"
|
||||
android_tmp="$android_root/.$ANDROID_VERSION.uploading"
|
||||
rn_final="/volume1/work/pbf/npm/$TGZ_NAME"
|
||||
rn_tmp="/volume1/work/pbf/npm/.$TGZ_NAME.uploading"
|
||||
ios_root="/volume1/work/pbf/swift/maplibre-particle"
|
||||
ios_final="$ios_root/$IOS_VERSION"
|
||||
ios_tmp="$ios_root/.$IOS_VERSION.uploading"
|
||||
pom_name="android-sdk-particle-opengl-$ANDROID_VERSION.pom"
|
||||
module_name="android-sdk-particle-opengl-$ANDROID_VERSION.module"
|
||||
|
||||
ssh nas "test ! -e '$android_final'" || die "remote Android version exists"
|
||||
ssh nas "test ! -e '$rn_final'" || die "remote RN tgz exists"
|
||||
ssh nas "test ! -e '$ios_final'" || die "remote iOS version exists"
|
||||
|
||||
aar_sha="$(shasum -a 256 "$ARTIFACT_DIR/$AAR_NAME" | awk '{print $1}')"
|
||||
rn_sha="$(shasum -a 256 "$ARTIFACT_DIR/$TGZ_NAME" | awk '{print $1}')"
|
||||
ios_sha="$(shasum -a 256 "$ARTIFACT_DIR/$IOS_ZIP_NAME" | awk '{print $1}')"
|
||||
printf '%s %s\n' "$ios_sha" "$IOS_ZIP_NAME" > "$ARTIFACT_DIR/$IOS_ZIP_NAME.sha256"
|
||||
|
||||
note "uploading release artifacts through SSH staging paths"
|
||||
ssh nas "rm -rf '$android_tmp' '$ios_tmp' '$rn_tmp'; mkdir -p '$android_tmp' '$ios_tmp'"
|
||||
tar -C "$M2_DIR" -cf - . | ssh nas "tar -C '$android_tmp' -xf -"
|
||||
ssh nas "cat > '$rn_tmp'" < "$ARTIFACT_DIR/$TGZ_NAME"
|
||||
ssh nas "cat > '$ios_tmp/$IOS_ZIP_NAME'" < "$ARTIFACT_DIR/$IOS_ZIP_NAME"
|
||||
ssh nas "cat > '$ios_tmp/$IOS_ZIP_NAME.sha256'" < "$ARTIFACT_DIR/$IOS_ZIP_NAME.sha256"
|
||||
|
||||
remote_aar_sha="$(ssh nas "sha256sum '$android_tmp/$AAR_NAME' | awk '{print \$1}'")"
|
||||
remote_rn_sha="$(ssh nas "sha256sum '$rn_tmp' | awk '{print \$1}'")"
|
||||
remote_ios_sha="$(ssh nas "sha256sum '$ios_tmp/$IOS_ZIP_NAME' | awk '{print \$1}'")"
|
||||
[[ "$remote_aar_sha" == "$aar_sha" ]] || die "NAS Android checksum mismatch"
|
||||
[[ "$remote_rn_sha" == "$rn_sha" ]] || die "NAS RN checksum mismatch"
|
||||
[[ "$remote_ios_sha" == "$ios_sha" ]] || die "NAS iOS checksum mismatch"
|
||||
|
||||
note "atomically promoting NAS staging paths"
|
||||
ssh nas "test ! -e '$android_final' && test ! -e '$rn_final' && test ! -e '$ios_final' && mv '$android_tmp' '$android_final' && mv '$rn_tmp' '$rn_final' && mv '$ios_tmp' '$ios_final'"
|
||||
|
||||
verify_public_file "$ARTIFACT_DIR/$AAR_NAME" "$ANDROID_URL"
|
||||
verify_public_file "$M2_DIR/$pom_name" "https://pbf.jpcn.ccwu.cc/maven/cc/navsea/maplibre/android-sdk-particle-opengl/$ANDROID_VERSION/$pom_name"
|
||||
verify_public_file "$M2_DIR/$module_name" "https://pbf.jpcn.ccwu.cc/maven/cc/navsea/maplibre/android-sdk-particle-opengl/$ANDROID_VERSION/$module_name"
|
||||
verify_public_file "$ARTIFACT_DIR/$TGZ_NAME" "$RN_URL"
|
||||
verify_public_file "$ARTIFACT_DIR/$IOS_ZIP_NAME" "$IOS_URL"
|
||||
python3 "$SCRIPT_DIR/publish_swiftpm.py" "$IOS_VERSION" "$IOS_SHA"
|
||||
verify_public_file "$ARTIFACT_DIR/$IOS_ZIP_NAME.sha256" "$IOS_URL.sha256"
|
||||
|
||||
python3 "$SCRIPT_DIR/publish_swiftpm.py" "$IOS_VERSION" "$ios_sha"
|
||||
git ls-remote "$SPM_URL" "refs/tags/$IOS_VERSION" | grep -q . || die "public SwiftPM tag missing"
|
||||
|
||||
export PARTICLE_NDK_VERSION="28.2.13676358"
|
||||
@@ -150,7 +191,7 @@ publish_release() {
|
||||
export PARTICLE_JDK_VERSION="$(java -version 2>&1 | head -1)"
|
||||
export PARTICLE_XCODE_VERSION="$(xcodebuild -version | tr '\n' ' ')"
|
||||
export PARTICLE_BAZEL_VERSION="$(bazel --version)"
|
||||
python3 "$SCRIPT_DIR/finalize_release.py" "$REV" "$(git -C "$ROOT" rev-parse HEAD)" "$ARTIFACT_DIR"
|
||||
python3 "$SCRIPT_DIR/finalize_release.py" "$REV" "$source_commit" "$ARTIFACT_DIR"
|
||||
git -C "$ROOT" diff --check
|
||||
note "publish and public readback passed"
|
||||
}
|
||||
@@ -163,10 +204,13 @@ finalize_release() {
|
||||
release/maplibre-particle/ios/README.md
|
||||
if ! git -C "$ROOT" diff --cached --quiet; then git -C "$ROOT" commit -m "release: finalize unified particle.$REV"; fi
|
||||
TAG="maplibre-particle/rn/$ANDROID_VERSION"
|
||||
[[ -z "$(git -C "$ROOT" tag -l "$TAG")" ]] || die "local tag exists: $TAG"
|
||||
git -C "$ROOT" fetch origin particle/main
|
||||
git -C "$ROOT" merge-base --is-ancestor origin/particle/main HEAD || die "origin/particle/main is not an ancestor of release HEAD"
|
||||
git -C "$ROOT" tag -a "$TAG" -m "Unified Android/iOS Particle release $ANDROID_VERSION"
|
||||
if [[ -n "$(git -C "$ROOT" tag -l "$TAG")" ]]; then
|
||||
[[ "$(git -C "$ROOT" rev-list -n 1 "$TAG")" == "$(git -C "$ROOT" rev-parse HEAD)" ]] || die "local tag points to a different commit: $TAG"
|
||||
else
|
||||
git -C "$ROOT" tag -a "$TAG" -m "Unified Android/iOS Particle release $ANDROID_VERSION"
|
||||
fi
|
||||
git -C "$ROOT" push origin HEAD:particle/main
|
||||
git -C "$ROOT" push origin "$TAG"
|
||||
note "RELEASE_PASS version=$ANDROID_VERSION ios=$IOS_VERSION tag=$TAG"
|
||||
|
||||
Reference in New Issue
Block a user