87 lines
2.3 KiB
YAML
87 lines
2.3 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- '**.md'
|
|
- 'docs/**'
|
|
pull_request:
|
|
paths-ignore:
|
|
- '**.md'
|
|
- 'docs/**'
|
|
|
|
jobs:
|
|
build:
|
|
# Skip build if head commit contains 'skip ci'
|
|
if: "!contains(github.event.head_commit.message, 'skip ci')"
|
|
|
|
runs-on: macos-latest
|
|
timeout-minutes: 60
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup JDK
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: 21
|
|
|
|
- uses: gradle/gradle-build-action@v3
|
|
|
|
- name: Check
|
|
run: |
|
|
./gradlew check \
|
|
-Pandroidx.baselineprofile.skipgeneration \
|
|
-x pixel5Api30NonMinifiedReleaseAndroidTest \
|
|
-x pixel5Api34NonMinifiedReleaseAndroidTest \
|
|
-x testNonMinifiedReleaseUnitTest \
|
|
-x testBenchmarkReleaseUnitTest \
|
|
-x metalavaCheckCompatibilityDebug
|
|
|
|
- name: Build samples
|
|
run: |
|
|
./gradlew :sample:android:assemble \
|
|
:sample:desktop:assemble \
|
|
:sample:shared:assemble \
|
|
-x assembleBenchmarkRelease \
|
|
-x assembleNonMinifiedRelease
|
|
|
|
- name: Upload reports + Roborazzi outputs
|
|
if: failure()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: reports
|
|
path: |
|
|
**/build/reports/**
|
|
**/build/outputs/roborazzi/**
|
|
|
|
deploy:
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
runs-on: macos-14
|
|
needs: [ build ]
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup JDK
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: 21
|
|
|
|
- uses: gradle/gradle-build-action@v3
|
|
|
|
- name: Deploy to Sonatype
|
|
run: ./gradlew publish --no-configuration-cache
|
|
env:
|
|
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
|
|
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
|
|
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
|
|
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_KEY_ID }}
|
|
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }}
|