removed bundler install #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build sample apps | |
on: | |
push: | |
workflow_dispatch: # allow manual run | |
concurrency: # cancel previous workflow run if one exists. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
update-pr-comment: | |
if: ${{ github.event_name == 'pull_request' }} | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write # to be able to comment on PR | |
outputs: | |
comment-id: ${{ steps.create-comment.outputs.comment-id }} | |
steps: | |
- name: Find Comment | |
uses: peter-evans/find-comment@v3 | |
id: existing-comment | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: <!-- sample app builds --> | |
- name: Create or update comment | |
uses: peter-evans/create-or-update-comment@v4 | |
id: create-comment | |
with: | |
comment-id: ${{ steps.existing-comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
<!-- sample app builds --> | |
# Sample app builds 📱 | |
Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request. | |
--- | |
${{ steps.build.outputs.build-log }} | |
edit-mode: replace # replace the existing comment with new content since we are creating new builds | |
build-ios-sample-apps: | |
runs-on: macos-14 | |
name: Building sample app ${{ matrix.sample-app }} | |
strategy: | |
fail-fast: false # if one sample app fails to build, let the other sample apps continue to build and not cancel them. | |
matrix: # Use a matrix allowing us to build multiple apps in parallel. Just add an entry to the matrix and it will build! | |
sample-app: | |
# List all sample apps you want to have compiled. | |
# List item is name of directory inside of "apps" directory for the corresponding app to compile. | |
- "amiapp_flutter" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-flutter | |
- name: Install tools from Gemfile (Ruby language) used for building our apps with | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.7.6' | |
bundler-cache: true # cache tools to make builds faster in future | |
- name: Install CLI tools used in CI script | |
shell: bash | |
run: | | |
brew install sd # used in CI script as an easier to use sed CLI. Replaces text in files. | |
brew install xcbeautify # used by fastlane for output | |
- name: Install dependencies to build sample app | |
run: flutter pub get | |
working-directory: "apps/${{ matrix.sample-app }}" | |
- name: Setup Dart and Swift files with Customer.io workspace credentials to compile into app | |
run: | | |
cp "apps/${{ matrix.sample-app }}/.env.example" "apps/${{ matrix.sample-app }}/.env" | |
sd "siteid" "${{ secrets[format('CUSTOMERIO_{0}_WORKSPACE_SITE_ID', matrix.sample-app)] }}" "apps/${{ matrix.sample-app }}/.env" | |
sd "apikey" "${{ secrets[format('CUSTOMERIO_{0}_WORKSPACE_API_KEY', matrix.sample-app)] }}" "apps/${{ matrix.sample-app }}/.env" | |
- name: Setup Swift files with Customer.io workspace credentials to compile into app | |
run: | | |
cp "apps/${{ matrix.sample-app }}/ios/Env.swift.example" "apps/${{ matrix.sample-app }}/ios/Env.swift" | |
sd "siteid" "${{ secrets[format('CUSTOMERIO_{0}_WORKSPACE_SITE_ID', matrix.sample-app)] }}" "apps/${{ matrix.sample-app }}/ios/Env.swift" | |
sd "apiKey" "${{ secrets[format('CUSTOMERIO_{0}_WORKSPACE_API_KEY', matrix.sample-app)] }}" "apps/${{ matrix.sample-app }}/ios/Env.swift" | |
# iOS setup | |
- name: Run iOS setup steps to be able to build sample apps | |
uses: ./.github/actions/setup-ios | |
with: | |
xcode-version: "15.3" | |
gemfile-directory: "apps/${{ matrix.sample-app }}" | |
- name: pod install | |
run: pod install --project-directory=ios | |
working-directory: "apps/${{ matrix.sample-app }}" | |
# Build app | |
- name: Print Ruby Version | |
run: ruby -v | |
- name: Print Bundler Version | |
run: bundler -v | |
- name: Install Dependencies | |
run: bundle install | |
working-directory: "apps/${{ matrix.sample-app }}" | |
- name: Update app version to uniquely identify build for easier finding later. | |
uses: maierj/fastlane-action@v3.1.0 | |
with: | |
lane: "ios flutter_update_app_version" | |
subdirectory: "apps/${{ matrix.sample-app }}" | |
- name: Build app via Fastlane | |
uses: maierj/fastlane-action@v3.1.0 | |
with: | |
lane: "ios build" | |
subdirectory: "apps/${{ matrix.sample-app }}/ios" | |
env: | |
GOOGLE_CLOUD_MATCH_READONLY_SERVICE_ACCOUNT_B64: ${{ secrets.GOOGLE_CLOUD_MATCH_READONLY_SERVICE_ACCOUNT_B64 }} | |
FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64: ${{ secrets.FIREBASE_APP_DISTRIBUTION_SERVICE_ACCOUNT_CREDS_B64 }} | |
# Update PR comment with build information | |
- name: Update sample builds PR comment with build information | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
comment-id: ${{ needs.update-pr-comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
# the variables APP_BUILD_NUMBER, APP_VERSION_STRING are created when fastlane runs "build". | |
body: | | |
* ${{ matrix.sample-app }}: `${{ env.APP_VERSION_STRING }} (${{ env.APP_BUILD_NUMBER }})` | |
edit-mode: append # append new line to the existing PR comment to build a list of all sample app builds. | |
- name: Update sample builds PR comment with build failure message | |
if: ${{ failure() }} | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
comment-id: ${{ needs.update-pr-comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
* ${{ matrix.sample-app }}: Build failed. See [CI job logs](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}) to determine the issue and try re-building. | |
edit-mode: append # append new line to the existing PR comment to build a list of all sample app builds. |