fm4.xBuild.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. name: Test4x 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 "/kitkat {/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.github.tvbox.fongmi
  41. path: ${{ github.workspace }}/apk/*