|
|
@ -31,15 +31,20 @@ jobs: |
|
|
|
UPLOAD_ARTIFACT: 'true' |
|
|
|
UPLOAD_ARTIFACT: 'true' |
|
|
|
steps: |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v2 |
|
|
|
- uses: actions/checkout@v2 |
|
|
|
- name: set up JDK |
|
|
|
- name: Set Up JDK |
|
|
|
uses: actions/setup-java@v1 |
|
|
|
uses: actions/setup-java@v1 |
|
|
|
with: |
|
|
|
with: |
|
|
|
java-version: 14 |
|
|
|
java-version: 14 |
|
|
|
- name: clear 18PlusList.txt |
|
|
|
- name: Clear 18PlusList.txt |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
echo "清空18PlusList.txt" |
|
|
|
echo "清空18PlusList.txt" |
|
|
|
echo "">$GITHUB_WORKSPACE/app/src/main/assets/18PlusList.txt |
|
|
|
echo "">$GITHUB_WORKSPACE/app/src/main/assets/18PlusList.txt |
|
|
|
- name: release apk sign |
|
|
|
- name: App Minify |
|
|
|
|
|
|
|
if: ${{ github.event_name == 'release'}} |
|
|
|
|
|
|
|
run: | |
|
|
|
|
|
|
|
sed '/minifyEnabled/i\ shrinkResources true' $GITHUB_WORKSPACE/app/build.gradle -i |
|
|
|
|
|
|
|
sed 's/minifyEnabled false/minifyEnabled true/' $GITHUB_WORKSPACE/app/build.gradle -i |
|
|
|
|
|
|
|
- name: Release Apk Sign |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
echo "给apk增加签名" |
|
|
|
echo "给apk增加签名" |
|
|
|
cp $GITHUB_WORKSPACE/.github/workflows/legado.jks $GITHUB_WORKSPACE/app/legado.jks |
|
|
|
cp $GITHUB_WORKSPACE/.github/workflows/legado.jks $GITHUB_WORKSPACE/app/legado.jks |
|
|
@ -47,12 +52,12 @@ jobs: |
|
|
|
sed '$a\RELEASE_KEY_ALIAS=legado' $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_STORE_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i |
|
|
|
sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i |
|
|
|
sed '$a\RELEASE_KEY_PASSWORD=gedoor_legado' $GITHUB_WORKSPACE/gradle.properties -i |
|
|
|
- name: apk live together |
|
|
|
- name: Apk Live Together |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
echo "设置apk共存" |
|
|
|
echo "设置apk共存" |
|
|
|
sed "s/'.release'/'.releaseA'/" $GITHUB_WORKSPACE/app/build.gradle -i |
|
|
|
sed "s/'.release'/'.releaseA'/" $GITHUB_WORKSPACE/app/build.gradle -i |
|
|
|
sed 's/.release/.releaseA/' $GITHUB_WORKSPACE/app/google-services.json -i |
|
|
|
sed 's/.release/.releaseA/' $GITHUB_WORKSPACE/app/google-services.json -i |
|
|
|
- name: build with gradle |
|
|
|
- name: Build With Gradle |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
echo "开始进行release构建" |
|
|
|
echo "开始进行release构建" |
|
|
|
chmod +x gradlew |
|
|
|
chmod +x gradlew |
|
|
@ -63,12 +68,12 @@ jobs: |
|
|
|
with: |
|
|
|
with: |
|
|
|
name: legado apk |
|
|
|
name: legado apk |
|
|
|
path: ${{ github.workspace }}/app/build/outputs/apk/app/release/*.apk |
|
|
|
path: ${{ github.workspace }}/app/build/outputs/apk/app/release/*.apk |
|
|
|
- name: Set up Python 3.8 |
|
|
|
- name: Set Up Python 3 |
|
|
|
if: ${{ env.LANZOU_PSD }} |
|
|
|
if: ${{ env.LANZOU_PSD }} |
|
|
|
uses: actions/setup-python@v2 |
|
|
|
uses: actions/setup-python@v2 |
|
|
|
with: |
|
|
|
with: |
|
|
|
python-version: 3.8 |
|
|
|
python-version: 3.x |
|
|
|
- name: Set up lanzou-api |
|
|
|
- name: Dependence Install |
|
|
|
if: ${{ env.LANZOU_PSD }} |
|
|
|
if: ${{ env.LANZOU_PSD }} |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
pip install requests |
|
|
|
pip install requests |
|
|
@ -79,10 +84,10 @@ jobs: |
|
|
|
run: | |
|
|
|
run: | |
|
|
|
import requests,os |
|
|
|
import requests,os |
|
|
|
res = requests.get('https://raw.githubusercontent.com/Celeter/build/master/.github/scripts/API_lanzou.py') |
|
|
|
res = requests.get('https://raw.githubusercontent.com/Celeter/build/master/.github/scripts/API_lanzou.py') |
|
|
|
with open(os.environ["FILEPATH"], 'wb') as f: |
|
|
|
with open(os.environ["FILE_PATH"], 'wb') as f: |
|
|
|
f.write(res.content) |
|
|
|
f.write(res.content) |
|
|
|
env: |
|
|
|
env: |
|
|
|
FILEPATH: ${{ github.workspace }}/.github/lzy.py |
|
|
|
FILE_PATH: ${{ github.workspace }}/.github/lzy.py |
|
|
|
- name: Upload App To Lanzou |
|
|
|
- name: Upload App To Lanzou |
|
|
|
if: ${{ env.LANZOU_PSD }} |
|
|
|
if: ${{ env.LANZOU_PSD }} |
|
|
|
run: python $GITHUB_WORKSPACE/.github/lzy.py |
|
|
|
run: python $GITHUB_WORKSPACE/.github/lzy.py |
|
|
|