diff --git a/.github/workflows/publication-workflow.yml b/.github/workflows/publication-workflow.yml new file mode 100644 index 0000000..4ec3243 --- /dev/null +++ b/.github/workflows/publication-workflow.yml @@ -0,0 +1,86 @@ +name: CD | publication + +on: + workflow_run: + workflows: [ "CI | library & demo app" ] + types: [ completed ] + branches: [ main ] + +jobs: + lib-modules-build: + name: Build library modules + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Official Gradle Wrapper Validation Action + uses: gradle/wrapper-validation-action@v1 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: adopt + + - name: Set up Gradle cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-gradle-${{ github.run_id }} + path: | + ~/.gradle/caches + ~/.gradle/wrapper + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + + - name: Grant execute permission for gradlew script + run: chmod +x gradlew + + - name: Build all lib modules except demo app + run: ./gradlew build -x :demo-app:build -x check + + publication: + name: Publish library artifacts + runs-on: ubuntu-latest + needs: [ lib-modules-check, demo-app-build ] + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: adopt + + - name: Set up Gradle cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-gradle-${{ github.run_id }} + path: | + ~/.gradle/caches + ~/.gradle/wrapper + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + + - name: Grant execute permission for gradlew script + run: chmod +x gradlew + + - name: Publish snapshot + run: ./gradlew publishAllPublicationsToGitHubPackagesRepository + + delete-cache: + name: Delete cache + if: always() + runs-on: ubuntu-latest + needs: [ lib-modules-check, demo-app-build ] + steps: + - uses: actions/checkout@v2 + + - name: Delete cache + run: | + gh extension install actions/gh-actions-cache + set +e + gh actions-cache delete ${{ runner.os }}-gradle-${{ github.run_id }} --confirm + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.idea/detekt.xml b/.idea/detekt.xml index 829dbd1..9c14f76 100644 --- a/.idea/detekt.xml +++ b/.idea/detekt.xml @@ -12,5 +12,7 @@ +