Update PlayApiService.kt #523
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: CI/CD | |
on: [push, pull_request] | |
env: | |
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.compiler.execution.strategy=in-process | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
is_snapshot: ${{ steps.setup.outputs.is_snapshot }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Gradle Cache | |
uses: gradle/gradle-build-action@v2 | |
- name: Validate Gradle integrity | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Setup environment | |
id: setup | |
run: | | |
if grep -qi "snapshot" version.txt; then is_snapshot=true; else is_snapshot=false; fi | |
echo "is_snapshot=$is_snapshot" >> "$GITHUB_OUTPUT" | |
- name: Build project | |
run: | | |
./gradlew assemble publishToMavenLocal -S | |
cd testapp && ./gradlew help -PskipValidation -S | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Gradle Cache | |
uses: gradle/gradle-build-action@v2 | |
- name: Setup environment | |
run: ./gradlew publishToMavenLocal | |
- name: Run tests | |
run: ./gradlew check test -S | |
deploy_snapshot: | |
needs: [build, test] | |
runs-on: ubuntu-latest | |
if: github.repository == 'Triple-T/gradle-play-publisher' && github.ref == 'refs/heads/master' && needs.build.outputs.is_snapshot == 'true' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Gradle Cache | |
uses: gradle/gradle-build-action@v2 | |
- name: Build project | |
run: ./gradlew assemble | |
- name: Publish snapshot | |
run: ./gradlew publishToSonatype | |
env: | |
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
deploy_release: | |
needs: [build, test] | |
runs-on: ubuntu-latest | |
if: github.repository == 'Triple-T/gradle-play-publisher' && startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Gradle Cache | |
uses: gradle/gradle-build-action@v2 | |
- name: Build project | |
run: ./gradlew assemble | |
- name: Publish release | |
run: | | |
./gradlew publishToSonatype closeAndReleaseStagingRepository | |
./gradlew publishPlugins \ | |
-Pgradle.publish.key=$PUBLISH_KEY -Pgradle.publish.secret=$PUBLISH_SECRET | |
env: | |
PUBLISH_KEY: ${{ secrets.PUBLISH_KEY }} | |
PUBLISH_SECRET: ${{ secrets.PUBLISH_SECRET }} | |
SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} |