AND-81: Cleanup existing KTX #117
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 | |
on: | |
push: | |
branches: [main] | |
# Release tag format is [module-name]-v[androidx-version]-[ktx-version] | |
# For example: fragment-ktx-v1.3.5-0 | |
tags: ['*-ktx-v*-[0-9]+'] | |
pull_request: | |
branches: [main] | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Run Check | |
uses: eskatos/gradle-command-action@v1 | |
with: | |
arguments: check -xlint | |
distributions-cache-enabled: true | |
dependencies-cache-enabled: true | |
- name: Run Detekt | |
uses: eskatos/gradle-command-action@v1 | |
with: | |
arguments: detektReleaseAll | |
publish: | |
name: Publish | |
needs: check | |
runs-on: ubuntu-latest | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Setup Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Get module name from tag | |
id: get-module-name | |
run: | | |
tag=${GITHUB_REF#refs/tags/} | |
echo "::set-output name=result::${tag/-v*}" | |
- 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 | |
env: | |
ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ github.actor }} | |
ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }} |