Skip to content

chore: action

chore: action #622

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@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, 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@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: |

Check failure on line 88 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Build Test

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 88, Col: 14): Unrecognized named-value: 'verName'. Located at position 1 within expression: verName .github/workflows/test.yml (Line: 106, Col: 14): Unrecognized named-value: 'GITHUB_WORKSPACE'. Located at position 1 within expression: GITHUB_WORKSPACE
verName="$(grep -m 1 'versionName' ${{ env.outputs_dir }}/apk/${{ env.product }}/release/output-metadata.json | cut -d\" -f4)"
echo "ver_name=${{ verName }}" >> $GITHUB_ENV
echo "apk_path=${{ env.outputs_dir }}/apk/${{ env.product }}/release/*${{ verName }}.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.apk_path }}
- name: Upload APK To Lanzouyun
run: |
mkdir apk
cp ${{ env.apk_path }} "${{ GITHUB_WORKSPACE }}/apk/"
python3 $GITHUB_WORKSPACE/.github/scripts/lzy_web.py "${{ $GITHUB_WORKSPACE }}/apk" "${{ env.lzy_folder_id }}"
echo "app: https://jing332.lanzn.com/b09jpjd2d"
echo "dev: https://jing332.lanzn.com/b09ig9qla"
echo "密码PWD: 1234"