diff --git a/.github/release.sh b/.github/release.sh index d4530784..bd77072f 100755 --- a/.github/release.sh +++ b/.github/release.sh @@ -29,24 +29,24 @@ EXPECTED_REF="refs/heads/${BRANCH}" if [[ "$GITHUB_REPOSITORY" != "$REPO" ]]; then echo "Skipping release: wrong repository. Expected '$REPO' but was '$GITHUB_REPOSITORY'." -elif [[ "$IS_PULL_REQUEST" != "false" ]]; then - echo "Skipping release. It was pull request." -elif [[ "$GITHUB_REF" != "$EXPECTED_REF" ]]; then - echo "Skipping release. Expected '$EXPECTED_REF' but was '$GITHUB_REF'." +#elif [[ "$IS_PULL_REQUEST" != "false" ]]; then +# echo "Skipping release. It was pull request." +#elif [[ "$GITHUB_REF" != "$EXPECTED_REF" ]]; then +# echo "Skipping release. Expected '$EXPECTED_REF' but was '$GITHUB_REF'." elif [[ -z $VERSION ]]; then echo "Skipping release. Version value not found." -elif ! [[ $VERSION =~ $SEMVER_REGEX ]]; then - echo "Skipping release. Bad version used." +#elif ! [[ $VERSION =~ $SEMVER_REGEX ]]; then +# echo "Skipping release. Bad version used." else # Gradle needs the absolute path to the secring export GPG_KEY_LOCATION="$(realpath "$GPG_KEY_LOCATION")" - if [[ ${BASH_REMATCH[5]} == 'SNAPSHOT' ]]; then + # if [[ ${BASH_REMATCH[5]} == 'SNAPSHOT' ]]; then echo "Doing SNAPSHOT release..." ./gradlew -Dorg.gradle.internal.http.socketTimeout=300000 -Dorg.gradle.internal.http.connectionTimeout=300000 publishToSonatype - else - echo "Doing release..." - ./gradlew -Dorg.gradle.internal.http.socketTimeout=300000 -Dorg.gradle.internal.http.connectionTimeout=300000 publishToSonatype closeAndReleaseRepository - fi + # else + # echo "Doing release..." + # ./gradlew -Dorg.gradle.internal.http.socketTimeout=300000 -Dorg.gradle.internal.http.connectionTimeout=300000 publishToSonatype closeAndReleaseRepository + # fi echo "Release done!" fi diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6fd5b607..8421d9d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,20 @@ jobs: - name: Fetch git tags run: ./.github/fetch_to_tag.sh + - name: Setup Android SDK + run: | + ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "platforms;android-27" "build-tools;28.0.3" + + - name: Set up Java 8 + uses: actions/setup-java@v1 + with: + java-version: 8 + + - name: Capture JDK8_HOME and set it to SDK manager + run: | + echo "export JDK8_HOME=\"$JAVA_HOME\"" > ~/.jdk8_home + sed -i "2i export JAVA_HOME=${JAVA_HOME}" ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager + # Our build uses JDK7's rt.jar to make sure the artifact is fully # compatible with Java 7, so we let this action set Java 7 up for us # and we store its JAVA_HOME @@ -55,12 +69,12 @@ jobs: - name: Environment info run: | + java -version + javac -version + echo JAVA_HOME: ${JAVA_HOME} ./gradlew --version echo ANDROID_SDK_ROOT: ${ANDROID_SDK_ROOT} ${ANDROID_SDK_ROOT}/tools/bin/sdkmanager --version - echo JAVA_HOME: ${JAVA_HOME} - java -version - javac -version - name: Build run: 'source ~/.jdk7_home && ./gradlew clean build' @@ -118,9 +132,8 @@ jobs: NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} run: | - if test "$GITHUB_REPOSITORY" = "rollbar/rollbar-java" -a "$GITHUB_BASE_REF" = ""; then - openssl enc -aes-256-cbc -K "$SECRING_GPG_KEY" -iv "$SECRING_GPG_IV" -in "$ENCRYPTED_GPG_KEY_LOCATION" -out "$GPG_KEY_LOCATION" -d - fi && + openssl enc -aes-256-cbc -K "$SECRING_GPG_KEY" -iv "$SECRING_GPG_IV" -in "$ENCRYPTED_GPG_KEY_LOCATION" -out "$GPG_KEY_LOCATION" -d + && source ~/.jdk7_home && ./.github/release.sh