Merge pull request #149 from jing332/l10n_compose #614
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Test | |
on: | |
push: | |
branches: | |
- "master" | |
- "compose" | |
paths-ignore: | |
- "**.md" | |
workflow_dispatch: | |
jobs: | |
go-lib: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20.3 | |
cache-dependency-path: ${{ github.workspace }}/tts-server-lib | |
- name: Build tts-server-lib | |
run: | | |
cd tts-server-lib | |
go install golang.org/x/mobile/cmd/gomobile | |
gomobile init | |
go get golang.org/x/mobile/bind | |
gomobile bind -ldflags "-s -w" -v -androidapi=21 | |
cp -f *.aar $GITHUB_WORKSPACE/app/libs | |
- uses: actions/[email protected] | |
with: | |
name: tts-server-lib | |
path: tts-server-lib/*.aar | |
build: | |
needs: go-lib | |
strategy: | |
matrix: | |
product: [ { name: "App原版", value: app }, { name: "Dev共存版", value: dev } ] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
env: | |
product: ${{ matrix.product.value }} | |
product_name: ${{matrix.product.value}} | |
outputs_dir: "${{ github.workspace }}/app/build/outputs" | |
ver_name: "" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: tts-server-lib | |
path: ${{ github.workspace }}/app/libs | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- 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: Init environment variable | |
run: | | |
echo "ver_name=$(grep -m 1 'versionName' ${{ env.outputs_dir }}/apk/${{ env.product }}/release/output-metadata.json | cut -d\" -f4)" >> $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 |