Skip to content

Commit

Permalink
[CI] Upload sha256 files for each artifact (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bencodes authored Mar 28, 2022
1 parent 49af16e commit dd6a222
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lyft-scripts/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

# Set the version here! This should be updated on every patch and every MapLibre version change.
readonly VERSION_NAME="9.5.2-patch-1"
readonly VERSION_NAME="9.5.2-patch-2"

# Set the artifact ID, artifact name, & artifactory URL here. This shouldn't change.
readonly ARTIFACT_ID="android-sdk"
Expand Down Expand Up @@ -60,6 +60,7 @@ $NDK_HOME/toolchains/x86_64-4.9/prebuilt/linux-x86_64/bin/x86_64-linux-android-o

# Create tar file in dist directory from symbol mapping files
tar -cvf "dist/${ARTIFACT_NAME}.tar" "dist/symbols/"
shasum -a 256 "dist/${ARTIFACT_NAME}.tar" | cut -d ' ' -f 1 > "dist/${ARTIFACT_NAME}.tar.sha256"

# Update VERSION_NAME property in gradle.properties. Some of this is copied from .github/workflows/android-release.yml
sed -i -e "s/^VERSION_NAME=.*/VERSION_NAME=${VERSION_NAME}/" MapboxGLAndroidSDK/gradle.properties
Expand All @@ -73,15 +74,20 @@ cat MapboxGLAndroidSDK/build/publications/release/pom-default.xml

# Copy pom file to dist directory and rename to pom.xml
mv MapboxGLAndroidSDK/build/publications/release/pom-default.xml "dist/${ARTIFACT_NAME}.pom"
shasum -a 256 "dist/${ARTIFACT_NAME}.pom" | cut -d ' ' -f 1 > "dist/${ARTIFACT_NAME}.pom.sha256"

# Move library to dist directory
mv MapboxGLAndroidSDK/build/outputs/aar/MapboxGLAndroidSDK-release.aar "dist/${ARTIFACT_NAME}.aar"
shasum -a 256 "dist/${ARTIFACT_NAME}.aar" | cut -d ' ' -f 1 > "dist/${ARTIFACT_NAME}.aar.sha256"

# Print contents of dist directory
echo "Printing contents of dist directory:"
ls -a dist

# Upload artifacts to artifactory
curl -u "${ARTIFACTORY_USER}:${ARTIFACTORY_PASS}" -X PUT "${ARTIFACTORY_URL}/${ARTIFACT_NAME}.aar" -T "dist/${ARTIFACT_NAME}.aar"
curl -u "${ARTIFACTORY_USER}:${ARTIFACTORY_PASS}" -X PUT "${ARTIFACTORY_URL}/${ARTIFACT_NAME}.aar.sha256" -T "dist/${ARTIFACT_NAME}.aar.sha256"
curl -u "${ARTIFACTORY_USER}:${ARTIFACTORY_PASS}" -X PUT "${ARTIFACTORY_URL}/${ARTIFACT_NAME}.pom" -T "dist/${ARTIFACT_NAME}.pom"
curl -u "${ARTIFACTORY_USER}:${ARTIFACTORY_PASS}" -X PUT "${ARTIFACTORY_URL}/${ARTIFACT_NAME}.pom.sha256" -T "dist/${ARTIFACT_NAME}.pom.sha256"
curl -u "${ARTIFACTORY_USER}:${ARTIFACTORY_PASS}" -X PUT "${ARTIFACTORY_URL}/${ARTIFACT_NAME}.tar" -T "dist/${ARTIFACT_NAME}.tar"
curl -u "${ARTIFACTORY_USER}:${ARTIFACTORY_PASS}" -X PUT "${ARTIFACTORY_URL}/${ARTIFACT_NAME}.tar.sha256" -T "dist/${ARTIFACT_NAME}.tar.sha256"

0 comments on commit dd6a222

Please sign in to comment.