1.1.4 #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
env: | |
GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=false -Dorg.gradle.vfs.watch=false -Dkotlin.compiler.execution.strategy=in-process' | |
JAVA_VERSION: 11 | |
ORG_GRADLE_PROJECT_githubUsername: ${{ github.actor }} | |
ORG_GRADLE_PROJECT_githubPassword: ${{ github.token }} | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
timeout-minutes: 15 | |
runs-on: macos-latest | |
steps: | |
- name: Checkout the repo | |
uses: actions/checkout@v2 | |
- name: Validate Gradle Wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Setup JDK ${{ env.JAVA_VERSION }} | |
uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Cache gradle | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
~/.konan | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build project and run tests with Gradle | |
run: ./gradlew clean build | |
- name: Bundle the failed build report | |
if: failure() | |
run: find ./build -type d -name 'reports' | zip -@ -r build-reports.zip | |
- name: Upload the failed build report | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: error-report | |
path: build-reports.zip | |
retention-days: 7 | |
- name: Publish library with Gradle | |
run: | | |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3) | |
./gradlew publish -Dversion=${NEW_VERSION} |