Skip to content

Commit

Permalink
ci: Update CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed May 20, 2024
1 parent 5cc77cc commit 9d63294
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 9d63294

Please sign in to comment.