diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73f611c..129995c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -257,9 +257,11 @@ jobs: run: chmod +x gradlew working-directory: android - - name: Unit test + - name: Publish to Maven Central env: - GITHUB_ACTOR: ${{ github.actor }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew publishToMavenCentral + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache working-directory: android diff --git a/scripts/deprecated/build_android_legacy.sh b/scripts/deprecated/build_android_legacy.sh deleted file mode 100755 index 893b710..0000000 --- a/scripts/deprecated/build_android_legacy.sh +++ /dev/null @@ -1,37 +0,0 @@ -# Android SDK and NDK -export ANDROID_SDK=~/Library/Android/sdk -# TODO: Handle getting a dynamic ndk path? -export NDK_DIR=$ANDROID_SDK/ndk/26.2.11394342 # <-- Update with the correct NDK path -# Android toolchain -export TOOLCHAIN_FILE=$NDK_DIR/build/cmake/android.toolchain.cmake - -# TODO: Handle the abi and target as based on arguments -android_abis=("arm64-v8a" "armeabi-v7a" "x86" "x86_64") -android_targets=("aarch64-linux-android" "armv7a-linux-androideabi" "i686-linux-android" "x86_64-linux-android") - -export ABI=$1 -export TARGET=aarch64-linux-android -export ANDROID_PLATFORM=android-28 - -export PROTOBUF_LOCAL_DIR=`pwd`/protoc - -export BUILD_DIR=`pwd`/build/android/$ABI/wrapper -export WRAPPER_DIR=`pwd`/src - -mkdir -p $BUILD_DIR && cd $BUILD_DIR - -cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DENABLE_TOOLS=OFF -DENABLE_DATA_TOOLS=OFF \ - -DENABLE_PYTHON_BINDINGS=OFF -DENABLE_NODE_BINDINGS=OFF -DENABLE_HTTP=OFF -DENABLE_SERVICES=OFF \ - -DENABLE_TESTS=OFF -DENABLE_BENCHMARKS=OFF \ - -DENABLE_STATIC_LIBRARY_MODULES=ON \ - -DProtobuf_PROTOC_EXECUTABLE=$PROTOBUF_LOCAL_DIR/bin/protoc \ - -DANDROID_ABI=$ABI \ - -DANDROID_PLATFORM=$ANDROID_PLATFORM \ - -DANDROID_NDK=$NDK_DIR \ - -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE \ - -S $WRAPPER_DIR \ - -B . - -make -j$(nproc) \ No newline at end of file diff --git a/scripts/deprecated/build_apple_legacy.sh b/scripts/deprecated/build_apple_legacy.sh deleted file mode 100755 index 5784a3e..0000000 --- a/scripts/deprecated/build_apple_legacy.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash - -# DEPRECATED: This script was only tested on Valhalla 3.4.0 and is now deprecated. -echo "DEPRECATED: This script was only tested on Valhalla 3.4.0 and is now deprecated." -exit 1 - -# Check if the first argument is a valid Apple architecture -if [ "$1" == "iphoneos" ]; then - export SDK="iphoneos" - export SYSTEM_NAME="iOS" - export OSX_DEPLOYMENT_TARGET="13.0" - export OSX_ARCHITECTURE="arm64" -elif [ "$1" == "iphonesimulator" ]; then - export SDK="iphonesimulator" - export SYSTEM_NAME="iOS" - export OSX_DEPLOYMENT_TARGET="13.0" - export OSX_ARCHITECTURE="arm64" -elif [ "$1" == "iphonesimulator-legacy" ]; then - export SDK="iphonesimulator" - export SYSTEM_NAME="iOS" - export OSX_DEPLOYMENT_TARGET="13.0" - export OSX_ARCHITECTURE="x86_64" -elif [ "$1" == "macos" ]; then - export SDK="macosx" - export SYSTEM_NAME="Darwin" - export OSX_DEPLOYMENT_TARGET="10.14" - export OSX_ARCHITECTURE="arm64" # TODO: Add x86_64 for older macs? -elif [ "$1" == "tvos" ]; then - echo "Error tvos not supported yet." # error: 'fork' is unavailable: not available on watchOS, tvOS (& 'execvp') - exit 1 - export SDK="appletvos" - export SYSTEM_NAME="tvOS" - export OSX_DEPLOYMENT_TARGET="13.0" - export OSX_ARCHITECTURE="arm64" -elif [ "$1" == "watchos" ]; then - echo "Error watchos not supported yet." # error: 'fork' is unavailable: not available on watchOS, tvOS (& 'execvp') - exit 1 - export SDK="watchos" - export SYSTEM_NAME="watchOS" - export OSX_DEPLOYMENT_TARGET="6.0" - export OSX_ARCHITECTURE="arm64" -elif [ "$1" == "visionos" ]; then - echo "Error visionos not supported yet." - exit 1 -else - echo "Error, first argument must be apple platform: iphoneos, iphonesimulator, macos, tvos, watchos, visionos" - exit 1 -fi - -# Protobuf built locally. This is simply to build headers with a matching protoc version on the local machine. -export PROTOBUF_LOCAL_DIR=`pwd`/protoc - -# Check if protoc is available in the local directory -if [ ! -f $PROTOBUF_LOCAL_DIR/bin/protoc ]; then - echo "Error: protoc not found in the local directory. Please run build_protoc_local.sh first." - exit 1 -fi - -export BUILD_DIR=`pwd`/build/apple/$OSX_ARCHITECTURE/$SDK/wrapper -export WRAPPER_DIR=`pwd`/src - -mkdir -p $BUILD_DIR && cd $BUILD_DIR - -cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DENABLE_SINGLE_FILES_WERROR=OFF -DENABLE_WERROR=OFF -DENABLE_TOOLS=OFF -DENABLE_DATA_TOOLS=OFF \ - -DENABLE_SERVICES=OFF -DENABLE_PYTHON_BINDINGS=OFF -DENABLE_NODE_BINDINGS=OFF -DENABLE_HTTP=OFF \ - -DENABLE_TESTS=OFF -DENABLE_BENCHMARKS=OFF \ - -DENABLE_STATIC_LIBRARY_MODULES=ON \ - -DProtobuf_PROTOC_EXECUTABLE=$PROTOBUF_LOCAL_DIR/bin/protoc \ - -DBoost_INCLUDE_DIR=/opt/homebrew/include \ - -DCMAKE_SYSTEM_NAME=$SYSTEM_NAME \ - -DCMAKE_OSX_SYSROOT=$SDK \ - -DCMAKE_OSX_ARCHITECTURES=$OSX_ARCHITECTURE \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=$OSX_DEPLOYMENT_TARGET \ - -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \ - -S $WRAPPER_DIR \ - -B . \ - -G Xcode - -cmake --build $BUILD_DIR --config Release --target install -- -sdk $SDK diff --git a/scripts/deprecated/build_protoc_local.sh b/scripts/deprecated/build_protoc_local.sh deleted file mode 100755 index ce42a22..0000000 --- a/scripts/deprecated/build_protoc_local.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -mkdir -p protoc && cd protoc -export BUILD_DIR=`pwd` - -echo "Building protobuf/protoc into $BUILD_DIR" - -# Download and extract protobuf source code -PROTOBUF_VERSION=3.20.3 -wget -nc https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOBUF_VERSION/protobuf-cpp-$PROTOBUF_VERSION.tar.gz -tar xvf protobuf-cpp-$PROTOBUF_VERSION.tar.gz -cd protobuf-$PROTOBUF_VERSION - -# Build protobuf -./autogen.sh -./configure --prefix=$BUILD_DIR CFLAGS="-fPIC -DGOOGLE_PROTOBUF_NO_RTTI" CXXFLAGS="-fPIC -DGOOGLE_PROTOBUF_NO_RTTI" -make -j$(nproc) -make install - -echo "Done building protobuf/protoc into $BUILD_DIR/protobuf-install" \ No newline at end of file diff --git a/scripts/deprecated/gen_config.sh b/scripts/deprecated/gen_config.sh deleted file mode 100755 index 6b19eac..0000000 --- a/scripts/deprecated/gen_config.sh +++ /dev/null @@ -1,6 +0,0 @@ -#/bin/sh - -mkdir -p apple/Sources/Generated/Config -quicktype apple/Tests/TestData/config.json \ - --access-level public --top-level ValhallaConfig \ - -o apple/Sources/Generated/Config/ValhallaConfig.swift \ No newline at end of file diff --git a/scripts/deprecated/gen_model_openapi.sh b/scripts/deprecated/gen_model_openapi.sh deleted file mode 100755 index 793d0d2..0000000 --- a/scripts/deprecated/gen_model_openapi.sh +++ /dev/null @@ -1,37 +0,0 @@ -#/bin/sh - -apple_generated_dir="apple/Sources/Generated" -android_generated_dir="android/valhalla/src/main/java/com/valhalla/generated" - -if [ "$1" == "clean" ]; then - echo "Cleaning openapi models..." - rm -rf .openapi-temp - rm -rf "$apple_generated_dir/Models" - rm -rf android/valhalla/src/main/java/com/valhalla/models -fi - - -mkdir -p .openapi-temp -mkdir -p $apple_generated_dir/Models/Support -mkdir -p $android_generated_dir/models/support - -echo "Generating Valhalla Swift..." - -openapi-generator generate -i ./openapi.yaml -g swift5 --strict-spec=true \ - -o .openapi-temp --model-package Models --skip-validate-spec -swiftformat .openapi-temp/OpenAPIClient/Classes/OpenAPIsModels - -# Move the generated files to the correct directory -mv .openapi-temp/OpenAPIClient/Classes/OpenAPIsModels/* $apple_generated_dir/Models -mv .openapi-temp/OpenAPIClient/Classes/OpenAPIs/Models.swift $apple_generated_dir/Models/Support/Models.swift -mv .openapi-temp/OpenAPIClient/Classes/OpenAPIs/Validation.swift $apple_generated_dir/Models/Support/Validation.swift - -echo "Generating Valhalla Kotlin..." - -openapi-generator generate -i ./openapi.yaml -g kotlin --strict-spec=true \ - -o .openapi-temp --model-package Models --skip-validate-spec -p useKotlinStandardLibrary=true - -mv .openapi-temp/src/main/kotlin/Models/* $android_generated_dir/models - -echo "Done" -