Skip to content

refactor: separation module for lib-compose #658

refactor: separation module for lib-compose

refactor: separation module for lib-compose #658

Workflow file for this run

name: Build Test
on:
push:
branches:
- "master"
- "compose"
paths-ignore:
- "**.md"
workflow_dispatch:
jobs:
go-lib:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
go-version: 1.20.3
cache-dependency-path: ${{ github.workspace }}/tts-server-lib
- name: Build tts-server-lib
run: |
cd $GITHUB_WORKSPACE/.github/scripts
chmod +x *.sh
./build_gojni.sh
- uses: actions/upload-artifact@v5
with:
name: tts-server-lib
path: lib-gojni-aar/*.aar
build:
needs: go-lib
strategy:
matrix:
product: [ { name: "App原版", value: app, lzyId: "9493563" }, { name: "Dev共存版", value: dev, lzyId: "7381570" } ]
fail-fast: false
runs-on: ubuntu-latest
env:
product: ${{ matrix.product.value }}
product_name: ${{ matrix.product.value }}
lzy_folder_id: ${{ matrix.product.lzyId }}
ylogin: ${{ secrets.LANZOU_ID }}
phpdisk_info: ${{ secrets.LANZOU_PSD }}
outputs_dir: "${{ github.workspace }}/app/build/outputs"
ver_name: ""
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: tts-server-lib
path: ${{ github.workspace }}/lib-gojni-aar
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Init Signature
run: |
touch local.properties
echo ALIAS_NAME='${{ secrets.ALIAS_NAME }}' >> local.properties
echo ALIAS_PASSWORD='${{ secrets.ALIAS_PASSWORD }}' >> local.properties
echo KEY_PASSWORD='${{ secrets.KEY_PASSWORD }}' >> local.properties
echo KEY_PATH='./key.jks' >> local.properties
# 从Secrets读取无换行符Base64解码, 然后保存到到app/key.jks
echo ${{ secrets.KEY_STORE }} | base64 --decode > $GITHUB_WORKSPACE/app/key.jks
- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew assemble${{ env.product }}release --build-cache --parallel --daemon --warning-mode all
- name: Set Version Name
run: |
echo "ver_name=$(grep -m 1 'versionName' ${{ env.outputs_dir }}/apk/${{ env.product }}/release/output-metadata.json | cut -d\" -f4)" >> $GITHUB_ENV
# - name: Set APK Path
# run: |
# echo "apk_path=${{ env.outputs_dir }}/apk/${{ env.product }}/release/${{ env.product }}-release.apk" >> $GITHUB_ENV
# - name: Upload Mappings to Artifact
# uses: actions/upload-artifact@v3
# with:
# name: mappings_${{ env.product }}_${{ env.ver_name }}
# path: ${{ env.outputs_dir }}/mapping/*/*.txt
- name: Upload APK To Artifact
uses: actions/upload-artifact@v3
with:
name: "TTS-Server_${{ env.product }}_${{ env.ver_name }}"
path: ${{env.outputs_dir}}/apk/${{ env.product }}/release/*${{ env.ver_name }}.apk
- name: Upload APK To Lanzouyun
run: |
mkdir apk
cp ${{ env.outputs_dir }}/apk/${{ env.product }}/release/*${{ env.ver_name }}.apk "${{ github.workspace }}/apk"
path="${{ github.workspace }}/apk"
python3 ${{ github.workspace }}/.github/scripts/lzy_web.py $path "${{ env.lzy_folder_id }}"
# echo "app: https://jing332.lanzn.com/b09jpjd2d"
# echo "dev: https://jing332.lanzn.com/b09ig9qla"
# echo "密码PWD: 1234"