2020-11-13 00:22:02 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2022-01-20 16:02:38 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2020-11-13 00:22:02 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
check_wrapper:
|
|
|
|
name: Validate Gradle Wrapper
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-09-09 22:20:12 +00:00
|
|
|
- name: Cancel previous runs
|
|
|
|
uses: styfle/cancel-workflow-action@0.9.1
|
|
|
|
with:
|
|
|
|
access_token: ${{ github.token }}
|
|
|
|
all_but_latest: true
|
|
|
|
|
2020-11-13 00:22:02 +00:00
|
|
|
- name: Clone repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Validate Gradle Wrapper
|
|
|
|
uses: gradle/wrapper-validation-action@v1
|
|
|
|
|
2021-06-20 21:45:22 +00:00
|
|
|
build_multisrc:
|
|
|
|
name: Build multisrc modules
|
2020-11-13 00:22:02 +00:00
|
|
|
needs: check_wrapper
|
|
|
|
runs-on: ubuntu-latest
|
2021-06-20 21:45:22 +00:00
|
|
|
strategy:
|
2022-03-26 18:38:48 +00:00
|
|
|
fail-fast: false
|
2021-06-20 21:45:22 +00:00
|
|
|
matrix:
|
2021-06-20 22:42:33 +00:00
|
|
|
lang: [all, en, ar, ca, de, es, fr, id, it, ja, ko, pt, ru, th, tr, vi, zh, bg, hi, pl]
|
2020-11-13 00:22:02 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout master branch
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2021-06-20 21:45:22 +00:00
|
|
|
- name: Set up JDK
|
2020-11-13 00:22:02 +00:00
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
2022-04-23 22:25:56 +00:00
|
|
|
java-version: 1.8
|
2020-11-13 00:22:02 +00:00
|
|
|
|
2022-01-09 19:33:34 +00:00
|
|
|
- name: Copy CI files
|
2020-11-13 00:22:02 +00:00
|
|
|
run: |
|
|
|
|
mkdir -p ~/.gradle
|
|
|
|
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
2022-01-09 19:33:34 +00:00
|
|
|
echo ${{ secrets.SIGNING_KEY }} | base64 -d > signingkey.jks
|
2020-11-13 00:22:02 +00:00
|
|
|
|
2021-02-08 14:08:45 +00:00
|
|
|
- name: Generate sources from the multi-source library
|
2021-11-29 00:06:27 +00:00
|
|
|
uses: gradle/gradle-command-action@v2
|
2021-02-13 00:16:06 +00:00
|
|
|
env:
|
2021-06-20 21:45:22 +00:00
|
|
|
CI_MULTISRC: "true"
|
2021-02-06 22:32:04 +00:00
|
|
|
with:
|
2021-03-09 23:02:17 +00:00
|
|
|
arguments: :multisrc:generateExtensions
|
2022-04-12 17:31:09 +00:00
|
|
|
cache-disabled: true
|
2021-02-06 22:32:04 +00:00
|
|
|
|
2021-06-20 21:45:22 +00:00
|
|
|
- name: Build "${{ matrix.lang }}" extensions
|
2021-11-29 00:06:27 +00:00
|
|
|
uses: gradle/gradle-command-action@v2
|
2021-06-20 21:45:22 +00:00
|
|
|
env:
|
|
|
|
CI_MULTISRC: "true"
|
|
|
|
CI_MATRIX_LANG: ${{ matrix.lang }}
|
2022-01-09 19:33:34 +00:00
|
|
|
ALIAS: ${{ secrets.ALIAS }}
|
|
|
|
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
|
|
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
2021-06-20 21:45:22 +00:00
|
|
|
with:
|
|
|
|
arguments: assembleRelease
|
2022-04-12 17:31:09 +00:00
|
|
|
cache-disabled: true
|
2021-06-20 21:45:22 +00:00
|
|
|
|
|
|
|
- name: Upload "${{ matrix.lang }}" APKs
|
|
|
|
uses: actions/upload-artifact@v2
|
2022-01-09 19:33:34 +00:00
|
|
|
if: "github.repository == 'tachiyomiorg/tachiyomi-extensions'"
|
2021-06-20 21:45:22 +00:00
|
|
|
with:
|
|
|
|
name: "multisrc-${{ matrix.lang }}-apks"
|
2021-11-28 23:06:26 +00:00
|
|
|
path: "**/*.apk"
|
2021-06-20 21:45:22 +00:00
|
|
|
retention-days: 1
|
|
|
|
|
2022-01-09 19:33:34 +00:00
|
|
|
- name: Clean up CI files
|
|
|
|
run: rm signingkey.jks
|
|
|
|
|
2021-06-20 21:45:22 +00:00
|
|
|
build_individual:
|
|
|
|
name: Build individual modules
|
|
|
|
needs: check_wrapper
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2022-03-26 18:38:48 +00:00
|
|
|
fail-fast: false
|
2021-06-20 21:45:22 +00:00
|
|
|
matrix:
|
2021-06-20 22:42:33 +00:00
|
|
|
lang: [all, en, ar, ca, de, es, fr, id, it, ja, ko, pt, ru, th, tr, vi, zh, bg, hi, pl]
|
2021-06-20 21:45:22 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout master branch
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up JDK
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
2022-04-23 22:25:56 +00:00
|
|
|
java-version: 1.8
|
2021-06-20 21:45:22 +00:00
|
|
|
|
2022-01-09 19:33:34 +00:00
|
|
|
- name: Copy CI files
|
2021-06-20 21:45:22 +00:00
|
|
|
run: |
|
|
|
|
mkdir -p ~/.gradle
|
|
|
|
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
2022-01-09 19:33:34 +00:00
|
|
|
echo ${{ secrets.SIGNING_KEY }} | base64 -d > signingkey.jks
|
2021-06-20 21:45:22 +00:00
|
|
|
|
|
|
|
- name: Build "${{ matrix.lang }}" extensions
|
2021-11-29 00:06:27 +00:00
|
|
|
uses: gradle/gradle-command-action@v2
|
2021-02-13 00:16:06 +00:00
|
|
|
env:
|
2021-06-20 21:45:22 +00:00
|
|
|
CI_MULTISRC: "false"
|
|
|
|
CI_MATRIX_LANG: ${{ matrix.lang }}
|
2022-01-09 19:33:34 +00:00
|
|
|
ALIAS: ${{ secrets.ALIAS }}
|
|
|
|
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
|
|
|
|
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
2020-11-13 00:22:02 +00:00
|
|
|
with:
|
|
|
|
arguments: assembleRelease
|
2022-04-12 17:31:09 +00:00
|
|
|
cache-disabled: true
|
2020-11-13 00:22:02 +00:00
|
|
|
|
2021-06-20 21:45:22 +00:00
|
|
|
- name: Upload "${{ matrix.lang }}" APKs
|
|
|
|
uses: actions/upload-artifact@v2
|
2022-01-09 19:33:34 +00:00
|
|
|
if: "github.repository == 'tachiyomiorg/tachiyomi-extensions'"
|
2021-06-20 21:45:22 +00:00
|
|
|
with:
|
|
|
|
name: "individual-${{ matrix.lang }}-apks"
|
2021-11-28 23:06:26 +00:00
|
|
|
path: "**/*.apk"
|
2021-06-20 21:45:22 +00:00
|
|
|
retention-days: 1
|
|
|
|
|
2022-01-09 19:33:34 +00:00
|
|
|
- name: Clean up CI files
|
|
|
|
run: rm signingkey.jks
|
|
|
|
|
2021-06-20 21:45:22 +00:00
|
|
|
publish_repo:
|
|
|
|
name: Publish repo
|
|
|
|
needs:
|
|
|
|
- build_multisrc
|
|
|
|
- build_individual
|
|
|
|
if: "github.repository == 'tachiyomiorg/tachiyomi-extensions'"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Download APK artifacts
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
2021-11-28 23:06:26 +00:00
|
|
|
path: ~/apk-artifacts
|
2021-06-20 21:45:22 +00:00
|
|
|
|
2021-08-02 14:28:45 +00:00
|
|
|
- name: Set up JDK
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 11
|
|
|
|
|
2022-01-09 19:33:34 +00:00
|
|
|
- name: Checkout master branch
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: master
|
|
|
|
path: master
|
2021-11-28 23:06:26 +00:00
|
|
|
|
2022-01-09 19:33:34 +00:00
|
|
|
- name: Create repo artifacts
|
2021-08-02 14:28:45 +00:00
|
|
|
run: |
|
|
|
|
cd master
|
2022-01-09 19:33:34 +00:00
|
|
|
./.github/scripts/move-apks.sh
|
2021-08-02 14:28:45 +00:00
|
|
|
INSPECTOR_LINK="$(curl -s "https://api.github.com/repos/tachiyomiorg/tachiyomi-extensions-inspector/releases/latest" | jq -r '.assets[0].browser_download_url')"
|
|
|
|
curl -L "$INSPECTOR_LINK" -o ./Inspector.jar
|
2021-11-28 23:06:26 +00:00
|
|
|
java -jar ./Inspector.jar "apk" "output.json" "tmp"
|
2020-11-13 00:22:02 +00:00
|
|
|
./.github/scripts/create-repo.sh
|
|
|
|
|
|
|
|
- name: Checkout repo branch
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
ref: repo
|
|
|
|
path: repo
|
|
|
|
|
|
|
|
- name: Deploy repo
|
|
|
|
run: |
|
|
|
|
cd repo
|
|
|
|
../master/.github/scripts/commit-repo.sh
|