Tachiyomi-Extensions/.github/workflows/build_push.yml

159 lines
4.2 KiB
YAML
Raw Normal View History

2020-11-13 00:22:02 +00:00
name: CI
on:
push:
branches:
- master
jobs:
check_wrapper:
name: Validate Gradle Wrapper
runs-on: ubuntu-latest
steps:
- 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:
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:
java-version: 1.8
2020-11-13 00:22:02 +00:00
- name: Copy CI gradle.properties
run: |
mkdir -p ~/.gradle
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
- 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"
lib-themesources, split Genkan into single-source extensions (#5154) * lib themesources copied from SnakeDoc83/tachiyomi-extensions/library * update to the newer Genkan * update genkan generator * GenkanOriginal * code cleanup * add all Genkan sources * generate inside generated-src, res override * src override * move overrides out of library * move overrides to a better place * remove leftover generated files * remove leftover generated files * add generators main class * comment the code * Now sources are purely generated * uncomment generators * enhance comments * icons by @as280093 * fix pathing issues * nullpointerexception proof * runAllGenerators task * more flexibility in lib structure, fix a fiew errors * update github workflows * correct nonames scans directory name * rename SK Scans to Sleeping Knight Scans * fix typo * update depencencies * remove defaultRes from dependencies * fix bug with nsfw * fix nsfw generation * themesourcesLibraryVersion is included in build.gradle extVersionCode * improve javadoc * fix formatting and language code generation * comply with #5214 * common dependencies * rename and move lib/themesources into /multisrc * use not depricated form * cleanup runAllGenerators task * cleanup even more * oops extra file * remove test code * comments * update docs and refactor * update docs * requested changes * clean up dependencies * sealed dataClass * refactor * refactor string generators * bring back writeAndroidManifest * update overrideVersionCode javadoc * update overrideVersionCode javadoc * move dependency to extension source * refactor runAllGenerators * improve docs * remove extra file
2021-02-06 22:32:04 +00:00
with:
arguments: :multisrc:generateExtensions
lib-themesources, split Genkan into single-source extensions (#5154) * lib themesources copied from SnakeDoc83/tachiyomi-extensions/library * update to the newer Genkan * update genkan generator * GenkanOriginal * code cleanup * add all Genkan sources * generate inside generated-src, res override * src override * move overrides out of library * move overrides to a better place * remove leftover generated files * remove leftover generated files * add generators main class * comment the code * Now sources are purely generated * uncomment generators * enhance comments * icons by @as280093 * fix pathing issues * nullpointerexception proof * runAllGenerators task * more flexibility in lib structure, fix a fiew errors * update github workflows * correct nonames scans directory name * rename SK Scans to Sleeping Knight Scans * fix typo * update depencencies * remove defaultRes from dependencies * fix bug with nsfw * fix nsfw generation * themesourcesLibraryVersion is included in build.gradle extVersionCode * improve javadoc * fix formatting and language code generation * comply with #5214 * common dependencies * rename and move lib/themesources into /multisrc * use not depricated form * cleanup runAllGenerators task * cleanup even more * oops extra file * remove test code * comments * update docs and refactor * update docs * requested changes * clean up dependencies * sealed dataClass * refactor * refactor string generators * bring back writeAndroidManifest * update overrideVersionCode javadoc * update overrideVersionCode javadoc * move dependency to extension source * refactor runAllGenerators * improve docs * remove extra file
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 }}
with:
arguments: assembleRelease
- name: Upload "${{ matrix.lang }}" APKs
uses: actions/upload-artifact@v2
with:
name: "multisrc-${{ matrix.lang }}-apks"
path: "**/*.apk"
2021-06-20 21:45:22 +00:00
retention-days: 1
build_individual:
name: Build individual modules
needs: check_wrapper
runs-on: ubuntu-latest
strategy:
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:
java-version: 1.8
- name: Copy CI gradle.properties
run: |
mkdir -p ~/.gradle
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
- 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 }}
2020-11-13 00:22:02 +00:00
with:
arguments: assembleRelease
2021-06-20 21:45:22 +00:00
- name: Upload "${{ matrix.lang }}" APKs
uses: actions/upload-artifact@v2
with:
name: "individual-${{ matrix.lang }}-apks"
path: "**/*.apk"
2021-06-20 21:45:22 +00:00
retention-days: 1
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:
path: ~/apk-artifacts
2021-06-20 21:45:22 +00:00
- name: Checkout master branch
uses: actions/checkout@v2
with:
ref: master
path: master
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Sign APKs
run: |
cd master
./.github/scripts/sign-apks.sh \
${{ secrets.SIGNING_KEY }} \
${{ secrets.ALIAS }} \
${{ secrets.KEY_STORE_PASSWORD }} \
${{ secrets.KEY_PASSWORD }}
- name: Run inspector
run: |
cd master
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
java -jar ./Inspector.jar "apk" "output.json" "tmp"
2020-11-13 00:22:02 +00:00
- name: Create repo artifacts
run: |
cd master
./.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