chore: action #624
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, 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: 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: | | ||
Check failure on line 109 in .github/workflows/test.yml GitHub Actions / Build TestInvalid workflow file
|
||
mkdir apk | ||
cp "${{env.outputs_dir}}/apk/${{ env.product }}/release/*${{ env.ver_name }}.apk" "${{ 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" |