Skip to content

Fix examples

Fix examples #51

Workflow file for this run

name: Prepare Release
on:
push:
branches:
- "dp/migration_release_pipeline"
jobs:
prepare:
runs-on: ubuntu-latest
name: Create Draft Release to store artifacts
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export GITHUB_TOKEN to workspace
run: echo "GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Install ruby
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.1.2'
- name: Install Gems
run: |
gem install octokit
- name: Create draft release to store artifacts.
run: ruby ./scripts/github_release.rb create-draft-release
build-docs:
runs-on: ubuntu-latest
name: Package docs and upload them to the draft release
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run release_package-docs xcode cloud build and wait for it to finish, this xcode cloud upload realm-docs.zip assets to the artifacts draft release
run: |
XCODE_VERSION="$(ruby ./scripts/release-matrix.rb docs_version)"
ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow "release_package-docs_${XCODE_VERSION}" --token ${{ steps.token.outputs.token }}
build-examples:
runs-on: macos-latest
name: Package examples and upload them to the draft release
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export GITHUB_TOKEN to workspace
run: echo "GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Install ruby
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.1.2'
- name: Install Gems
run: |
gem install octokit
gem install xcodeproj
- name: Run release_package-examples package and uploads the example folder
run: ./build.sh release_package-examples
build-product:
runs-on: ubuntu-latest
name: Package product for each xcode version.
needs: build-examples
strategy:
matrix:
xcode-version: ['14.1', '14.2', '14.3.1', '15.0.1', '15.1']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run release_package_${{ matrix.xcode-version }} which upload the package to the draft release and wait for it to complete or fail
run: ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow "release_package_${{ matrix.xcode-version }}" --token ${{ steps.token.outputs.token }}
test-package-examples:
runs-on: ubuntu-latest
name: Test examples, using the packages releases
needs: build-product
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run release_test-package-examples_15.1 which runs test over the packages produces by the previous step and wait for it to complete or fail
run: ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow release_test-package-examples_15.1 --token ${{ steps.token.outputs.token }}
test-ios-static:
runs-on: ubuntu-latest
name: Run tests on iOS with configuration Static
needs: build-product
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run release_ios-static_15.1 which runs test over the packages produces by the previous step and wait for it to complete or fail
run: ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow release_test-ios-static_15.1 --token ${{ steps.token.outputs.token }}
test-osx-static:
runs-on: ubuntu-latest
name: Run tests on macOS
needs: build-product
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Run release_osx_15.1 which runs test over the packages produces by the previous step and wait for it to complete or fail
run: ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow release_test-osx_15.1 --token ${{ steps.token.outputs.token }}
test-installation:
runs-on: ubuntu-latest
name: Run installation test on each xcode version
needs: build-product
env:
XCODE_VERSION: '15.1'
strategy:
matrix:
platform: [ios, osx, watchos, tvos, catalyst, visionos]
installation: [cocoapods, spm, carthage, xcframework]
linkage: [static, dynamic]
exclude:
- installation: carthage
linkage: static
- platform: osx
installation: xcframework
linkage: static
- platform: watchos
installation: xcframework
linkage: static
- platform: tvos
installation: xcframework
linkage: static
- platform: catalyst
installation: xcframework
linkage: static
- platform: visionos
installation: xcframework
linkage: static
- platform: catalyst
installation: carthage
linkage: static
- platform: visionos
installation: carthage
- platform: visionos
installation: cocoapods
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Token
id: token
uses: yuki0n0/[email protected]
with:
# UUID. Can get from App Store Connect.
issuer id: ${{ secrets.APPLE_STORE_CONNECT_ISSUER_ID }}
# Key ID. Can get from App Store Connect.
key id: ${{ secrets.APPLE_STORE_CONNECT_KEY_ID }}
# P8 private key. Can get from App Store Connect.
key: ${{ secrets.APPLE_STORE_CONNECT_API_KEY }}
- name: Creates an XCode Cloud workflow to run the test and runs build
run: |
ruby ./scripts/xcode_cloud_helper.rb --create-release-workflow-and-run test-installation-${{ matrix.platform }}-${{ matrix.installation }}-${{ matrix.linkage }} --xcode-version "$XCODE_VERSION" --token ${{ steps.token.outputs.token }} --team-id ${{ secrets.APPLE_STORE_CONNECT_TEAM_ID }}