From 2200ff632d2051a42ef886df70672dfcbc95692a Mon Sep 17 00:00:00 2001 From: Ghulam Nasir Date: Tue, 27 Dec 2022 12:21:06 +0100 Subject: [PATCH 1/3] Checkout fastlane from shared repo --- publish-ios/action.yml | 42 ++++++++++++++++++--------------------- setup-fastlane/action.yml | 24 ++++++++++++++++++++++ setup-ios/action.yml | 12 ++++++++++- 3 files changed, 54 insertions(+), 24 deletions(-) create mode 100644 setup-fastlane/action.yml diff --git a/publish-ios/action.yml b/publish-ios/action.yml index 29d3e33..29d46ae 100644 --- a/publish-ios/action.yml +++ b/publish-ios/action.yml @@ -31,12 +31,12 @@ inputs: apple-auth-key-encoding: description: 'Auth Key Encoding' required: true - build-number: - description: 'Build number' - required: true working-directory: description: 'Working directory for action' default: '.' + slack-slug: + description: 'The part of slack hook url after services/' + required: true outputs: artifact-path: description: 'The path to the xcarchive created by this action' @@ -44,33 +44,29 @@ outputs: runs: using: "composite" steps: - - uses: QuickBirdEng/actions/setup-ios@main + - uses: QuickBirdEng/actions/setup-ios@feature/fastlane + with: + platform: flutter + working-directory: ${{ inputs.working-directory }} + - name: Setup Fastlane Environment + shell: bash + run: | + echo "MATCH_PASSWORD=${{ inputs.match-password }}" >> $GITHUB_ENV + echo "APPLE_AUTH_KEY_ID=${{ inputs.apple-auth-key-id }}" >> $GITHUB_ENV + echo "APPLE_AUTH_KEY_ISSUER_ID=${{ inputs.apple-auth-key-issuer-id }}" >> $GITHUB_ENV + echo "APPLE_AUTH_KEY_CONTENT=${{ inputs.apple-auth-key-content }}" >> $GITHUB_ENV + echo "APPLE_AUTH_KEY_ENCODING=${{ inputs.apple-auth-key-encoding }}" >> $GITHUB_ENV + echo "MATCH_REPO=${{ inputs.match-repository }}" >> $GITHUB_ENV + echo "APPLE_ID=${{ inputs.match-apple-id }}" >> $GITHUB_ENV + echo "APPLE_TEAM_ID=${{ inputs.match-apple-team-id }}" >> $GITHUB_ENV + echo "SLACK_URL=https://hooks.slack.com/services/${{ inputs.slack-slug }}" >> $GITHUB_ENV - name: Publish to TestFlight - env: - MATCH_PASSWORD: ${{ inputs.match-password }} - APPLE_AUTH_KEY_ID: ${{ inputs.apple-auth-key-id }} - APPLE_AUTH_KEY_ISSUER_ID: ${{ inputs.apple-auth-key-issuer-id }} - APPLE_AUTH_KEY_CONTENT: ${{ inputs.apple-auth-key-content }} - APPLE_AUTH_KEY_ENCODING: ${{ inputs.apple-auth-key-encoding }} - MATCH_REPO: ${{ inputs.match-repository }} - APPLE_ID: ${{ inputs.match-apple-id }} - APPLE_TEAM_ID: ${{ inputs.match-apple-team-id }} - BUILD_NUMBER: ${{ inputs.build-number }} shell: bash -l {0} if: ${{ inputs.publish-to-testflight == 'true' }} working-directory: ${{ inputs.working-directory }} run: cd ios && fastlane releaseToTestFlight - name: Prepare for Upload to apps.quickbirdstudios.com id: build-ipa - env: - MATCH_PASSWORD: ${{ inputs.match-password }} - APPLE_AUTH_KEY_ID: ${{ inputs.apple-auth-key-id }} - APPLE_AUTH_KEY_ISSUER_ID: ${{ inputs.apple-auth-key-issuer-id }} - APPLE_AUTH_KEY_CONTENT: ${{ inputs.apple-auth-key-content }} - APPLE_AUTH_KEY_ENCODING: ${{ inputs.apple-auth-key-encoding }} - MATCH_REPO: ${{ inputs.match-repository }} - APPLE_ID: ${{ inputs.match-apple-id }} - APPLE_TEAM_ID: ${{ inputs.match-apple-team-id }} shell: bash -l {0} working-directory: ${{ inputs.working-directory }} run: | diff --git a/setup-fastlane/action.yml b/setup-fastlane/action.yml new file mode 100644 index 0000000..183b6a5 --- /dev/null +++ b/setup-fastlane/action.yml @@ -0,0 +1,24 @@ +name: 'Setup Fastlane' +description: 'Checking out and setting up fastlane' +inputs: + platform: + description: 'Which platform to setup for. Possible values are ios or flutter' + default: ios + working-directory: + description: 'Working directory for action' + default: '.' + fastlane-repo: + description: 'SSH URL for the Fastlane Repo' + default: 'git@github.com:QuickBirdEng/fastlane.git' +runs: + using: "composite" + steps: + - name: Setup Fastlane + shell: bash + working-directory: ${{ inputs.working-directory }} + run: | + [[ ${{ inputs.platform == 'flutter' }} ]] && cd ios + [[ -d fastlane ]] && rm -rf fastlane + git clone -b ${{ inputs.platform }} --single-branch ${{ inputs.fastlane-repo }} + bash fastlane/fetch_targets_and_bundle_ids.sh + ls -al fastlane/.targets \ No newline at end of file diff --git a/setup-ios/action.yml b/setup-ios/action.yml index d4151db..2602050 100644 --- a/setup-ios/action.yml +++ b/setup-ios/action.yml @@ -1,6 +1,12 @@ name: 'Setup iOS' description: 'Setting up Environment before every action' inputs: + platform: + description: 'Which platform to setup for. Possible values are ios or flutter' + default: ios + working-directory: + description: 'Working directory for action' + default: '.' use-cache: description: 'Use cached version of packages (to speed up the build)' required: false @@ -14,4 +20,8 @@ runs: xcode-version: ${{ env.XCODE_VERSION }} - name: Setup Ruby Environment shell: bash - run: eval "$(rbenv init -)" \ No newline at end of file + run: eval "$(rbenv init -)" + - uses: QuickBirdEng/actions/setup-fastlane@feature/fastlane + with: + platform: ${{ inputs.platform }} + working-directory: ${{ inputs.working-directory }} \ No newline at end of file From b530635d74ecfc287edf4f551c811494a802cc96 Mon Sep 17 00:00:00 2001 From: Ghulam Nasir Date: Wed, 28 Dec 2022 11:05:22 +0100 Subject: [PATCH 2/3] Update how fastlane environment is setup --- publish-ios/action.yml | 23 ++++++----- setup-fastlane-environment/action.yml | 55 +++++++++++++++++++++++++++ setup-fastlane/action.yml | 2 +- 3 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 setup-fastlane-environment/action.yml diff --git a/publish-ios/action.yml b/publish-ios/action.yml index 29d46ae..bca5e5d 100644 --- a/publish-ios/action.yml +++ b/publish-ios/action.yml @@ -48,18 +48,17 @@ runs: with: platform: flutter working-directory: ${{ inputs.working-directory }} - - name: Setup Fastlane Environment - shell: bash - run: | - echo "MATCH_PASSWORD=${{ inputs.match-password }}" >> $GITHUB_ENV - echo "APPLE_AUTH_KEY_ID=${{ inputs.apple-auth-key-id }}" >> $GITHUB_ENV - echo "APPLE_AUTH_KEY_ISSUER_ID=${{ inputs.apple-auth-key-issuer-id }}" >> $GITHUB_ENV - echo "APPLE_AUTH_KEY_CONTENT=${{ inputs.apple-auth-key-content }}" >> $GITHUB_ENV - echo "APPLE_AUTH_KEY_ENCODING=${{ inputs.apple-auth-key-encoding }}" >> $GITHUB_ENV - echo "MATCH_REPO=${{ inputs.match-repository }}" >> $GITHUB_ENV - echo "APPLE_ID=${{ inputs.match-apple-id }}" >> $GITHUB_ENV - echo "APPLE_TEAM_ID=${{ inputs.match-apple-team-id }}" >> $GITHUB_ENV - echo "SLACK_URL=https://hooks.slack.com/services/${{ inputs.slack-slug }}" >> $GITHUB_ENV + - uses: QuickBirdEng/actions/setup-fastlane-environment@feature/fastlane + with: + match-repository: ${{ inputs.match-repository }} + match-password: ${{ inputs.match-password }} + match-apple-id: ${{ inputs.match-apple-id }} + match-apple-team-id: ${{ inputs.match-apple-team-id }} + apple-auth-key-id: ${{ inputs.apple-auth-key-id }} + apple-auth-key-issuer-id: ${{ inputs.apple-auth-key-issuer-id }} + apple-auth-key-content: ${{ inputs.apple-auth-key-content }} + apple-auth-key-encoding: ${{ inputs.apple-auth-key-encoding }} + slack-slug: ${{ inputs.slack-slug }} - name: Publish to TestFlight shell: bash -l {0} if: ${{ inputs.publish-to-testflight == 'true' }} diff --git a/setup-fastlane-environment/action.yml b/setup-fastlane-environment/action.yml new file mode 100644 index 0000000..efb0745 --- /dev/null +++ b/setup-fastlane-environment/action.yml @@ -0,0 +1,55 @@ +name: 'Setup Environment for Flutter' +description: 'Setup Environment for Flutter' +inputs: + match-repository: + description: 'Match Repository' + required: true + match-password: + description: 'Password for Match Repo' + required: true + match-apple-id: + description: 'Apple ID to use for match' + required: true + match-apple-team-id: + description: 'Apple Team ID to use for match' + required: true + apple-auth-key-id: + description: 'Auth Key' + required: true + apple-auth-key-issuer-id: + description: 'Auth Key Issuer ID' + required: true + apple-auth-key-content: + description: 'Auth Key Content' + required: true + apple-auth-key-encoding: + description: 'Auth Key Encoding' + required: true + slack-slug: + description: 'The part of slack hook url after services/' + required: true +runs: + using: "composite" + steps: + - name: Setup Fastlane Environment + shell: bash + run: | + echo "MATCH_REPO=${{ inputs.match-repository }}" >> $GITHUB_ENV + echo "MATCH_PASSWORD=${{ inputs.match-password }}" >> $GITHUB_ENV + echo "APPLE_AUTH_KEY_ID=${{ inputs.apple-auth-key-id }}" >> $GITHUB_ENV + echo "APPLE_AUTH_KEY_ISSUER_ID=${{ inputs.apple-auth-key-issuer-id }}" >> $GITHUB_ENV + echo "APPLE_AUTH_KEY_CONTENT=${{ inputs.apple-auth-key-content }}" >> $GITHUB_ENV + echo "APPLE_AUTH_KEY_ENCODING=${{ inputs.apple-auth-key-encoding }}" >> $GITHUB_ENV + echo "APPLE_ID=${{ inputs.match-apple-id }}" >> $GITHUB_ENV + echo "APPLE_TEAM_ID=${{ inputs.match-apple-team-id }}" >> $GITHUB_ENV + echo "SLACK_URL=https://hooks.slack.com/services/${{ inputs.slack-slug }}" >> $GITHUB_ENV + + echo "MATCH_PASSWORD=${{ inputs.match-password }}" > tee apple.env + echo "APPLE_AUTH_KEY_ID=${{ inputs.apple-auth-key-id }}" >> apple.env + echo "APPLE_AUTH_KEY_ISSUER_ID=${{ inputs.apple-auth-key-issuer-id }}" >> apple.env + echo "APPLE_AUTH_KEY_CONTENT=${{ inputs.apple-auth-key-content }}" >> apple.env + echo "APPLE_AUTH_KEY_ENCODING=${{ inputs.apple-auth-key-encoding }}" >> apple.env + echo "MATCH_REPO=${{ inputs.match-repository }}" >> apple.env + echo "APPLE_ID=${{ inputs.match-apple-id }}" >> apple.env + echo "APPLE_TEAM_ID=${{ inputs.match-apple-team-id }}" >> apple.env + echo "SLACK_URL=https://hooks.slack.com/services/${{ inputs.slack-slug }}" >> apple.env \ No newline at end of file diff --git a/setup-fastlane/action.yml b/setup-fastlane/action.yml index 183b6a5..9ffad29 100644 --- a/setup-fastlane/action.yml +++ b/setup-fastlane/action.yml @@ -17,7 +17,7 @@ runs: shell: bash working-directory: ${{ inputs.working-directory }} run: | - [[ ${{ inputs.platform == 'flutter' }} ]] && cd ios + [[ ${{ inputs.platform }} == 'flutter' ]] && cd ios [[ -d fastlane ]] && rm -rf fastlane git clone -b ${{ inputs.platform }} --single-branch ${{ inputs.fastlane-repo }} bash fastlane/fetch_targets_and_bundle_ids.sh From f44b11d038836fb612bb3250ad880d1679d6a5b7 Mon Sep 17 00:00:00 2001 From: Ghulam Nasir Date: Wed, 28 Dec 2022 14:04:13 +0100 Subject: [PATCH 3/3] use main branch --- publish-ios/action.yml | 4 ++-- setup-ios/action.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/publish-ios/action.yml b/publish-ios/action.yml index bca5e5d..34de72d 100644 --- a/publish-ios/action.yml +++ b/publish-ios/action.yml @@ -44,11 +44,11 @@ outputs: runs: using: "composite" steps: - - uses: QuickBirdEng/actions/setup-ios@feature/fastlane + - uses: QuickBirdEng/actions/setup-ios@main with: platform: flutter working-directory: ${{ inputs.working-directory }} - - uses: QuickBirdEng/actions/setup-fastlane-environment@feature/fastlane + - uses: QuickBirdEng/actions/setup-fastlane-environment@main with: match-repository: ${{ inputs.match-repository }} match-password: ${{ inputs.match-password }} diff --git a/setup-ios/action.yml b/setup-ios/action.yml index 2602050..fe2aead 100644 --- a/setup-ios/action.yml +++ b/setup-ios/action.yml @@ -21,7 +21,7 @@ runs: - name: Setup Ruby Environment shell: bash run: eval "$(rbenv init -)" - - uses: QuickBirdEng/actions/setup-fastlane@feature/fastlane + - uses: QuickBirdEng/actions/setup-fastlane@main with: platform: ${{ inputs.platform }} working-directory: ${{ inputs.working-directory }} \ No newline at end of file