diff --git a/.github/workflows/legado.jks b/.github/workflows/legado.jks new file mode 100644 index 000000000..89ea725fd Binary files /dev/null and b/.github/workflows/legado.jks differ diff --git a/.github/workflows/legado.yml b/.github/workflows/legado.yml index 946274327..19de5a1da 100644 --- a/.github/workflows/legado.yml +++ b/.github/workflows/legado.yml @@ -8,6 +8,8 @@ on: - '3.*' watch: types: [started] + schedule: + - cron: '0 4 * * *' jobs: build: @@ -20,32 +22,31 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 - - name: install git + - name: clear 18PlusList.txt run: | - sudo apt-get update - sudo apt-get -y install git - - name: clone code - run: | - git clone https://github.com/gedoor/legado.git /opt/legado - echo "ojbk">/opt/legado/app/src/main/assets/18PlusList.txt + echo "清空18PlusList.txt" + echo "">$GITHUB_WORKSPACE/app/src/main/assets/18PlusList.txt - name: release apk sign run: | - git clone https://github.com/10bits/gedoor-Build.git /opt/gedoor-Build - cp /opt/gedoor-Build/.github/workflows/legado.jks /opt/legado/app/legado.jks - sed '$a\RELEASE_STORE_FILE=./legado.jks' /opt/legado/gradle.properties -i - sed '$a\RELEASE_KEY_ALIAS=legado' /opt/legado/gradle.properties -i - sed '$a\RELEASE_STORE_PASSWORD=gedoor_legado' /opt/legado/gradle.properties -i - sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' /opt/legado/gradle.properties -i - sed "s/'.release'/'.releaseA'/" /opt/legado/app/build.gradle -i - sed 's/.release/.releaseA/g' /opt/legado/app/google-services.json -i - - name: Build with Gradle + echo "给apk增加签名" + cp $GITHUB_WORKSPACE/.github/workflows/legado.jks $GITHUB_WORKSPACE/app/legado.jks + sed '$a\RELEASE_STORE_FILE=./legado.jks' $GITHUB_WORKSPACE/gradle.properties -i + sed '$a\RELEASE_KEY_ALIAS=legado' $GITHUB_WORKSPACE/gradle.properties -i + sed '$a\RELEASE_STORE_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i + sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i + - name: apk live together + run: | + echo "设置apk共存" + sed "s/'.release'/'.releaseA'/" $GITHUB_WORKSPACE/app/build.gradle -i + sed 's/.release/.releaseA/' $GITHUB_WORKSPACE/app/google-services.json -i + - name: build with gradle run: | - cd /opt/legado + echo "开始进行release构建" chmod +x gradlew - ./gradlew assembleRelease + ./gradlew aR - name : upload apk uses: actions/upload-artifact@master if: always() with: name: legado apk - path: /opt/legado/app/build/outputs/apk/app/release + path: ${{ github.workspace }}/app/build/outputs/apk/app/release