From 4c6a9d57589b0edc8cf59301e90a84c412e9ca14 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Thu, 19 Jun 2025 16:08:51 +0300 Subject: [PATCH 1/8] refactor(github): testflight publish --- .github/actions/ios/build/action.yml | 27 ++++++++++++++++--- .../actions/ios/prepare-publish/action.yml | 7 ++--- .../reusable-ios-testflight-publish.yaml | 8 ++++-- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.github/actions/ios/build/action.yml b/.github/actions/ios/build/action.yml index 347ac549..4d088d1f 100644 --- a/.github/actions/ios/build/action.yml +++ b/.github/actions/ios/build/action.yml @@ -37,15 +37,34 @@ runs: ISSUER_ID: ${{ inputs.appStoreConnectIssuerId }} ARCHIVE_PATH: ${{ inputs.archivePath }} run: | - CURRENT_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${{ github.workspace }}/Info.plist") - MARKETING_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${{ github.workspace }}/Info.plist") + # TODO rm + cd iosApp + + # CURRENT_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${{ github.workspace }}/Info.plist") + # MARKETING_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${{ github.workspace }}/Info.plist") + + CURRENT_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${{ github.workspace }}/iosApp/iosApp/Info.plist") + MARKETING_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${{ github.workspace }}/iosApp/iosApp/Info.plist") + + TEAM_ID_ENV=MYA32EHWN4 + BUNDLE_ID_ENV=com.rees46.loyalty-program + APP_NAME_ENV="REES46 Loyalty Program" + PROVISIONING_PROFILE_SPECIFIER_ENV="loyalty distribution" + + SHOP_ID=357382bf66ac0ce2f1722677c59511 + SHOP_SECRET=9902b2c111e006ee944833c95e9e6066 + BASE_URL=https://api.rees46.ru echo "Current version: $CURRENT_VERSION" echo "Current marketing version: $MARKETING_VERSION" xcrun xcodebuild \ - -workspace "${{ inputs.xcworkspace }}" \ - -scheme "${{ inputs.scheme }}" \ + # TODO rm + -project "iosApp.xcodeproj" \ + -scheme "iosApp" \ + # TODO rm + # -workspace "${{ inputs.xcworkspace }}" \ + # -scheme "${{ inputs.scheme }}" \ -configuration AppStoreDistribution \ -sdk iphoneos \ -parallelizeTargets \ diff --git a/.github/actions/ios/prepare-publish/action.yml b/.github/actions/ios/prepare-publish/action.yml index 30aa63d1..24c10526 100644 --- a/.github/actions/ios/prepare-publish/action.yml +++ b/.github/actions/ios/prepare-publish/action.yml @@ -69,6 +69,7 @@ runs: with: xcode-version: 16 - - name: Pod install - shell: bash - run: pod install + # TODO ? + # - name: Pod install + # shell: bash + # run: pod install diff --git a/.github/workflows/reusable-ios-testflight-publish.yaml b/.github/workflows/reusable-ios-testflight-publish.yaml index f6881c93..a0cfcbf1 100644 --- a/.github/workflows/reusable-ios-testflight-publish.yaml +++ b/.github/workflows/reusable-ios-testflight-publish.yaml @@ -62,7 +62,9 @@ jobs: secretsJson: ${{ toJSON(secrets) }} - name: Prepare ios enveronment - uses: rees46/workflow/.github/actions/ios/prepare-publish@master + # TODO rm + # uses: rees46/workflow/.github/actions/ios/prepare-publish@master + uses: rees46/workflow/.github/actions/ios/prepare-publish@refactor/publish-ios-workflow with: iosCertificateP12Base64: ${{ secrets.IOS_CERTIFICATE_P12 }} p12Password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} @@ -72,7 +74,9 @@ jobs: appStoreConnectApiKey: ${{ secrets.APP_STORE_CONNECT_API_KEY }} - name: Build ios - uses: rees46/workflow/.github/actions/ios/build@master + # TODO rm + # uses: rees46/workflow/.github/actions/ios/build@master + uses: rees46/workflow/.github/actions/ios/build@refactor/publish-ios-workflow with: appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} From cd7abadae0e3323d4bafe71462afe98212253b16 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Mon, 23 Jun 2025 09:55:59 +0300 Subject: [PATCH 2/8] feat(github): updated ios build action --- .github/actions/ios/build/action.yml | 57 ++++++++++++++++------------ 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/.github/actions/ios/build/action.yml b/.github/actions/ios/build/action.yml index 4d088d1f..7ad4c03a 100644 --- a/.github/actions/ios/build/action.yml +++ b/.github/actions/ios/build/action.yml @@ -36,6 +36,7 @@ runs: API_KEY_ID: ${{ inputs.appStoreConnectApiKeyId }} ISSUER_ID: ${{ inputs.appStoreConnectIssuerId }} ARCHIVE_PATH: ${{ inputs.archivePath }} + GITHUB_USERNAME: rees46 run: | # TODO rm cd iosApp @@ -46,11 +47,7 @@ runs: CURRENT_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${{ github.workspace }}/iosApp/iosApp/Info.plist") MARKETING_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${{ github.workspace }}/iosApp/iosApp/Info.plist") - TEAM_ID_ENV=MYA32EHWN4 - BUNDLE_ID_ENV=com.rees46.loyalty-program - APP_NAME_ENV="REES46 Loyalty Program" - PROVISIONING_PROFILE_SPECIFIER_ENV="loyalty distribution" - + GITHUB_TOKEN= ${{ secrets.GITHUB_TOKEN }} SHOP_ID=357382bf66ac0ce2f1722677c59511 SHOP_SECRET=9902b2c111e006ee944833c95e9e6066 BASE_URL=https://api.rees46.ru @@ -58,24 +55,34 @@ runs: echo "Current version: $CURRENT_VERSION" echo "Current marketing version: $MARKETING_VERSION" - xcrun xcodebuild \ - # TODO rm - -project "iosApp.xcodeproj" \ - -scheme "iosApp" \ - # TODO rm - # -workspace "${{ inputs.xcworkspace }}" \ - # -scheme "${{ inputs.scheme }}" \ - -configuration AppStoreDistribution \ + # TODO updated + # GITHUB_USERNAME=rees46 \ + TEAM_ID_ENV=MYA32EHWN4 \ + BUNDLE_ID_ENV=com.rees46.loyalty-program \ + APP_NAME_ENV="REES46 Loyalty Program" \ + PROVISIONING_PROFILE_SPECIFIER_ENV="loyalty distribution" \ + xcodebuild \ + -project iosApp.xcodeproj \ + -scheme iosApp \ + -configuration Release \ -sdk iphoneos \ - -parallelizeTargets \ - -showBuildTimingSummary \ - -disableAutomaticPackageResolution \ - -archivePath "$ARCHIVE_PATH" \ - archive \ - CODE_SIGN_STYLE=Manual \ - CURRENT_PROJECT_VERSION="$CURRENT_VERSION" \ - MARKETING_VERSION="$MARKETING_VERSION" \ - CODE_SIGN_IDENTITY="${{ inputs.codeSignIdentity }}" \ - DEVELOPMENT_TEAM="${{ inputs.developmentTeam }}" \ - PROVISIONING_PROFILE_SPECIFIER="${{ inputs.provisioningProfileSpecifier }}" \ - OTHER_CODE_SIGN_FLAGS="--deep" + clean build + + # TODO uncomment + # xcrun xcodebuild \ + # -workspace "${{ inputs.xcworkspace }}" \ + # -scheme "${{ inputs.scheme }}" \ + # -configuration AppStoreDistribution \ + # -sdk iphoneos \ + # -parallelizeTargets \ + # -showBuildTimingSummary \ + # -disableAutomaticPackageResolution \ + # -archivePath "$ARCHIVE_PATH" \ + # archive \ + # CODE_SIGN_STYLE=Manual \ + # CURRENT_PROJECT_VERSION="$CURRENT_VERSION" \ + # MARKETING_VERSION="$MARKETING_VERSION" \ + # CODE_SIGN_IDENTITY="${{ inputs.codeSignIdentity }}" \ + # DEVELOPMENT_TEAM="${{ inputs.developmentTeam }}" \ + # PROVISIONING_PROFILE_SPECIFIER="${{ inputs.provisioningProfileSpecifier }}" \ + # OTHER_CODE_SIGN_FLAGS="--deep" From fd6b7310e58fe57fe77a48ef60dae8152435e8af Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Mon, 23 Jun 2025 10:24:23 +0300 Subject: [PATCH 3/8] feat(github): pass gh-token to build action --- .github/actions/ios/build/action.yml | 6 +++++- .github/workflows/reusable-ios-testflight-publish.yaml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/ios/build/action.yml b/.github/actions/ios/build/action.yml index 7ad4c03a..c4744a48 100644 --- a/.github/actions/ios/build/action.yml +++ b/.github/actions/ios/build/action.yml @@ -2,6 +2,10 @@ name: ios build description: build ios package inputs: + githubToken: + description: GitHub token for authentication + required: true + default: '' archivePath: description: string required: true @@ -37,6 +41,7 @@ runs: ISSUER_ID: ${{ inputs.appStoreConnectIssuerId }} ARCHIVE_PATH: ${{ inputs.archivePath }} GITHUB_USERNAME: rees46 + GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} run: | # TODO rm cd iosApp @@ -47,7 +52,6 @@ runs: CURRENT_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${{ github.workspace }}/iosApp/iosApp/Info.plist") MARKETING_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${{ github.workspace }}/iosApp/iosApp/Info.plist") - GITHUB_TOKEN= ${{ secrets.GITHUB_TOKEN }} SHOP_ID=357382bf66ac0ce2f1722677c59511 SHOP_SECRET=9902b2c111e006ee944833c95e9e6066 BASE_URL=https://api.rees46.ru diff --git a/.github/workflows/reusable-ios-testflight-publish.yaml b/.github/workflows/reusable-ios-testflight-publish.yaml index a0cfcbf1..17d3b3cc 100644 --- a/.github/workflows/reusable-ios-testflight-publish.yaml +++ b/.github/workflows/reusable-ios-testflight-publish.yaml @@ -78,6 +78,7 @@ jobs: # uses: rees46/workflow/.github/actions/ios/build@master uses: rees46/workflow/.github/actions/ios/build@refactor/publish-ios-workflow with: + githubToken: ${{ secrets.GITHUB_TOKEN }} appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} archivePath: ${{ env.ARCHIVE_PATH }} From 63fd0bada368a982775346c4256c0c08750a9e7a Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Wed, 25 Jun 2025 12:34:22 +0300 Subject: [PATCH 4/8] feat(github): githu app token step --- .github/actions/ios/build/action.yml | 20 +++++++++++++++++-- .../reusable-ios-testflight-publish.yaml | 9 ++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/actions/ios/build/action.yml b/.github/actions/ios/build/action.yml index c4744a48..584e65b5 100644 --- a/.github/actions/ios/build/action.yml +++ b/.github/actions/ios/build/action.yml @@ -34,14 +34,24 @@ inputs: runs: using: composite steps: + - name: Debug package + shell: bash + run: | + curl -I -u _:${{ inputs.githubToken }} https://maven.pkg.github.com/rees46/kmp/com/rees46/ios/com.rees46.ios.gradle.plugin/maven-metadata.xml + + - name: Debug package + shell: bash + run: | + curl -I -u _:${{ inputs.githubToken }} https://maven.pkg.github.com/rees46/kmp/com/rees46/ios/com.rees46.ios.gradle.plugin/1.1.3/com.rees46.ios.gradle.plugin-1.1.3.pom + - name: Build and Archive shell: bash env: API_KEY_ID: ${{ inputs.appStoreConnectApiKeyId }} ISSUER_ID: ${{ inputs.appStoreConnectIssuerId }} ARCHIVE_PATH: ${{ inputs.archivePath }} - GITHUB_USERNAME: rees46 - GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} + GITHUB_USERNAME: _ + GITHUB_TOKEN: ${{ inputs.githubToken }} run: | # TODO rm cd iosApp @@ -90,3 +100,9 @@ runs: # DEVELOPMENT_TEAM="${{ inputs.developmentTeam }}" \ # PROVISIONING_PROFILE_SPECIFIER="${{ inputs.provisioningProfileSpecifier }}" \ # OTHER_CODE_SIGN_FLAGS="--deep" + + - name: Debug ios package + shell: bash + if: ${{ always() }} + run: | + ls -R ~/.gradle/caches/modules-2/files-2.1/ | grep 'com.rees46.ios' diff --git a/.github/workflows/reusable-ios-testflight-publish.yaml b/.github/workflows/reusable-ios-testflight-publish.yaml index 17d3b3cc..f7dacee2 100644 --- a/.github/workflows/reusable-ios-testflight-publish.yaml +++ b/.github/workflows/reusable-ios-testflight-publish.yaml @@ -73,12 +73,19 @@ jobs: appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} appStoreConnectApiKey: ${{ secrets.APP_STORE_CONNECT_API_KEY }} + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ secrets.GITHUB_APP_ID }} + private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }} + - name: Build ios # TODO rm # uses: rees46/workflow/.github/actions/ios/build@master uses: rees46/workflow/.github/actions/ios/build@refactor/publish-ios-workflow with: - githubToken: ${{ secrets.GITHUB_TOKEN }} + # githubToken: ${{ secrets.GITHUB_TOKEN }} + githubToken: ${{ steps.app-token.outputs.token }} appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} archivePath: ${{ env.ARCHIVE_PATH }} From 381ea8f9464d8dd9aff058fe8520664c50bdd5d1 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Wed, 25 Jun 2025 13:50:52 +0300 Subject: [PATCH 5/8] chore(github): debug token --- .../reusable-ios-testflight-publish.yaml | 107 ++++++++++-------- 1 file changed, 61 insertions(+), 46 deletions(-) diff --git a/.github/workflows/reusable-ios-testflight-publish.yaml b/.github/workflows/reusable-ios-testflight-publish.yaml index f7dacee2..829642f2 100644 --- a/.github/workflows/reusable-ios-testflight-publish.yaml +++ b/.github/workflows/reusable-ios-testflight-publish.yaml @@ -56,57 +56,72 @@ jobs: timeout-minutes: 20 steps: - - name: Prepare testflight - uses: rees46/workflow/.github/actions/publish/prepare-testflight@master - with: - secretsJson: ${{ toJSON(secrets) }} - - - name: Prepare ios enveronment - # TODO rm - # uses: rees46/workflow/.github/actions/ios/prepare-publish@master - uses: rees46/workflow/.github/actions/ios/prepare-publish@refactor/publish-ios-workflow - with: - iosCertificateP12Base64: ${{ secrets.IOS_CERTIFICATE_P12 }} - p12Password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} - provisioningProfileBase64: ${{ secrets.IOS_PROVISIONING_PROFILE }} - certificatePassword: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} - appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} - appStoreConnectApiKey: ${{ secrets.APP_STORE_CONNECT_API_KEY }} - - uses: actions/create-github-app-token@v1 id: app-token with: app-id: ${{ secrets.GITHUB_APP_ID }} private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }} - - name: Build ios - # TODO rm - # uses: rees46/workflow/.github/actions/ios/build@master - uses: rees46/workflow/.github/actions/ios/build@refactor/publish-ios-workflow - with: - # githubToken: ${{ secrets.GITHUB_TOKEN }} - githubToken: ${{ steps.app-token.outputs.token }} - appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} - appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} - archivePath: ${{ env.ARCHIVE_PATH }} - xcworkspace: ${{ inputs.xcworkspace }} - scheme: ${{ inputs.scheme }} - codeSignIdentity: ${{ inputs.codeSignIdentity }} - developmentTeam: ${{ inputs.developmentTeam }} - provisioningProfileSpecifier: ${{ inputs.provisioningProfileSpecifier }} + - name: Check token scopes + shell: bash + run: | + curl -s -u _:${{ steps.app-token.outputs.token }} https://api.github.com/users/octocat - - name: Archive ios - uses: rees46/workflow/.github/actions/ios/archive@master - with: - archivePath: ${{ env.ARCHIVE_PATH }} - exportOptionsPlistPath: ${{ env.EXPORT_OPTIONS_PLIST_PATH }} - archiveExportPath: ${{ env.ARCHIVE_EXPORT_PATH }} + - name: Debug package + shell: bash + run: | + curl -I -u _:${{ steps.app-token.outputs.token }} https://maven.pkg.github.com/rees46/kmp/com/rees46/ios/com.rees46.ios.gradle.plugin/maven-metadata.xml - - name: Upload to testflight - uses: rees46/workflow/.github/actions/publish/publish-testflight@master - with: - archiveExportPath: ${{ env.ARCHIVE_EXPORT_PATH }} - appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} - appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} - appStoreConnectApiKey: ${{ secrets.APP_STORE_CONNECT_API_KEY }} - scheme: ${{ inputs.scheme }} + - name: Debug package + shell: bash + run: | + curl -I -u _:${{ steps.app-token.outputs.token }} https://maven.pkg.github.com/rees46/kmp/com/rees46/ios/com.rees46.ios.gradle.plugin/1.1.3/com.rees46.ios.gradle.plugin-1.1.3.pom + + # - name: Prepare testflight + # uses: rees46/workflow/.github/actions/publish/prepare-testflight@master + # with: + # secretsJson: ${{ toJSON(secrets) }} + # + # - name: Prepare ios enveronment + # # TODO rm + # # uses: rees46/workflow/.github/actions/ios/prepare-publish@master + # uses: rees46/workflow/.github/actions/ios/prepare-publish@refactor/publish-ios-workflow + # with: + # iosCertificateP12Base64: ${{ secrets.IOS_CERTIFICATE_P12 }} + # p12Password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} + # provisioningProfileBase64: ${{ secrets.IOS_PROVISIONING_PROFILE }} + # certificatePassword: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} + # appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} + # appStoreConnectApiKey: ${{ secrets.APP_STORE_CONNECT_API_KEY }} + # + # - name: Build ios + # # TODO rm + # # uses: rees46/workflow/.github/actions/ios/build@master + # uses: rees46/workflow/.github/actions/ios/build@refactor/publish-ios-workflow + # with: + # # githubToken: ${{ secrets.GITHUB_TOKEN }} + # githubToken: ${{ steps.app-token.outputs.token }} + # appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} + # appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} + # archivePath: ${{ env.ARCHIVE_PATH }} + # xcworkspace: ${{ inputs.xcworkspace }} + # scheme: ${{ inputs.scheme }} + # codeSignIdentity: ${{ inputs.codeSignIdentity }} + # developmentTeam: ${{ inputs.developmentTeam }} + # provisioningProfileSpecifier: ${{ inputs.provisioningProfileSpecifier }} + # + # - name: Archive ios + # uses: rees46/workflow/.github/actions/ios/archive@master + # with: + # archivePath: ${{ env.ARCHIVE_PATH }} + # exportOptionsPlistPath: ${{ env.EXPORT_OPTIONS_PLIST_PATH }} + # archiveExportPath: ${{ env.ARCHIVE_EXPORT_PATH }} + # + # - name: Upload to testflight + # uses: rees46/workflow/.github/actions/publish/publish-testflight@master + # with: + # archiveExportPath: ${{ env.ARCHIVE_EXPORT_PATH }} + # appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} + # appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} + # appStoreConnectApiKey: ${{ secrets.APP_STORE_CONNECT_API_KEY }} + # scheme: ${{ inputs.scheme }} From cd5110525ede82cb85ec1c528ed52d282ab7d294 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Wed, 25 Jun 2025 13:53:31 +0300 Subject: [PATCH 6/8] feat(github): token for kmp repo --- .github/actions/ios/build/action.yml | 10 ---------- .github/workflows/reusable-ios-testflight-publish.yaml | 4 +++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/actions/ios/build/action.yml b/.github/actions/ios/build/action.yml index 584e65b5..07e3dbea 100644 --- a/.github/actions/ios/build/action.yml +++ b/.github/actions/ios/build/action.yml @@ -34,16 +34,6 @@ inputs: runs: using: composite steps: - - name: Debug package - shell: bash - run: | - curl -I -u _:${{ inputs.githubToken }} https://maven.pkg.github.com/rees46/kmp/com/rees46/ios/com.rees46.ios.gradle.plugin/maven-metadata.xml - - - name: Debug package - shell: bash - run: | - curl -I -u _:${{ inputs.githubToken }} https://maven.pkg.github.com/rees46/kmp/com/rees46/ios/com.rees46.ios.gradle.plugin/1.1.3/com.rees46.ios.gradle.plugin-1.1.3.pom - - name: Build and Archive shell: bash env: diff --git a/.github/workflows/reusable-ios-testflight-publish.yaml b/.github/workflows/reusable-ios-testflight-publish.yaml index 829642f2..8f79f46f 100644 --- a/.github/workflows/reusable-ios-testflight-publish.yaml +++ b/.github/workflows/reusable-ios-testflight-publish.yaml @@ -61,11 +61,13 @@ jobs: with: app-id: ${{ secrets.GITHUB_APP_ID }} private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }} + owner: rees46 + repositories: kmp - name: Check token scopes shell: bash run: | - curl -s -u _:${{ steps.app-token.outputs.token }} https://api.github.com/users/octocat + curl -I -u _:${{ steps.app-token.outputs.token }} https://api.github.com/ - name: Debug package shell: bash From ed99915c0a24f95c677ec4c4ed54f52c778a7051 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Wed, 25 Jun 2025 18:04:25 +0300 Subject: [PATCH 7/8] refactor(github): mv ios action to ios dir --- .github/actions/ios/build/action.yml | 60 ++++++++++--------- .../prepare-testflight/action.yml | 0 .../publish-testflight/action.yml | 0 3 files changed, 31 insertions(+), 29 deletions(-) rename .github/actions/{publish => ios}/prepare-testflight/action.yml (100%) rename .github/actions/{publish => ios}/publish-testflight/action.yml (100%) diff --git a/.github/actions/ios/build/action.yml b/.github/actions/ios/build/action.yml index 07e3dbea..470f688f 100644 --- a/.github/actions/ios/build/action.yml +++ b/.github/actions/ios/build/action.yml @@ -2,9 +2,21 @@ name: ios build description: build ios package inputs: + workingDirectory: + description: xcodebuild directory + required: false + default: '' + infoPlistPath: + description: Path to Info.plist to get application version + required: false + default: 'Info.plist' + githubUsername: + description: GitHub username for access to github-packages + required: false + default: '' githubToken: - description: GitHub token for authentication - required: true + description: GitHub token for access to github-packages + required: false default: '' archivePath: description: string @@ -34,33 +46,29 @@ inputs: runs: using: composite steps: + - name: Get versions + id: get-version + shell: bash + run: | + CURRENT_PROJECT_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${{ github.workspace }}/${{ inputs.infoPlistPath }}") + MARKETING_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${{ github.workspace }}/${{ inputs.infoPlistPath }}") + + echo "Current project version: $CURRENT_PROJECT_VERSION" + echo "Current marketing version: $MARKETING_VERSION" + + echo "currentProjectVersion=$CURRENT_PROJECT_VERSION" >> "$GITHUB_OUTPUT" + echo "marketingVersion=$MARKETING_VERSION" >> "$GITHUB_OUTPUT" + - name: Build and Archive shell: bash + working-directory: ${{ inputs.workingDirectory | github.workspace }} env: API_KEY_ID: ${{ inputs.appStoreConnectApiKeyId }} ISSUER_ID: ${{ inputs.appStoreConnectIssuerId }} ARCHIVE_PATH: ${{ inputs.archivePath }} - GITHUB_USERNAME: _ + GITHUB_USERNAME: ${{ inputs.githubUsername }} GITHUB_TOKEN: ${{ inputs.githubToken }} run: | - # TODO rm - cd iosApp - - # CURRENT_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${{ github.workspace }}/Info.plist") - # MARKETING_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${{ github.workspace }}/Info.plist") - - CURRENT_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${{ github.workspace }}/iosApp/iosApp/Info.plist") - MARKETING_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${{ github.workspace }}/iosApp/iosApp/Info.plist") - - SHOP_ID=357382bf66ac0ce2f1722677c59511 - SHOP_SECRET=9902b2c111e006ee944833c95e9e6066 - BASE_URL=https://api.rees46.ru - - echo "Current version: $CURRENT_VERSION" - echo "Current marketing version: $MARKETING_VERSION" - - # TODO updated - # GITHUB_USERNAME=rees46 \ TEAM_ID_ENV=MYA32EHWN4 \ BUNDLE_ID_ENV=com.rees46.loyalty-program \ APP_NAME_ENV="REES46 Loyalty Program" \ @@ -84,15 +92,9 @@ runs: # -archivePath "$ARCHIVE_PATH" \ # archive \ # CODE_SIGN_STYLE=Manual \ - # CURRENT_PROJECT_VERSION="$CURRENT_VERSION" \ - # MARKETING_VERSION="$MARKETING_VERSION" \ + # CURRENT_PROJECT_VERSION="${{ steps.get-version.outputs.currentProjectVersion }}" \ + # MARKETING_VERSION="${{ steps.get-version.outputs.marketingVersion }}" \ # CODE_SIGN_IDENTITY="${{ inputs.codeSignIdentity }}" \ # DEVELOPMENT_TEAM="${{ inputs.developmentTeam }}" \ # PROVISIONING_PROFILE_SPECIFIER="${{ inputs.provisioningProfileSpecifier }}" \ # OTHER_CODE_SIGN_FLAGS="--deep" - - - name: Debug ios package - shell: bash - if: ${{ always() }} - run: | - ls -R ~/.gradle/caches/modules-2/files-2.1/ | grep 'com.rees46.ios' diff --git a/.github/actions/publish/prepare-testflight/action.yml b/.github/actions/ios/prepare-testflight/action.yml similarity index 100% rename from .github/actions/publish/prepare-testflight/action.yml rename to .github/actions/ios/prepare-testflight/action.yml diff --git a/.github/actions/publish/publish-testflight/action.yml b/.github/actions/ios/publish-testflight/action.yml similarity index 100% rename from .github/actions/publish/publish-testflight/action.yml rename to .github/actions/ios/publish-testflight/action.yml From e1bc4d0eb5cc8de107c6940d772436ac41e81ca5 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Wed, 25 Jun 2025 18:05:04 +0300 Subject: [PATCH 8/8] feat(github): pass specific props to loyalty programm --- .../reusable-ios-testflight-publish.yaml | 134 +++++++++--------- 1 file changed, 69 insertions(+), 65 deletions(-) diff --git a/.github/workflows/reusable-ios-testflight-publish.yaml b/.github/workflows/reusable-ios-testflight-publish.yaml index 8f79f46f..b992e5b1 100644 --- a/.github/workflows/reusable-ios-testflight-publish.yaml +++ b/.github/workflows/reusable-ios-testflight-publish.yaml @@ -11,6 +11,15 @@ env: on: workflow_call: inputs: + workingDirectory: + description: xcodebuild execution directory + required: false + type: string + infoPlistPath: + description: Path to Info.plist to get application version + required: false + type: string + default: 'Info.plist' xcworkspace: required: true type: string @@ -26,6 +35,15 @@ on: provisioningProfileSpecifier: required: true type: string + shopId: + required: false + type: string + shopSecret: + required: false + type: string + baseUrl: + required: false + type: string secrets: GITHUB_APP_ID: required: true @@ -56,74 +74,60 @@ jobs: timeout-minutes: 20 steps: - - uses: actions/create-github-app-token@v1 - id: app-token + - name: Prepare testflight + uses: rees46/workflow/.github/actions/ios/prepare-testflight@master with: - app-id: ${{ secrets.GITHUB_APP_ID }} - private-key: ${{ secrets.GITHUB_APP_PRIVATE_KEY }} - owner: rees46 - repositories: kmp + secretsJson: ${{ toJSON(secrets) }} - - name: Check token scopes - shell: bash + - name: Set loyalty-program envs + if: ${{ inputs.shopId && iputs.shopSecret && inputs.baseUrl }} run: | - curl -I -u _:${{ steps.app-token.outputs.token }} https://api.github.com/ + echo "SHOP_ID=${{ inputs.shopId }}" >> "$GITHUB_ENV" + echo "SHOP_SECRET=${{ inputs.shopSecret }}" >> "$GITHUB_ENV" + echo "BASE_URL=${{ inputs.baseUrl }}" >> "$GITHUB_ENV" - - name: Debug package - shell: bash - run: | - curl -I -u _:${{ steps.app-token.outputs.token }} https://maven.pkg.github.com/rees46/kmp/com/rees46/ios/com.rees46.ios.gradle.plugin/maven-metadata.xml + - name: Prepare ios enveronment + # TODO rm + # uses: rees46/workflow/.github/actions/ios/prepare-publish@master + uses: rees46/workflow/.github/actions/ios/prepare-publish@refactor/publish-ios-workflow + with: + iosCertificateP12Base64: ${{ secrets.IOS_CERTIFICATE_P12 }} + p12Password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} + provisioningProfileBase64: ${{ secrets.IOS_PROVISIONING_PROFILE }} + certificatePassword: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} + appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} + appStoreConnectApiKey: ${{ secrets.APP_STORE_CONNECT_API_KEY }} - - name: Debug package - shell: bash - run: | - curl -I -u _:${{ steps.app-token.outputs.token }} https://maven.pkg.github.com/rees46/kmp/com/rees46/ios/com.rees46.ios.gradle.plugin/1.1.3/com.rees46.ios.gradle.plugin-1.1.3.pom + - name: Build ios + # TODO rm + # uses: rees46/workflow/.github/actions/ios/build@master + uses: rees46/workflow/.github/actions/ios/build@refactor/publish-ios-workflow + with: + workingDirectory: ${{ inputs.workingDirectory }} + infoPlistPath: ${{ input.infoPlistPath }} + githubUsername: jade-smith-rs46 + githubToken: ${{ secrets.JADE_SMITH_BOT_TOKEN }} + appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} + appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} + archivePath: ${{ env.ARCHIVE_PATH }} + xcworkspace: ${{ inputs.xcworkspace }} + scheme: ${{ inputs.scheme }} + codeSignIdentity: ${{ inputs.codeSignIdentity }} + developmentTeam: ${{ inputs.developmentTeam }} + provisioningProfileSpecifier: ${{ inputs.provisioningProfileSpecifier }} - # - name: Prepare testflight - # uses: rees46/workflow/.github/actions/publish/prepare-testflight@master - # with: - # secretsJson: ${{ toJSON(secrets) }} - # - # - name: Prepare ios enveronment - # # TODO rm - # # uses: rees46/workflow/.github/actions/ios/prepare-publish@master - # uses: rees46/workflow/.github/actions/ios/prepare-publish@refactor/publish-ios-workflow - # with: - # iosCertificateP12Base64: ${{ secrets.IOS_CERTIFICATE_P12 }} - # p12Password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} - # provisioningProfileBase64: ${{ secrets.IOS_PROVISIONING_PROFILE }} - # certificatePassword: ${{ secrets.IOS_CERTIFICATE_PASSWORD }} - # appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} - # appStoreConnectApiKey: ${{ secrets.APP_STORE_CONNECT_API_KEY }} - # - # - name: Build ios - # # TODO rm - # # uses: rees46/workflow/.github/actions/ios/build@master - # uses: rees46/workflow/.github/actions/ios/build@refactor/publish-ios-workflow - # with: - # # githubToken: ${{ secrets.GITHUB_TOKEN }} - # githubToken: ${{ steps.app-token.outputs.token }} - # appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} - # appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} - # archivePath: ${{ env.ARCHIVE_PATH }} - # xcworkspace: ${{ inputs.xcworkspace }} - # scheme: ${{ inputs.scheme }} - # codeSignIdentity: ${{ inputs.codeSignIdentity }} - # developmentTeam: ${{ inputs.developmentTeam }} - # provisioningProfileSpecifier: ${{ inputs.provisioningProfileSpecifier }} - # - # - name: Archive ios - # uses: rees46/workflow/.github/actions/ios/archive@master - # with: - # archivePath: ${{ env.ARCHIVE_PATH }} - # exportOptionsPlistPath: ${{ env.EXPORT_OPTIONS_PLIST_PATH }} - # archiveExportPath: ${{ env.ARCHIVE_EXPORT_PATH }} - # - # - name: Upload to testflight - # uses: rees46/workflow/.github/actions/publish/publish-testflight@master - # with: - # archiveExportPath: ${{ env.ARCHIVE_EXPORT_PATH }} - # appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} - # appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} - # appStoreConnectApiKey: ${{ secrets.APP_STORE_CONNECT_API_KEY }} - # scheme: ${{ inputs.scheme }} + - name: Archive ios + uses: rees46/workflow/.github/actions/ios/archive@master + with: + archivePath: ${{ env.ARCHIVE_PATH }} + exportOptionsPlistPath: ${{ env.EXPORT_OPTIONS_PLIST_PATH }} + archiveExportPath: ${{ env.ARCHIVE_EXPORT_PATH }} + + - name: Upload to testflight + uses: rees46/workflow/.github/actions/ios/publish-testflight@master + with: + archiveExportPath: ${{ env.ARCHIVE_EXPORT_PATH }} + appStoreConnectIssuerId: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} + appStoreConnectApiKeyId: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} + appStoreConnectApiKey: ${{ secrets.APP_STORE_CONNECT_API_KEY }} + scheme: ${{ inputs.scheme }}