diff --git a/publish-ios/action.yml b/publish-ios/action.yml index 29d3e33..34de72d 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' @@ -45,32 +45,27 @@ runs: using: "composite" steps: - uses: QuickBirdEng/actions/setup-ios@main + with: + platform: flutter + working-directory: ${{ inputs.working-directory }} + - uses: QuickBirdEng/actions/setup-fastlane-environment@main + 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 - 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-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 new file mode 100644 index 0000000..9ffad29 --- /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..fe2aead 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@main + with: + platform: ${{ inputs.platform }} + working-directory: ${{ inputs.working-directory }} \ No newline at end of file