remove_unused_resources #280
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: remove_unused_resources | |
on: | |
schedule: | |
- cron: "30 9 1 * *" | |
jobs: | |
execute: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gradle/actions/wrapper-validation@v4 | |
- name: Copy CI gradle.properties | |
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties | |
- name: Add GitHub Packages auth | |
run: ./scripts/ci-github-packages-properties.sh | |
- name: Setup JDK 17 | |
uses: actions/[email protected] | |
with: | |
java-version: '21' | |
distribution: 'zulu' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
# Only write to the cache for builds on the 'develop' branch | |
cache-read-only: false | |
- name: Prebuild | |
run: ./scripts/ci-prebuild.sh | |
env: | |
LOKALISE_ID: ${{ secrets.LOKALISE_ID }} | |
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }} | |
- name: Run android lint | |
run: ./gradlew :app:lint -Prur.lint.onlyUnusedResources | |
- name: Remove unused resources | |
run: ./gradlew :app:removeUnusedResourcesDebug | |
- name: Generate Token | |
id: generate_token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.CI_APP_ID }} | |
private_key: ${{ secrets.CI_APP_PRIVATE_KEY }} | |
- name: Create PR | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ steps.generate_token.outputs.token }} | |
branch: "maintenance/remove-unused-resources" | |
title: "Maintenance: Remove unused resources" | |
body: "" |