Skip to content

Merge pull request #538 from dropbox/jfein/version-bump #209

Merge pull request #538 from dropbox/jfein/version-bump

Merge pull request #538 from dropbox/jfein/version-bump #209

Workflow file for this run

# This workflow will build the project with Gradle, run integration tests, and release.
# Because secrets are not available on external forks, this job is expected to fail
# on external pull requests.
name: Build, Check, Publish
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'zulu'
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9.14'
- run: python -m pip install ply && pip install six
- name: Grant execute permissions
run: chmod +x gradlew
&& chmod +x update-submodules
&& chmod +x generate-ci-auth-file
&& chmod +x scripts/check-clean-git-status
- name: Set up submodules
run: ./update-submodules
- name: Generate Stone
run: ./gradlew :core:generateStone
- name: Ensure no changes in Generated Code
run: ./scripts/check-clean-git-status
- name: Obtain oauth access token for integration tests
env:
APP_KEY: ${{ secrets.APP_KEY }}
APP_SECRET: ${{ secrets.APP_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
run: ./generate-ci-auth-file
- name: Ensure Binary Compatibility
run: ./gradlew :core:apiCheck :android:apiCheck
- name: Dependency Guard
run: ./gradlew dependencyGuard
- name: Check
run: ./gradlew check
- name: Run Integration Tests for Examples
run: ./gradlew :examples:examples:test :examples:java:test -Pci=true --info
- name: Run Integration Tests - OkHttpRequestor
run: ./gradlew -Pcom.dropbox.test.httpRequestor=OkHttpRequestor -Pcom.dropbox.test.authInfoFile=../auth_output integrationTest &&
./gradlew -Pcom.dropbox.test.httpRequestor=OkHttpRequestor -Pcom.dropbox.test.authInfoFile=../auth_output proguardTest
- name: Run Integration Tests - OkHttp3Requestor
run: ./gradlew -Pcom.dropbox.test.httpRequestor=OkHttp3Requestor -Pcom.dropbox.test.authInfoFile=../auth_output integrationTest &&
./gradlew -Pcom.dropbox.test.httpRequestor=OkHttp3Requestor -Pcom.dropbox.test.authInfoFile=../auth_output proguardTest
- name: Run Integration Tests - StandardHttpRequestor
run: ./gradlew -Pcom.dropbox.test.httpRequestor=StandardHttpRequestor -Pcom.dropbox.test.authInfoFile=../auth_output integrationTest &&
./gradlew -Pcom.dropbox.test.httpRequestor=StandardHttpRequestor -Pcom.dropbox.test.authInfoFile=../auth_output proguardTest
publish:
runs-on: ubuntu-latest
if: github.repository == 'dropbox/dropbox-sdk-java' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Install JDK 11
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9.14'
- run: python -m pip install ply && pip install six
- name: Grant execute permissions
run: chmod +x gradlew && chmod +x update-submodules
- name: Update submodules
run: ./update-submodules
- name: Upload Artifacts
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
- name: Retrieve version
run: |
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV
- name: Publish Release to Maven Central
run: ./gradlew closeAndReleaseRepository --no-daemon --no-parallel
if: "!endsWith(env.VERSION_NAME, '-SNAPSHOT')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
- name: Upload Test Reports
uses: actions/upload-artifact@v3
with:
name: TestReports
path: |
core/build/reports/
android/build/reports/
- name: Upload JavaDocs
uses: actions/upload-artifact@v3
with:
name: JavaDocs
path: |
core/build/docs/javadoc/
android/build/docs/javadoc/
- name: Upload Build Artifacts
uses: actions/upload-artifact@v3
with:
name: BuildArtifacts
path: |
core/build/distributions/
android/build/distributions/