diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acb9f4d5..80f6aefc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,13 +23,13 @@ jobs: fail-fast: false matrix: include: - - platform: android + - platform: android-apk os: ubuntu-latest targets: apk - # - platform: android-aab - # os: ubuntu-latest - # targets: aab + - platform: android-aab + os: ubuntu-latest + targets: aab - platform: windows os: windows-latest @@ -124,6 +124,7 @@ jobs: make ${{ matrix.platform }}-libs - name: Setup Signing Properties + if: startsWith(matrix.platform,'android') env: ANDROID_SIGNING_KEY_ALIAS: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} ANDROID_SIGNING_KEY_PASSWORD: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} @@ -161,8 +162,8 @@ jobs: xcopy /s /v D:\a\hiddify-next\hiddify-next\build\windows\runner\Release\ .\HiddifyNext-portable\ Compress-Archive HiddifyNext-portable out\hiddify-${{ matrix.platform }}-x64-portable.zip - - name: Copy to out Android - if: matrix.platform == 'android' + - name: Copy to out Android aab + if: matrix.platform == 'android-apk' run: | mkdir out ls -R ./build/app/outputs @@ -170,7 +171,13 @@ jobs: mv ./build/app/outputs/flutter-apk/*armeabi-v7a*.apk out/hiddify-android-arm7.apk || echo "no arm7 apk" mv ./build/app/outputs/flutter-apk/*x86_64*.apk out/hiddify-android-x86_64.apk || echo "no x64 apk" mv ./build/app/outputs/flutter-apk/app-release.apk out/hiddify-android-universal.apk || echo "no universal apk" - cp ./build/app/outputs/bundle/release/app-release.aab out/bundle.aab + + - name: Copy to out Android aab + if: matrix.platform == 'android-apk' + run: | + mkdir out + ls -R ./build/app/outputs + cp ./build/app/outputs/bundle/release/app-release.aab out/hiddify-android-market.aab || echo "no aab" - name: Copy to out unix if: matrix.platform == 'linux' || matrix.platform == 'macos' || matrix.platform == 'ios' @@ -194,19 +201,19 @@ jobs: path: ./out retention-days: 2 - # - name: Create service_account.json - # if: matrix.platform == 'android' - # run: echo '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}' > service_account.json + - name: Create service_account.json + if: matrix.platform == 'android-aab' && github.ref_type=='tag' + run: echo '${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}' > service_account.json - # - name: Deploy to Internal Testers - # if: matrix.platform == 'android' - # uses: r0adkll/upload-google-play@v1 - # with: - # serviceAccountJson: service_account.json - # packageName: app.hiddify.com - # releaseName: ${{ github.ref }} - # releaseFiles: ./build/app/outputs/bundle/release/app-release.aab - # track: internal + - name: Deploy to Internal Testers + if: matrix.platform == 'android-aab' && github.ref_type=='tag' + uses: r0adkll/upload-google-play@v1 + with: + serviceAccountJson: service_account.json + packageName: app.hiddify.com + releaseName: ${{ github.ref }} + releaseFiles: ./build/app/outputs/bundle/release/hiddify-android-market.aab + track: internal upload-prerelease: permissions: write-all @@ -263,5 +270,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: + prerelease: ${{ contains(github.ref_name,'dev') }} tag_name: ${{ github.ref_name }} files: ./out/* diff --git a/Makefile b/Makefile index 56e2c0df..fe4ca908 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ gen: translate: dart run slang -android-release: android-aab-release android-apk-release +android-release: android-apk-release android-apk-release: flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi --target $(TARGET)