test.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: Test Build
  2. on:
  3. workflow_dispatch:
  4. jobs:
  5. build:
  6. runs-on: ubuntu-latest
  7. steps:
  8. - uses: actions/setup-node@v4 # Use the latest version of setup-node
  9. with:
  10. node-version: 16 # Explicitly set Node.js version to 16
  11. - uses: actions/checkout@v2
  12. - name: Set up JDK and Gradle
  13. uses: actions/setup-java@v2
  14. with:
  15. java-version: '11'
  16. distribution: 'adopt'
  17. - name: Release Apk Sign
  18. run: |
  19. signingConfigs='ICAgIHNpZ25pbmdDb25maWdzIHtcCiAgICAgICAgaWYgKHByb2plY3QuaGFzUHJvcGVydHkoIlJFTEVBU0VfU1RPUkVfRklMRSIpKSB7XAogICAgICAgICAgICBteUNvbmZpZyB7XAogICAgICAgICAgICAgICAgc3RvcmVGaWxlIGZpbGUoUkVMRUFTRV9TVE9SRV9GSUxFKVwKICAgICAgICAgICAgICAgIHN0b3JlUGFzc3dvcmQgUkVMRUFTRV9TVE9SRV9QQVNTV09SRFwKICAgICAgICAgICAgICAgIGtleUFsaWFzIFJFTEVBU0VfS0VZX0FMSUFTXAogICAgICAgICAgICAgICAga2V5UGFzc3dvcmQgUkVMRUFTRV9LRVlfUEFTU1dPUkRcCiAgICAgICAgICAgICAgICB2MVNpZ25pbmdFbmFibGVkIHRydWVcCiAgICAgICAgICAgICAgICB2MlNpZ25pbmdFbmFibGVkIHRydWVcCiAgICAgICAgICAgICAgICBlbmFibGVWM1NpZ25pbmcgPSB0cnVlXAogICAgICAgICAgICAgICAgZW5hYmxlVjRTaWduaW5nID0gdHJ1ZVwKICAgICAgICAgICAgfVwKICAgICAgICB9XAogICAgfVwKXA=='
  20. signingConfig='ICAgICAgICAgICAgaWYgKHByb2plY3QuaGFzUHJvcGVydHkoIlJFTEVBU0VfU1RPUkVfRklMRSIpKSB7XAogICAgICAgICAgICAgICAgc2lnbmluZ0NvbmZpZyBzaWduaW5nQ29uZmlncy5teUNvbmZpZ1wKICAgICAgICAgICAgfVwK'
  21. signingConfigs="$(echo "$signingConfigs" |base64 -d )"
  22. signingConfig="$(echo "$signingConfig" |base64 -d )"
  23. sed -i -e "/defaultConfig {/i\\$signingConfigs " -e "/debug {/a\\$signingConfig " -e "/release {/a\\$signingConfig " app/build.gradle
  24. cp -f ${{ github.workspace }}/.github/workflows/TVBoxOSC.jks app/TVBoxOSC.jks
  25. sed -i '$a\RELEASE_STORE_FILE=./TVBoxOSC.jks' ./gradle.properties
  26. sed -i '$a\RELEASE_KEY_ALIAS=TVBoxOSC' ./gradle.properties
  27. sed -i '$a\RELEASE_STORE_PASSWORD=TVBoxOSC' ./gradle.properties
  28. sed -i '$a\RELEASE_KEY_PASSWORD=TVBoxOSC' ./gradle.properties
  29. - name: Build With Gradle
  30. run: |
  31. chmod +x gradlew
  32. ./gradlew clean assembleRelease --parallel --daemon --warning-mode all --stacktrace
  33. - name: Prepare App
  34. run: |
  35. mkdir -p ${{ github.workspace }}/apk/
  36. find . -name "*.apk" -exec mv {} ${{ github.workspace }}/apk/ \;
  37. - name: Upload App To Artifact
  38. uses: actions/upload-artifact@v2
  39. with:
  40. name: com.fongmi.android.tv
  41. path: ${{ github.workspace }}/apk/*