2022-03-06 12:44:47 +08:00
|
|
|
name: Update Cronet
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2023-03-25 19:07:25 +08:00
|
|
|
# 周一北京时间9点
|
|
|
|
- cron: 0 1 * * 1
|
2022-03-06 12:44:47 +08:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2023-02-17 09:56:59 +08:00
|
|
|
if: ${{ github.repository == 'gedoor/legado' }}
|
2022-03-06 12:44:47 +08:00
|
|
|
steps:
|
2023-09-18 20:51:37 +08:00
|
|
|
- uses: actions/checkout@v4
|
2023-04-16 08:45:25 +08:00
|
|
|
|
2022-03-07 21:58:40 +08:00
|
|
|
- name: Check Cronet Updates
|
2023-03-09 08:24:19 +08:00
|
|
|
run: source .github/scripts/cronet.sh
|
|
|
|
|
2023-04-16 08:45:25 +08:00
|
|
|
- name: Set up JDK 17
|
|
|
|
if: ${{ env.cronet == 'ok' }}
|
2023-12-04 12:20:10 +08:00
|
|
|
uses: actions/setup-java@v4
|
2023-04-16 08:45:25 +08:00
|
|
|
with:
|
|
|
|
distribution: 'temurin'
|
|
|
|
java-version: 17
|
|
|
|
|
2024-02-02 07:57:54 +08:00
|
|
|
- uses: gradle/actions/setup-gradle@v3
|
2023-03-09 08:39:50 +08:00
|
|
|
if: ${{ env.cronet == 'ok' }}
|
2023-04-16 08:45:25 +08:00
|
|
|
|
2023-03-09 08:24:19 +08:00
|
|
|
- name: Download Cronet
|
|
|
|
if: ${{ env.cronet == 'ok' }}
|
2022-03-06 12:44:47 +08:00
|
|
|
run: |
|
2023-03-09 08:24:19 +08:00
|
|
|
chmod +x gradlew
|
2023-03-09 08:27:39 +08:00
|
|
|
./gradlew app:downloadCronet
|
2022-03-06 12:44:47 +08:00
|
|
|
|
|
|
|
- name: Create Pull Request
|
2023-03-09 08:24:19 +08:00
|
|
|
if: ${{ env.cronet == 'ok' }}
|
2023-04-10 13:02:25 +08:00
|
|
|
uses: peter-evans/create-pull-request@v5
|
2022-03-06 12:44:47 +08:00
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.ACTIONS_TOKEN }}
|
|
|
|
title: ${{ env.PR_TITLE }}
|
|
|
|
commit-message: |
|
|
|
|
${{ env.PR_TITLE }}
|
|
|
|
- ${{ env.PR_BODY }}
|
|
|
|
body: ${{ env.PR_BODY }}
|
|
|
|
branch: cronet
|
|
|
|
delete-branch: true
|
|
|
|
add-paths: |
|
|
|
|
*cronet*jar
|
|
|
|
*cronet.json
|
|
|
|
*updateLog.md
|
|
|
|
gradle.properties
|