Skip to content

Update build.yml

Update build.yml #10

Workflow file for this run

name: Build Snapshot
on:
push:
paths-ignore:
- 'README.md'
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
build:
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Android SDK # TODO remove on non self-hosted
uses: amyu/setup-android@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build library
run: ./gradlew assembleRelease
- name: Build sample apps
run: ./gradlew -p sample-app assembleRelease
- name: Build playground app
run: ./gradlew -p playground-app assembleRelease
test:
needs: [ build ]
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Test library
run: ./gradlew check
deploy-snapshot:
needs: [ test ]
if: github.ref == 'refs/heads/develop'
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches/modules-*
~/.gradle/caches/jars-*
~/.gradle/caches/build-cache-*
key: gradle-${{ runner.os }}-${{ hashFiles('**/build.gradle') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup git-mkver
uses: cperezabo/[email protected]
- name: Setup Android SDK # TODO remove on non self-hosted
uses: amyu/setup-android@v3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Generate version
run: git mkver next --pre-release
- name: Build library
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}