From 9d6329437684e6568aff9b07cb6a015aeab19e4c Mon Sep 17 00:00:00 2001 From: Osip Fatkullin Date: Fri, 17 May 2024 18:13:33 +0200 Subject: [PATCH] ci: Update CI config --- .github/workflows/main.yml | 40 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ac81a9..6ffbeb8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,52 +16,50 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: 'temurin' + java-version: 17 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 - name: Run Check - uses: eskatos/gradle-command-action@v1 - with: - arguments: check -xlint - distributions-cache-enabled: true - dependencies-cache-enabled: true + run: ./gradlew check -xlint - name: Run Detekt - uses: eskatos/gradle-command-action@v1 - with: - arguments: detektAll detektReleaseAll + run: ./gradlew detektAll detektReleaseAll publish: - name: Publish + name: Publish KTX needs: check runs-on: ubuntu-latest if: ${{ startsWith(github.ref, 'refs/tags/') }} steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 11 + distribution: 'temurin' + java-version: 17 - name: Get module name from tag id: get-module-name run: | tag=${GITHUB_REF#refs/tags/} - echo "::set-output name=result::${tag/-v*}" + echo "result=${tag/-v*}" >> "$GITHUB_OUTPUT" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 - name: Run Publish - uses: eskatos/gradle-command-action@v1 - with: - arguments: :${{ steps.get-module-name.outputs.result }}:publish - distributions-cache-enabled: true - dependencies-cache-enabled: true + run: ./gradlew :ktx:${{ steps.get-module-name.outputs.result }}:publish env: ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ github.actor }} ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}