Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.

[EN] Av1encodes Fix (#1343) #388

[EN] Av1encodes Fix (#1343)

[EN] Av1encodes Fix (#1343) #388

Workflow file for this run

name: CI
on:
push:
branches:
- main
paths:
- '**'
- '!**.md'
- '!.github/**'
- '.github/scripts/**'
- '.github/workflows/build_push.yml'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
CI_CHUNK_SIZE: 288
jobs:
prepare:
name: Prepare job
runs-on: ubuntu-latest
outputs:
individualMatrix: ${{ steps.generate-matrices.outputs.individualMatrix }}
steps:
- name: Clone repo
uses: actions/checkout@v4 # v4
with:
ref: main
token: ${{ secrets.TOKEN_GITHUB }}
- name: Get number of modules
run: |
set -x
projects=(src/*/*)
echo "NUM_INDIVIDUAL_MODULES=${#projects[@]}" >> "$GITHUB_ENV"
- name: Find lib changes
id: modified-libs
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
with:
files: lib/
files_ignore: lib/**.md
files_separator: " "
safe_output: false
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6 # v6.1.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Bump extensions that uses a modified lib
if: steps.modified-libs.outputs.any_changed == 'true'
run: |
chmod +x ./.github/scripts/bump-versions.py
./.github/scripts/bump-versions.py ${{ steps.modified-libs.outputs.all_changed_files }}
- id: generate-matrices
name: Create output matrices
uses: actions/github-script@v7 # v7
with:
script: |
const numIndividualModules = process.env.NUM_INDIVIDUAL_MODULES;
const chunkSize = process.env.CI_CHUNK_SIZE;
const numIndividualChunks = 1;
console.log(`Individual modules: ${numIndividualModules} (${numIndividualChunks} chunks of ${chunkSize})`);
core.setOutput('individualMatrix', JSON.stringify({ 'chunk': [...Array(numIndividualChunks).keys()] }));
build_individual:
name: Build individual modules
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.individualMatrix) }}
steps:
- name: Checkout main branch
uses: actions/checkout@v4 # v4
with:
ref: main
token: ${{ secrets.TOKEN_GITHUB }}
- name: Set up JDK
uses: actions/setup-java@v4 # v4
with:
java-version: 17
distribution: temurin
- name: Prepare signing key
run: |
echo ${{ secrets.SIGNING_KEY }} | base64 -d > signingkey.jks
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4 # v4
- name: Restore build cache
uses: actions/cache/restore@v3
with:
path: |
src/**/build
!src/**/build/outputs
key: build-cache-${{ github.sha }}-${{ matrix.chunk }}
restore-keys: |
build-cache-${{ github.sha }}-
build-cache-
- name: Build extensions
env:
CI_CHUNK_NUM: ${{ matrix.chunk }}
ALIAS: ${{ secrets.ALIAS }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: chmod +x ./gradlew && ./gradlew -p src assembleRelease
- name: Store build cache
uses: actions/cache/save@v3
with:
path: |
src/**/build
!src/**/build/outputs
key: build-cache-${{ github.sha }}-${{ matrix.chunk }}
- name: Upload APKs
uses: actions/upload-artifact@v4
if: ${{ github.repository == 'Kohi-den/extensions-source' }}
with:
name: "individual-apks-${{ matrix.chunk }}"
path: "**/*.apk"
retention-days: 1
- name: Clean up CI files
run: rm signingkey.jks
publish_repo:
name: Publish repo
needs:
- build_individual
if: ${{ github.repository == 'Kohi-den/extensions-source' }}
runs-on: ubuntu-latest
steps:
- name: Setup rsync
run: |
sudo apt-get update && sudo apt install rsync -y
- name: Download APK artifacts
uses: actions/download-artifact@v4
with:
path: ~/apk-artifacts
- name: Set up JDK
uses: actions/setup-java@v4 # v4
with:
java-version: 17
distribution: temurin
- name: Checkout main branch
uses: actions/checkout@v4 # v4
with:
ref: main
path: main
token: ${{ secrets.TOKEN_GITHUB }}
- name: Create repo artifacts
run: |
cd main
python ./.github/scripts/move-apks.py
INSPECTOR_LINK="$(curl -s "https://api.github.com/repos/aniyomiorg/aniyomi-extensions-inspector/releases/latest" | jq -r '.assets[0].browser_download_url')"
curl -L "$INSPECTOR_LINK" -o ./Inspector.jar
java -jar ./Inspector.jar "repo/apk" "output.json" "tmp"
python ./.github/scripts/create-repo.py
- name: Checkout repo branch
uses: actions/checkout@v4 # v4
with:
repository: Kohi-den/extensions-source #just to initialize the folder
token: ${{ secrets.TOKEN_GITHUB }}
ref: main
path: repo
- name: Set Forgejo remote URL
run: |
cd repo
git remote set-url origin https://${{ secrets.FORGEJO_USERNAME }}:${{ secrets.FORGEJO_TOKEN }}@kohiden.xyz/Kohi-den/extensions.git
- name: Pull latest changes
run: |
cd repo
git pull --rebase origin main
- name: Sync repo
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: EndBug/add-and-commit@v9
with:
message: "Update extensions repo"
cwd: "./repo"
committer_name: Kohi-den-bot
committer_email: kohi-den-bot@noreply.localhost