more fixes #29
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 | |
env: | |
XCODE_VERSION: "15.3" | |
jobs: | |
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 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: Read Ruby Version | |
id: read_ruby_version | |
working-directory: "apps/${{ matrix.sample-app }}" | |
run: | | |
echo "RUBY_VERSION=$(cat .ruby-version)" >> $GITHUB_ENV | |
- name: Install Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ env.RUBY_VERSION }} | |
bundler-cache: true # cache tools to make builds faster in future | |
- name: Print Ruby Version | |
run: ruby -v | |
- name: Print Bundler Version | |
run: bundler -v | |
- name: Install Ruby dependencies | |
run: bundle install | |
- name: Generate New Version | |
id: generate_version | |
uses: maierj/fastlane-action@v3.1.0 | |
with: | |
lane: "generate_new_version" | |
options: | | |
branch_name=${{ github.ref_name }} | |
pull_request_number=${{ github.event.pull_request.number }} | |
env: | |
NEW_VERSION_NAME: ${{ steps.generate_version.outputs.NEW_VERSION_NAME }} | |
NEW_VERSION_CODE: ${{ steps.generate_version.outputs.NEW_VERSION_CODE }} | |
# - name: Update Flutter SDK Version | |
# uses: maierj/fastlane-action@v3.1.0 | |
# with: | |
# lane: "update_flutter_sdk_version" | |
# subdirectory: "apps/${{ matrix.sample-app }}" | |
# options: | | |
# version_name=${{ steps.generate_version.outputs.NEW_VERSION_NAME }} | |
# version_code=${{ steps.generate_version.outputs.NEW_VERSION_CODE }} | |
# | |
- name: Update Sample App Version | |
uses: maierj/fastlane-action@v3.1.0 | |
with: | |
lane: "update_flutter_app_version" | |
subdirectory: "apps/${{ matrix.sample-app }}" | |
options: | | |
version_name=${{ steps.generate_version.outputs.NEW_VERSION_NAME }} | |
version_code=${{ steps.generate_version.outputs.NEW_VERSION_CODE }} | |
- name: Install flutter dependencies | |
run: flutter pub get | |
working-directory: "apps/${{ matrix.sample-app }}" | |
- name: Setup workspace credentials in flutter environment files | |
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 workspace credentials in iOS environment files | |
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" | |
- name: Run iOS setup steps to be able to build sample apps | |
uses: ./.github/actions/setup-ios | |
with: | |
xcode-version: ${{ env.XCODE_VERSION }} | |
gemfile-directory: "apps/${{ matrix.sample-app }}" | |
- name: pod install | |
run: pod install --project-directory=ios | |
- name: Run Android setup steps to be able to build sample apps | |
uses: ./.github/actions/setup-android | |
with: | |
subdirectory: "apps/${{ matrix.sample-app }}/android" | |
- name: Build Android app via Fastlane | |
uses: maierj/fastlane-action@v3.1.0 | |
with: | |
lane: "android build" | |
subdirectory: "apps/${{ matrix.sample-app }}/android" | |
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 }} | |
- name: Build iOS 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 }} |