From 41abe791f72be00a6891d7fa7e130c6ce4ab4999 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Mon, 11 Mar 2024 19:05:19 +0100 Subject: [PATCH 01/21] new: add ios build process --- .github/workflows/build.yml | 125 ++++++++++++++++++++++-------------- 1 file changed, 77 insertions(+), 48 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 409cfc90..c08bcf2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,29 +58,34 @@ jobs: fail-fast: false matrix: include: - - platform: android-apk - os: ubuntu-latest - targets: apk + # - 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-2019 - aarch: amd64 - targets: exe,msix + # - platform: windows + # os: windows-2019 + # aarch: amd64 + # targets: exe,msix - - platform: linux - os: ubuntu-22.04 - aarch: amd64 - targets: AppImage,deb,rpm + # - platform: linux + # os: ubuntu-22.04 + # aarch: amd64 + # targets: AppImage,deb,rpm - - platform: macos + # - platform: macos + # os: macos-13 + # aarch: universal + # targets: dmg,pkg + + - platform: ios os: macos-13 aarch: universal - targets: dmg,pkg - + filename: hiddify-ios + targets: ipa runs-on: ${{ matrix.os }} steps: - name: checkout @@ -131,41 +136,55 @@ jobs: run: | [IO.File]::WriteAllBytes("windows\sign.pfx", [Convert]::FromBase64String("${{ secrets.WINDOWS_SIGNING_KEY }}")) (Get-Content "windows\packaging\msix\make_config.yaml") -replace '^certificate_password:.*$', 'certificate_password: ${{ secrets.WINDOWS_SIGNING_PASSWORD }}' | Set-Content "windows\packaging\msix\make_config.yaml" - - - - name: Setup Apple certificate and provisioning profile + + - name: Import Apple Codesign Certificates if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} - env: - BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_BUILD_CERTIFICATE_BASE64 }} - P12_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }} - BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.APPLE_BUILD_PROVISION_PROFILE_BASE64 }} - BUILD_PACKET_TUNNEL_PROVISION_PROFILE_BASE64: ${{ secrets.APPLE_BUILD_PACKET_TUNNEL_PROVISION_PROFILE_BASE64 }} - KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} - run: | - # create variables - CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision - PP_PACKET_TUNNEL_PATH=$RUNNER_TEMP/build_pppt.mobileprovision - KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + uses: apple-actions/import-codesign-certs@v2 + with: + p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} + p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} + - name: Download Provisioning Profile + if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} + uses: Apple-Actions/download-provisioning-profiles@v1 + with: + bundle-id: app.hiddify.com + issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} + api-key-id: ${{ secrets.APPSTORE_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }} - # import certificate and provisioning profile from secrets - echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH - echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH - echo -n "$BUILD_PACKET_TUNNEL_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PACKET_TUNNEL_PATH + # - name: Setup Apple certificate and provisioning profile + # if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} + # env: + # BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_BUILD_CERTIFICATE_BASE64 }} + # P12_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }} + # BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.APPLE_BUILD_PROVISION_PROFILE_BASE64 }} + # BUILD_PACKET_TUNNEL_PROVISION_PROFILE_BASE64: ${{ secrets.APPLE_BUILD_PACKET_TUNNEL_PROVISION_PROFILE_BASE64 }} + # KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} + # run: | + # # create variables + # CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + # PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision + # PP_PACKET_TUNNEL_PATH=$RUNNER_TEMP/build_pppt.mobileprovision + # KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db - # create temporary keychain - security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + # # import certificate and provisioning profile from secrets + # echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH + # echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH + # echo -n "$BUILD_PACKET_TUNNEL_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PACKET_TUNNEL_PATH - # import certificate to keychain - security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - security list-keychain -d user -s $KEYCHAIN_PATH + # # create temporary keychain + # security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + # security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + # security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - # apply provisioning profile - mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles - cp $PP_PACKET_TUNNEL_PATH ~/Library/MobileDevice/Provisioning\ Profiles + # # import certificate to keychain + # security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + # security list-keychain -d user -s $KEYCHAIN_PATH + + # # apply provisioning profile + # mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + # cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles + # cp $PP_PACKET_TUNNEL_PATH ~/Library/MobileDevice/Provisioning\ Profiles - name: Build ${{ matrix.platform }} env: @@ -362,4 +381,14 @@ jobs: packageName: app.hiddify.com releaseName: ${{ env.TAG_NAME }} releaseFiles: ./hiddify-android-market.aab - track: 'beta' \ No newline at end of file + track: 'beta' + + + + - name: 'Upload app to TestFlight' + uses: apple-actions/upload-testflight-build@v1 + with: + app-path: 'dist/out/Hiddify-iOS.ipa' + issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} + api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} \ No newline at end of file From 3afff556cddde36bf3f32d31921bede29c5ee613 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Mon, 11 Mar 2024 19:26:45 +0100 Subject: [PATCH 02/21] add prereq of ios --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 59f17175..8557019b 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,9 @@ macos-install-dependencies: dart pub global activate flutter_distributor ios-install-dependencies: - echo "not yet implemented" + brew install create-dmg tree + npm install -g appdmg + dart pub global activate flutter_distributor android-install-dependencies: echo "nothing yet" From 91d73c68664de4be72abb4e56a6dce95492f3886 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Mon, 11 Mar 2024 19:39:08 +0100 Subject: [PATCH 03/21] fix: vaiable issue --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c08bcf2d..e9f46b72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -141,8 +141,8 @@ jobs: if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} uses: apple-actions/import-codesign-certs@v2 with: - p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} - p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} + p12-file-base64: ${{ secrets.APPLE_CERTIFICATES_P12 }} + p12-password: ${{ secrets.APPLE_CERTIFICATES_P12_PASSWORD }} - name: Download Provisioning Profile if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} uses: Apple-Actions/download-provisioning-profiles@v1 From 17105ca6adee9caaf514ea05d2f9952541e2f806 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Mon, 11 Mar 2024 20:03:33 +0100 Subject: [PATCH 04/21] fix: var --- .github/workflows/build.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e9f46b72..a8aaeef1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,15 +36,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: subosito/flutter-action@v2.12.0 #issue with 2.13 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - channel: 'stable' - cache: true - - name: Prepare - run: make linux-prepare - - name: Test - run: flutter test + # - uses: subosito/flutter-action@v2.12.0 #issue with 2.13 + # with: + # flutter-version: ${{ env.FLUTTER_VERSION }} + # channel: 'stable' + # cache: true + # - name: Prepare + # run: make linux-prepare + # - name: Test + # run: flutter test - name: make draftBuildCode id: draftBuildCode @@ -141,8 +141,8 @@ jobs: if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} uses: apple-actions/import-codesign-certs@v2 with: - p12-file-base64: ${{ secrets.APPLE_CERTIFICATES_P12 }} - p12-password: ${{ secrets.APPLE_CERTIFICATES_P12_PASSWORD }} + p12-file-base64: "${{ secrets.APPLE_CERTIFICATE_P12 }}" + p12-password: "${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }}" - name: Download Provisioning Profile if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} uses: Apple-Actions/download-provisioning-profiles@v1 From f786322a96ebf2677ee7583f03ffa4133a89aa0b Mon Sep 17 00:00:00 2001 From: Hiddify Date: Mon, 11 Mar 2024 20:09:19 +0100 Subject: [PATCH 05/21] fix: var --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8aaeef1..7952bfbc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -149,8 +149,8 @@ jobs: with: bundle-id: app.hiddify.com issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} - api-key-id: ${{ secrets.APPSTORE_KEY_ID }} - api-private-key: ${{ secrets.APPSTORE_PRIVATE_KEY }} + api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} # - name: Setup Apple certificate and provisioning profile # if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} From 56764c47478ad5e1a625d16428efe388c2968eb1 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Mon, 11 Mar 2024 20:28:15 +0100 Subject: [PATCH 06/21] update --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7952bfbc..50a070e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,10 +117,6 @@ jobs: run: | make ${{ matrix.platform }}-install-dependencies - - name: Prepare for ${{ matrix.platform }} - run: | - make ${{ matrix.platform }}-prepare - tree - name: Setup Android Signing Properties if: ${{ inputs.upload-artifact && startsWith(matrix.platform,'android') }} @@ -147,7 +143,7 @@ jobs: if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} uses: Apple-Actions/download-provisioning-profiles@v1 with: - bundle-id: app.hiddify.com + bundle-id: 3JFTY5BP58.app.hiddify.com issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} @@ -186,6 +182,10 @@ jobs: # cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles # cp $PP_PACKET_TUNNEL_PATH ~/Library/MobileDevice/Provisioning\ Profiles + - name: Prepare for ${{ matrix.platform }} + run: | + make ${{ matrix.platform }}-prepare + tree - name: Build ${{ matrix.platform }} env: SENTRY_DSN: ${{ secrets.SENTRY_DSN }} From 2c3f792ec05931337856de19a44a823cd12b96e4 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Mon, 11 Mar 2024 20:35:10 +0100 Subject: [PATCH 07/21] update --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50a070e0..f35539d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -143,7 +143,7 @@ jobs: if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} uses: Apple-Actions/download-provisioning-profiles@v1 with: - bundle-id: 3JFTY5BP58.app.hiddify.com + bundle-id: app.hiddify.com issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} From fb774ae47cab7c56387c12a5c115f58a1e45e208 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Mon, 11 Mar 2024 21:06:16 +0100 Subject: [PATCH 08/21] add SingBoxPacketTunnel --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f35539d0..970903da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -147,6 +147,14 @@ jobs: issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} + - name: Download Provisioning Profile SingBoxPacketTunnel + if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} + uses: Apple-Actions/download-provisioning-profiles@v1 + with: + bundle-id: app.hiddify.com.SingBoxPacketTunnel + issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} + api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} # - name: Setup Apple certificate and provisioning profile # if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} From 4ea4576db8d58e36085faf0fa9c4b370d83223a6 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Tue, 12 Mar 2024 08:09:14 +0100 Subject: [PATCH 09/21] add provisioning profiles --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 970903da..5e49a6a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -139,6 +139,13 @@ jobs: with: p12-file-base64: "${{ secrets.APPLE_CERTIFICATE_P12 }}" p12-password: "${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }}" + + - name: Import Apple Mobile Provisioning Profile + if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} + run: | + echo "${{secrets.APPLE_MOBILE_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/ + + - name: Download Provisioning Profile if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} uses: Apple-Actions/download-provisioning-profiles@v1 From c3d788cca03a558373d62c5d5d92107ec5613078 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Tue, 12 Mar 2024 08:29:25 +0100 Subject: [PATCH 10/21] update --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e49a6a3..6a619d5b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -143,6 +143,7 @@ jobs: - name: Import Apple Mobile Provisioning Profile if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} run: | + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles echo "${{secrets.APPLE_MOBILE_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/ From c8c2c0684200a1e25f3a476eea9ff6a8598f0ee9 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Tue, 12 Mar 2024 09:18:35 +0100 Subject: [PATCH 11/21] update --- .github/workflows/build.yml | 3 +++ .github/workflows/dev-i copy.yml | 2 +- .github/workflows/dev-i.yml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a619d5b..80169c66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -145,6 +145,9 @@ jobs: run: | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles echo "${{secrets.APPLE_MOBILE_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/ + echo "${{secrets.APPLE_DEVLOP_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/ + + - name: Download Provisioning Profile diff --git a/.github/workflows/dev-i copy.yml b/.github/workflows/dev-i copy.yml index db8d6551..80d55f02 100644 --- a/.github/workflows/dev-i copy.yml +++ b/.github/workflows/dev-i copy.yml @@ -2,7 +2,7 @@ name: dev i new on: push: branches: - - ios + - ios2 paths-ignore: - '**.md' - 'docs/**' diff --git a/.github/workflows/dev-i.yml b/.github/workflows/dev-i.yml index 4643c4ec..0edb69dd 100644 --- a/.github/workflows/dev-i.yml +++ b/.github/workflows/dev-i.yml @@ -2,7 +2,7 @@ name: dev i on: push: branches: - - ios + - ios2 paths-ignore: - '**.md' - 'docs/**' From 67740424d39417c91f68475eec83d6b8ff54771f Mon Sep 17 00:00:00 2001 From: Hiddify Date: Tue, 12 Mar 2024 10:22:48 +0100 Subject: [PATCH 12/21] update --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 80169c66..63718b94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -273,6 +273,7 @@ jobs: FILENAME=${!KEY} echo "For $EXT ($KEY) filename is ${FILENAME}" mv dist/*/*.$EXT tmp_out/${FILENAME}.$EXT + ls tmp_out chmod +x tmp_out/${FILENAME}.$EXT if [ "${{matrix.platform}}" == "linux" ];then cp ./.github/help/linux/* tmp_out/ @@ -280,7 +281,8 @@ jobs: cp ./.github/help/mac-windows/* tmp_out/ fi if [[ "${{matrix.platform}}" == 'ios' ]];then - mv tmp_out/${FILENAME}.$EXT bin/${FILENAME}.$EXT + echo mv tmp_out/${FILENAME}.$EXT bin/ + mv tmp_out/${FILENAME}.$EXT bin/ else cd tmp_out # 7z a ${FILENAME}.zip ./ From 506a811f39fdc28e521c3285393bb4fd72a4234d Mon Sep 17 00:00:00 2001 From: Hiddify Date: Tue, 12 Mar 2024 10:36:30 +0100 Subject: [PATCH 13/21] fix name issue --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63718b94..c1f2109d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -281,8 +281,8 @@ jobs: cp ./.github/help/mac-windows/* tmp_out/ fi if [[ "${{matrix.platform}}" == 'ios' ]];then - echo mv tmp_out/${FILENAME}.$EXT bin/ - mv tmp_out/${FILENAME}.$EXT bin/ + echo mv tmp_out/${FILENAME}.$EXT out/ + mv tmp_out/${FILENAME}.$EXT out/ else cd tmp_out # 7z a ${FILENAME}.zip ./ From 769d9b76be2b7688a59f77f44dbd54b9a9b74fc7 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Tue, 12 Mar 2024 11:09:10 +0100 Subject: [PATCH 14/21] test testflight upload --- .github/workflows/build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1f2109d..e74d4ca5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -355,7 +355,13 @@ jobs: tag_name: 'draft' body_path: './release.md' prerelease: true - + - name: 'Upload app to TestFlight' + uses: apple-actions/upload-testflight-build@v1 + with: + app-path: 'out/Hiddify-iOS.ipa' + issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} + api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} upload-release: permissions: write-all if: ${{ inputs.upload-artifact && inputs.tag-name != 'draft' }} @@ -409,7 +415,7 @@ jobs: - name: 'Upload app to TestFlight' uses: apple-actions/upload-testflight-build@v1 with: - app-path: 'dist/out/Hiddify-iOS.ipa' + app-path: 'out/Hiddify-iOS.ipa' issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} \ No newline at end of file From 6feb40a0f7fb553b9e5e26a31f5c3e33d8c7fbb5 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Tue, 12 Mar 2024 11:28:23 +0100 Subject: [PATCH 15/21] upload to appstore in macos --- .github/workflows/build.yml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e74d4ca5..7b1c07c3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -306,7 +306,15 @@ jobs: name: artifact path: ./out retention-days: 2 - + - name: 'Upload app to TestFlight' + if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} + # if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') && inputs.tag-name != 'draft' }} + uses: apple-actions/upload-testflight-build@v1 + with: + app-path: 'out/Hiddify-iOS.ipa' + issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} + api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} update-draft: permissions: write-all if: ${{ inputs.upload-artifact }} @@ -355,13 +363,6 @@ jobs: tag_name: 'draft' body_path: './release.md' prerelease: true - - name: 'Upload app to TestFlight' - uses: apple-actions/upload-testflight-build@v1 - with: - app-path: 'out/Hiddify-iOS.ipa' - issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} - api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} - api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} upload-release: permissions: write-all if: ${{ inputs.upload-artifact && inputs.tag-name != 'draft' }} @@ -411,11 +412,3 @@ jobs: track: 'beta' - - - name: 'Upload app to TestFlight' - uses: apple-actions/upload-testflight-build@v1 - with: - app-path: 'out/Hiddify-iOS.ipa' - issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} - api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} - api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} \ No newline at end of file From f35f994d4df3c4c5bdf4fc0cffca2267ed4c8d1e Mon Sep 17 00:00:00 2001 From: Hiddify Date: Wed, 13 Mar 2024 13:34:08 +0100 Subject: [PATCH 16/21] update ios release --- .github/workflows/build.yml | 8 ++++++-- lib/bootstrap.dart | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b1c07c3..f40970f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -144,8 +144,8 @@ jobs: if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} run: | mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - echo "${{secrets.APPLE_MOBILE_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/ - echo "${{secrets.APPLE_DEVLOP_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/ + echo "${{secrets.APPLE_MOBILE_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/Provisioning\ Profiles + # echo "${{secrets.APPLE_DEVLOP_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/Provisioning\ Profiles @@ -200,6 +200,10 @@ jobs: # mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles # cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles # cp $PP_PACKET_TUNNEL_PATH ~/Library/MobileDevice/Provisioning\ Profiles + - name: Temporary disable Permission Handler for windows due to its issue in permission + if: ${{ startsWith(matrix.platform,'windows') }} + run: | + (Get-Content -Path "pubspec.yaml") -notmatch "permission_handler" | Set-Content -Path "pubspec.yaml" - name: Prepare for ${{ matrix.platform }} run: | diff --git a/lib/bootstrap.dart b/lib/bootstrap.dart index 23dc04e2..c9abc2fb 100644 --- a/lib/bootstrap.dart +++ b/lib/bootstrap.dart @@ -63,7 +63,7 @@ Future lazyBootstrap( ); final enableAnalytics = - true || await container.read(analyticsControllerProvider.future); + await container.read(analyticsControllerProvider.future); if (enableAnalytics) { await _init( "analytics", From 6bb29734e0d0b093103709e089331280cefc1c15 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Wed, 13 Mar 2024 14:13:05 +0100 Subject: [PATCH 17/21] update --- .github/workflows/build.yml | 68 ++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f40970f6..70c3eae2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,6 +90,40 @@ jobs: steps: - name: checkout uses: actions/checkout@v3 + - name: Import Apple Codesign Certificates + if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} + uses: apple-actions/import-codesign-certs@v2 + with: + p12-file-base64: "${{ secrets.APPLE_CERTIFICATE_P12 }}" + p12-password: "${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }}" + + - name: Import Apple Mobile Provisioning Profile + if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} + run: | + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + echo "${{secrets.APPLE_MOBILE_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/Provisioning\ Profiles + # echo "${{secrets.APPLE_DEVLOP_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/Provisioning\ Profiles + + + + + - name: Download Provisioning Profile + if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} + uses: Apple-Actions/download-provisioning-profiles@v1 + with: + bundle-id: app.hiddify.com + issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} + api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} + - name: Download Provisioning Profile SingBoxPacketTunnel + if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} + uses: Apple-Actions/download-provisioning-profiles@v1 + with: + bundle-id: app.hiddify.com.SingBoxPacketTunnel + issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} + api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} + api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} + - name: Setup Flutter uses: subosito/flutter-action@v2.12.0 #issue with 2.13 @@ -133,40 +167,6 @@ jobs: [IO.File]::WriteAllBytes("windows\sign.pfx", [Convert]::FromBase64String("${{ secrets.WINDOWS_SIGNING_KEY }}")) (Get-Content "windows\packaging\msix\make_config.yaml") -replace '^certificate_password:.*$', 'certificate_password: ${{ secrets.WINDOWS_SIGNING_PASSWORD }}' | Set-Content "windows\packaging\msix\make_config.yaml" - - name: Import Apple Codesign Certificates - if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} - uses: apple-actions/import-codesign-certs@v2 - with: - p12-file-base64: "${{ secrets.APPLE_CERTIFICATE_P12 }}" - p12-password: "${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }}" - - - name: Import Apple Mobile Provisioning Profile - if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} - run: | - mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - echo "${{secrets.APPLE_MOBILE_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/Provisioning\ Profiles - # echo "${{secrets.APPLE_DEVLOP_PROVISIONING_PROFILES_TARGZ_BASE64}}"|base64 --decode | tar xz -C ~/Library/MobileDevice/Provisioning\ Profiles - - - - - - name: Download Provisioning Profile - if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} - uses: Apple-Actions/download-provisioning-profiles@v1 - with: - bundle-id: app.hiddify.com - issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} - api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} - api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} - - name: Download Provisioning Profile SingBoxPacketTunnel - if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} - uses: Apple-Actions/download-provisioning-profiles@v1 - with: - bundle-id: app.hiddify.com.SingBoxPacketTunnel - issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} - api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} - api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} - # - name: Setup Apple certificate and provisioning profile # if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} # env: From c2c0fa623f21edbcf278ee3996e26b0c18c12241 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Wed, 13 Mar 2024 14:14:23 +0100 Subject: [PATCH 18/21] update --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 70c3eae2..5bcdcf39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,7 +90,7 @@ jobs: steps: - name: checkout uses: actions/checkout@v3 - - name: Import Apple Codesign Certificates + - name: Import Apple Codesign Certificates if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} uses: apple-actions/import-codesign-certs@v2 with: From a39a582786f9e8da9d7e93e64fc43ac952758b57 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Wed, 13 Mar 2024 14:28:18 +0100 Subject: [PATCH 19/21] fix: ios publishing --- .github/workflows/build.yml | 69 ++++++++++--------------------------- 1 file changed, 18 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5bcdcf39..da7fb382 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,28 +58,28 @@ jobs: fail-fast: false matrix: include: - # - platform: android-apk - # os: ubuntu-latest - # targets: apk + - 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-2019 - # aarch: amd64 - # targets: exe,msix + - platform: windows + os: windows-2019 + aarch: amd64 + targets: exe,msix - # - platform: linux - # os: ubuntu-22.04 - # aarch: amd64 - # targets: AppImage,deb,rpm + - platform: linux + os: ubuntu-22.04 + aarch: amd64 + targets: AppImage,deb,rpm - # - platform: macos - # os: macos-13 - # aarch: universal - # targets: dmg,pkg + - platform: macos + os: macos-13 + aarch: universal + targets: dmg,pkg - platform: ios os: macos-13 @@ -167,39 +167,6 @@ jobs: [IO.File]::WriteAllBytes("windows\sign.pfx", [Convert]::FromBase64String("${{ secrets.WINDOWS_SIGNING_KEY }}")) (Get-Content "windows\packaging\msix\make_config.yaml") -replace '^certificate_password:.*$', 'certificate_password: ${{ secrets.WINDOWS_SIGNING_PASSWORD }}' | Set-Content "windows\packaging\msix\make_config.yaml" - # - name: Setup Apple certificate and provisioning profile - # if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} - # env: - # BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_BUILD_CERTIFICATE_BASE64 }} - # P12_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_P12_PASSWORD }} - # BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.APPLE_BUILD_PROVISION_PROFILE_BASE64 }} - # BUILD_PACKET_TUNNEL_PROVISION_PROFILE_BASE64: ${{ secrets.APPLE_BUILD_PACKET_TUNNEL_PROVISION_PROFILE_BASE64 }} - # KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} - # run: | - # # create variables - # CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 - # PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision - # PP_PACKET_TUNNEL_PATH=$RUNNER_TEMP/build_pppt.mobileprovision - # KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db - - # # import certificate and provisioning profile from secrets - # echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH - # echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH - # echo -n "$BUILD_PACKET_TUNNEL_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PACKET_TUNNEL_PATH - - # # create temporary keychain - # security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - # security set-keychain-settings -lut 21600 $KEYCHAIN_PATH - # security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH - - # # import certificate to keychain - # security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH - # security list-keychain -d user -s $KEYCHAIN_PATH - - # # apply provisioning profile - # mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles - # cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles - # cp $PP_PACKET_TUNNEL_PATH ~/Library/MobileDevice/Provisioning\ Profiles - name: Temporary disable Permission Handler for windows due to its issue in permission if: ${{ startsWith(matrix.platform,'windows') }} run: | From 7f964708b3a24e0ce04e643eb0c4b4ee2674cc07 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Wed, 13 Mar 2024 14:39:08 +0100 Subject: [PATCH 20/21] new: add installation dependencies for apple --- Makefile | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8557019b..81393676 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,7 @@ prepare: @echo make ios-prepare windows-prepare: get-geo-assets get gen translate windows-libs + ios-prepare: get-geo-assets get gen translate ios-libs macos-prepare: get-geo-assets get gen translate macos-libs linux-prepare: get-geo-assets get gen translate linux-libs @@ -77,9 +78,29 @@ macos-install-dependencies: dart pub global activate flutter_distributor ios-install-dependencies: + if [ "$(flutter)" = "true" ]; then + curl -l -o ~/Downloads/flutter_macos_3.19.3-stable.zip https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.19.3-stable.zip; + mkdir -p ~/develop; + cd ~/develop; + unzip ~/Downloads/flutter_macos_3.19.3-stable.zip; + export PATH="$$PATH:$$HOME/develop/flutter/bin"; + echo 'export PATH="$$PATH:$$HOME/develop/flutter/bin"' >> ~/.zshrc; + + export PATH="$PATH:$HOME/develop/flutter/bin"; + echo 'export PATH="$PATH:$HOME/develop/flutter/bin"' >> ~/.zshrc; + + curl -sSL https://rvm.io/mpapis.asc | gpg --import - + curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - + curl -sSL https://get.rvm.io | bash -s stable + brew install openssl@1.1 + PKG_CONFIG_PATH=$(brew --prefix openssl@1.1)/lib/pkgconfig rvm install 2.7.5 + sudo gem install cocoapods -V + fi brew install create-dmg tree npm install -g appdmg + dart pub global activate flutter_distributor + android-install-dependencies: echo "nothing yet" @@ -225,4 +246,5 @@ ios-temp-prepare: flutter build ios-framework cd ios pod install - \ No newline at end of file + + From 2182dbc8f2b89c209ae868faf7342fdcf50f0746 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Wed, 13 Mar 2024 14:39:50 +0100 Subject: [PATCH 21/21] upload versioned --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da7fb382..ad18683c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -278,8 +278,7 @@ jobs: path: ./out retention-days: 2 - name: 'Upload app to TestFlight' - if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') }} - # if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') && inputs.tag-name != 'draft' }} + if: ${{ inputs.upload-artifact && startsWith(matrix.os,'macos') && inputs.tag-name != 'draft' }} uses: apple-actions/upload-testflight-build@v1 with: app-path: 'out/Hiddify-iOS.ipa'