ci: Added build cache to workflow
All checks were successful
CI / Prepare job (push) Successful in 15s
CI / Build individual modules (push) Successful in 5m34s
CI / Publish repo (push) Successful in 1m47s

This commit is contained in:
WebDitto 2025-06-19 15:54:28 -03:00
parent d09fc02078
commit 6b0de66cf6
2 changed files with 30 additions and 20 deletions

View file

@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: true
env:
CI_CHUNK_SIZE: 288
CI_CHUNK_SIZE: 65
jobs:
prepare:
@ -75,6 +75,17 @@ jobs:
with:
cache-read-only: true
- name: Restore build cache
uses: https://github.com/actions/cache/restore@v3
with:
path: |
src/**/build
!src/**/build/outputs
key: build-cache-${{ github.event.pull_request.base.sha }}-${{ matrix.chunk }}
restore-keys: |
build-cache-${{ github.event.pull_request.base.sha }}-
build-cache-
- name: Build extensions (chunk ${{ matrix.chunk }})
env:
CI_CHUNK_NUM: ${{ matrix.chunk }}

View file

@ -31,27 +31,22 @@ jobs:
ref: main
token: ${{ secrets.BOT_PAT }}
- name: Find lib changes
id: modified-libs
uses: https://github.com/tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 #v42
with:
files: lib/
files_ignore: lib/**.md
files_separator: " "
safe_output: false
# This step is going to commit, but this will not trigger another workflow.
- name: Bump extensions that uses a modified lib
if: steps.modified-libs.outputs.any_changed == 'true'
run: |
chmod +x ./.github/scripts/bump-versions.py ${{ steps.modified-libs.outputs.all_changed_files }}
- name: Get number of modules
run: |
set -x
projects=(src/*/*)
echo "NUM_INDIVIDUAL_MODULES=${#projects[@]}" >> "$GITHUB_ENV"
# Temporary pause because of leak of tj-actions/changed-files
# - name: Find lib changes
# id: modified-libs
# uses: tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 #v42
# with:
# files: lib/
# files_ignore: lib/**.md
# files_separator: " "
# safe_output: false
- name: Import GPG key
uses: https://github.com/crazy-max/ghaction-import-gpg@v6 # v6.1.0
with:
@ -119,6 +114,14 @@ jobs:
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: chmod +x ./gradlew && ./gradlew -p src assembleRelease
- name: Cache build directories
uses: https://github.com/actions/cache/save@v3
with:
path: |
src/**/build
!src/**/build/outputs
key: build-cache-${{ github.sha }}-${{ matrix.chunk }}
- name: Upload APKs
uses: https://code.forgejo.org/forgejo/upload-artifact@16871d9e8cfcf27ff31822cac382bbb5450f1e1e # v4-patch
if: "github.repository == 'Kohi-den/extensions-source'"
@ -184,10 +187,6 @@ jobs:
run: |
rsync -a --delete --exclude .git --exclude .gitignore main/repo/ repo --exclude README.md --exclude repo.json
- name: Increase buffer size
run: |
git config --global http.postBuffer 157286400
- name: Deploy repo
uses: https://github.com/EndBug/add-and-commit@v9
with: