Skip to content

Add support for publishing snapshot releases #316

Add support for publishing snapshot releases

Add support for publishing snapshot releases #316

# 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 project & run tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
publish:
runs-on: ubuntu-latest
if: github.repository == 'dropbox/AffectedModuleDetector' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up our JDK environment
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Publish Artifacts
run: ./gradlew publish --no-daemon --no-parallel
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
api-level:
- 31
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up our JDK environment
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
profile: Nexus 6
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew assemble testCoverage
env:
API_LEVEL: ${{ matrix.api-level }}
- name: Upload code coverage
run: bash <(curl -s https://codecov.io/bash)