Skip to content

Next

Next #111

Workflow file for this run

name: Prepare Release
on:
push:
branches:
- "dp/test_release"
env:
XCODE_VERSION: "['14.1', '14.2', '14.3.1', '15.0.1', '15.1']"
PLATFORM: "['ios', 'osx', 'watchos', 'tvos', 'catalyst', 'visionos']"
BUILD_PLATFORM: "['ios', 'iossimulator', 'osx', 'watchos', 'watchossimulator', 'tvos', 'tvossimulator', 'catalyst']"
DOC_VERSION: '14.3.1'
XCFRAMEWORK_VERSION: '15.0.1'
REALM_VERSION: '15.1'
TEST_VERSION: '15.0.1'
jobs:
prepare:
runs-on: ubuntu-latest
name: Prepare outputs
outputs:
XCODE_VERSIONS_MATRIX: ${{ env.XCODE_VERSION }}
BUILD_PLATFORM_MATRIX: ${{ env.BUILD_PLATFORM }}
PLATFORM_MATRIX: ${{ env.PLATFORM }}
steps:
- name: Compute outputs
run: |
echo "XCODE_VERSIONS_MATRIX=${{ env.XCODE_VERSION }}" >> $GITHUB_OUTPUT
echo "PLATFORM_MATRIX=${{ env.PLATFORM }}" >> $GITHUB_OUTPUT
echo "BUILD_PLATFORM_MATRIX=${{ env.BUILD_PLATFORM }}" >> $GITHUB_OUTPUT
build-docs:
runs-on: macos-13
name: Package docs and upload them to the draft release
needs: prepare
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.DOC_VERSION }}
- name: Install Gems
run: |
gem install jazzy -v 0.14.4
- name: Checkout
uses: actions/checkout@v4
- name: Package docs files
run: ./build.sh release-package-docs
- name: Upload artifact to artifacts library
uses: actions/upload-artifact@v3
with:
name: realm-docs.zip
path: docs/realm-docs.zip
build-examples:
runs-on: macos-13
name: Package examples and upload them to the draft release
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run release_package-examples package and uploads the example folder
run: ./build.sh release-package-examples
- name: Upload artifact to artifacts library
uses: actions/upload-artifact@v3
with:
name: realm-examples.zip
path: realm-examples.zip
build-product: # Creates framework for each platform, xcode version, target and configuration
runs-on: ubuntu-latest
name: Package framework
needs: prepare
strategy:
max-parallel: 10
matrix:
platform: ${{ fromJSON(needs.prepare.outputs.BUILD_PLATFORM_MATRIX) }}
target: [RealmSwift, Realm]
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
configuration: [release]
include:
- platform: ios
target: Realm
xcode-version: 15.1
configuration: static
- platform: iossimulator
target: Realm
xcode-version: 15.1
configuration: static
- platform: visionos
target: Realm
xcode-version: 15.1
configuration: release
- platform: visionos
target: Realmswift
xcode-version: 15.1
configuration: release
- platform: visionossimulator
target: Realm
xcode-version: 15.1
configuration: release
- platform: visionossimulator
target: Realmswift
xcode-version: 15.1
configuration: release
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 on demand XCode Cloud's workflows with a build action for ${{ matrix.platform }} in ${{ matrix.xcode-version }} with configuration ${{ matrix.configuration }}
id: create-workflow
run: |
workflow_id=$(echo $(ruby ./scripts/xcode_cloud_helper.rb --create-build-workflow "${{ matrix.platform }}-${{ matrix.target }}-${{ matrix.configuration }}" --token ${{ steps.token.outputs.token }} --xcode-version ${{ matrix.xcode-version }}))
echo "WORKFLOW_ID=$workflow_id" >> $GITHUB_OUTPUT
- name: Runs the XCode Cloud workflow created by the previous step
id: build-run
run: |
build_run_id=$(echo $(ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow ${{ steps.create-workflow.outputs.WORKFLOW_ID }} --token ${{ steps.token.outputs.token }} --branch ${{ github.ref_name }}))
echo "BUILD_RUN_ID=$build_run_id" >> $GITHUB_OUTPUT
- name: Check build status and wait for it to finish
run: |
ruby ./scripts/xcode_cloud_helper.rb --token ${{ steps.token.outputs.token }} --check-workflow-status ${{ steps.build-run.outputs.BUILD_RUN_ID }}
- name: Download package from XCode Cloud artifacts ${{ matrix.platform }} in ${{ matrix.xcode-version }} with configuration ${{ matrix.configuration }}
run: |
ruby ./scripts/xcode_cloud_helper.rb --download-build-artifact ${{ steps.build-run.outputs.BUILD_RUN_ID }} --token ${{ steps.token.outputs.token }}
- name: Upload artifact to artifacts library
uses: actions/upload-artifact@v3
with:
name: package-${{ matrix.platform }}-${{ matrix.xcode-version }}-${{ matrix.target }}-${{ matrix.configuration }}.zip
path: product.zip
package-xcframework-platform: # Creates xcframework for each platform and xcode version
runs-on: macos-13
name: Package xcframework
needs: [build-product, prepare]
strategy:
matrix:
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }}
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCFRAMEWORK_VERSION }}
- name: Download RealmSwift for ${{ matrix.platform }} for release
uses: actions/download-artifact@v3
with:
name: package-${{ matrix.platform }}-${{ matrix.xcode-version }}-RealmSwift-release.zip
path: package-${{ matrix.platform }}-RealmSwift-release.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: package-${{ matrix.platform }}-${{ matrix.xcode-version }}-RealmSwift-release.zip
- name: Download RealmSwift for ${{ matrix.platform }} simulator for release
uses: actions/download-artifact@v3
if: ${{ matrix.platform }} == 'ios' || ${{ matrix.platform }} == 'tvos' || ${{ matrix.platform }} == 'watchos' || ${{ matrix.platform }} == 'visionos'
with:
name: package-${{ matrix.platform }}simulator-${{ matrix.xcode-version }}-RealmSwift-release.zip
path: package-${{ matrix.platform }}simulator-RealmSwift-release.zip
- uses: geekyeggo/delete-artifact@v2
if: ${{ matrix.platform }} == 'ios' || ${{ matrix.platform }} == 'tvos' || ${{ matrix.platform }} == 'watchos' || ${{ matrix.platform }} == 'visionos'
with:
name: package-${{ matrix.platform }}simulator-${{ matrix.xcode-version }}-RealmSwift-release.zip
- name: Download Realm for ${{ matrix.platform }} for release
uses: actions/download-artifact@v3
with:
name: package-${{ matrix.platform }}-${{ matrix.xcode-version }}-Realm-release.zip
path: package-${{ matrix.platform }}-Realm-release.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: package-${{ matrix.platform }}-${{ matrix.xcode-version }}-Realm-release.zip
- name: Download Realm for ${{ matrix.platform }} simulator for release
uses: actions/download-artifact@v3
if: ${{ matrix.platform }} == 'ios' || ${{ matrix.platform }} == 'tvos' || ${{ matrix.platform }} == 'watchos' || ${{ matrix.platform }} == 'visionos'
with:
name: package-${{ matrix.platform }}simulator-${{ matrix.xcode-version }}-Realm-release.zip
path: package-${{ matrix.platform }}simulator-Realm-release.zip
- uses: geekyeggo/delete-artifact@v2
if: ${{ matrix.platform }} == 'ios' || ${{ matrix.platform }} == 'tvos' || ${{ matrix.platform }} == 'watchos' || ${{ matrix.platform }} == 'visionos'
with:
name: package-${{ matrix.platform }}simulator-${{ matrix.xcode-version }}-Realm-release.zip
- name: Download Realm for ${{ matrix.platform }} for static
uses: actions/download-artifact@v3
if: ${{ matrix.platform }} == 'ios'
with:
name: package-${{ matrix.platform }}-${{ matrix.xcode-version }}-Realm-static.zip
path: package-${{ matrix.platform }}-Realm-release.zip
- uses: geekyeggo/delete-artifact@v2
if: ${{ matrix.platform }} == 'ios'
with:
name: package-${{ matrix.platform }}-${{ matrix.xcode-version }}-Realm-static.zip
- name: Download Realm for ${{ matrix.platform }} simulator for release
uses: actions/download-artifact@v3
if: ${{ matrix.platform }} == 'ios'
with:
name: package-${{ matrix.platform }}simulator-${{ matrix.xcode-version }}-Realm-static.zip
path: package-${{ matrix.platform }}simulator-Realm-static.zip
- uses: geekyeggo/delete-artifact@v2
if: ${{ matrix.platform }} == 'ios' || ${{ matrix.platform }} == 'tvos' || ${{ matrix.platform }} == 'watchos' || ${{ matrix.platform }} == 'visionos'
with:
name: package-${{ matrix.platform }}simulator-${{ matrix.xcode-version }}-Realm-static.zip
- name: Create xcframework for ${{ matrix.platform }} in ${{ matrix.xcode-version }} with configuration ${{ matrix.configuration }}
id: build-run
run: |
./build.sh release-create-platform-package ${{ matrix.platform }}
- name: Upload xcframework to artifacts library
uses: actions/upload-artifact@v3
with:
name: realm-${{ matrix.platform }}-${{ matrix.xcode-version }}.zip
path: xcframework/realm-${{ matrix.platform }}.zip
create-package-version: # Cretes a release package for each xcode version
runs-on: macos-13
name: Package release for each xcode version
needs: [package-xcframework-platform, prepare]
strategy:
matrix:
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCFRAMEWORK_VERSION }}
- name: Download ios xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-ios-${{ matrix.xcode-version }}.zip
path: realm-ios-${{ matrix.xcode-version }}.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: realm-ios-${{ matrix.xcode-version }}.zip
- name: Download osx xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-osx-${{ matrix.xcode-version }}.zip
path: realm-osx-${{ matrix.xcode-version }}.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: realm-osx-${{ matrix.xcode-version }}.zip
- name: Download tvos xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-tvos-${{ matrix.xcode-version }}.zip
path: realm-tvos-${{ matrix.xcode-version }}.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: realm-tvos-${{ matrix.xcode-version }}.zip
- name: Download watchos xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-watchos-${{ matrix.xcode-version }}.zip
path: realm-watchos-${{ matrix.xcode-version }}.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: realm-watchos-${{ matrix.xcode-version }}.zip
- name: Download catalyst xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-catalyst-${{ matrix.xcode-version }}.zip
path: realm-catalyst-${{ matrix.xcode-version }}.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: realm-catalyst-${{ matrix.xcode-version }}.zip
- name: Download visionos xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
if: ${{ matrix.xcode-version }} == '15.1'
with:
name: realm-visionos-${{ matrix.xcode-version }}.zip
path: realm-visionos-${{ matrix.xcode-version }}.zip
- uses: geekyeggo/delete-artifact@v2
if: ${{ matrix.xcode-version }} == '15.1'
with:
name: realm-visionos-${{ matrix.xcode-version }}.zip
- name: Download examples for packaging
uses: actions/download-artifact@v3
if: ${{ matrix.xcode-version }} == '15.1'
with:
name: realm-examples.zip
path: realm-examples.zip
- name: Package release
run: |
./build.sh release-create-version-package ${{ matrix.xcode-version }}
- name: Read SDK version
id: get-version
run: |
version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${GITHUB_WORKSPACE}/dependencies.list")"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Upload package for ${{ matrix.xcode-version }} to artifacts library
uses: actions/upload-artifact@v3
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-${{ matrix.xcode-version }}.zip
path: pkg/realm-swift-${{ steps.get-version.outputs.version }}-${{ matrix.xcode-version }}.zip
- name: Upload RealmSwift SPM for ${{ matrix.xcode-version }} to artifacts library
uses: actions/upload-artifact@v3
with:
name: RealmSwift@${{ matrix.xcode-version }}.spm.zip
path: pkg/RealmSwift@${{ matrix.xcode-version }}.spm.zip
- name: Upload Realm SPM for ${{ matrix.xcode-version }} to artifacts library
uses: actions/upload-artifact@v3
if: ${{ matrix.xcode-version }} == ${{ env.REALM_VERSION }}
with:
name: Realm.spm.zip
path: pkg/Realm.spm.zip
- name: Upload Carthage xcframework for ${{ matrix.xcode-version }} to artifacts library
uses: actions/upload-artifact@v3
if: ${{ matrix.xcode-version }} == ${{ env.REALM_VERSION }}
with:
name: Carthage.xcframework.zip
path: pkg/Carthage.xcframework.zip
create-final-package: # Cretes a release package for each xcode version
runs-on: macos-13
name: Package final package
needs: [create-package-version, prepare]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCFRAMEWORK_VERSION }}
- name: Read SDK version
id: get-version
run: |
version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${GITHUB_WORKSPACE}/dependencies.list")"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Download ios xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-14.1.zip
path: realm-swift-${{ steps.get-version.outputs.version }}-14.1.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-14.1.zip
- name: Download ios xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-14.2.zip
path: realm-swift-${{ steps.get-version.outputs.version }}-14.2.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-14.2.zip
- name: Download ios xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-14.3.1.zip
path: realm-swift-${{ steps.get-version.outputs.version }}-14.3.1.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-14.3.1.zip
- name: Download ios xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-15.0.1.zip
path: realm-swift-${{ steps.get-version.outputs.version }}-15.0.1.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-15.0.1.zip
- name: Download ios xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-15.1.zip
path: realm-swift-${{ steps.get-version.outputs.version }}-15.1.zip
- uses: geekyeggo/delete-artifact@v2
with:
name: realm-swift-${{ steps.get-version.outputs.version }}-15.1.zip
- name: Package release
run: |
./build.sh release-create-final-package
- name: Upload Carthage xcframework for ${{ matrix.xcode-version }} to artifacts library
uses: actions/upload-artifact@v3
if: ${{ matrix.xcode-version }} == ${{ env.REALM_VERSION }}
with:
name: realm-swift-${{ steps.get-version.outputs.version }}.zip
path: realm-swift-${{ steps.get-version.outputs.version }}.zip
test-package-examples:
runs-on: macos-13
name: Test examples
needs: create-final-package
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.TEST_VERSION }}
- name: Read SDK version
id: get-version
run: |
version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${GITHUB_WORKSPACE}/dependencies.list")"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Download ios xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
with:
name: realm-swift-${{ steps.get-version.outputs.version }}.zip
path: realm-swift-${{ steps.get-version.outputs.version }}.zip
- name: Test ios static
run: |
./build.sh release-package-test-examples
test-ios-static:
runs-on: macos-13
name: Run tests on iOS with configuration Static
needs: create-final-package
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.TEST_VERSION }}
- name: Test ios static
run: |
./build.sh test-ios-static
test-osx-static:
runs-on: macos-13
name: Run tests on macOS
needs: create-final-package
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.TEST_VERSION }}
- name: Test ios static
run: |
export REALM_DISABLE_METADATA_ENCRYPTION=1
./build.sh test-osx
test-installation:
runs-on: macos-13
name: Run installation test
needs: [create-final-package, prepare]
strategy:
matrix:
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }}
installation: [cocoapods, spm, carthage, xcframework]
linkage: [dynamic, static]
exclude:
- platform: visionos
- platform: catalyst
installation: carthage
- installation: carthage
linkage: static
- installation: xcframework
linkage: static
include:
- platform: ios
installation: xcframework
linkage: static
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.DOC_VERSION }}
- name: Read SDK version
id: get-version
run: |
version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${GITHUB_WORKSPACE}/dependencies.list")"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Download ios xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
if: ${{ matrix.installation }} == 'xcframework'
with:
name: realm-swift-${{ steps.get-version.outputs.version }}.zip
path: realm-swift-${{ steps.get-version.outputs.version }}.zip
- name: Read SDK version
if: ${{ matrix.installation }} == 'xcframework'
run: |
mv *.zip examples/installation
- name: Run installation test
run: |
echo "REALM_TEST_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
cd examples/installation
./build.rb ${{ matrix.xcode-version }} ${{ matrix.installation }} ${{ matrix.linkage }}
test-installation-xcframework:
runs-on: macos-13
name: Run installation test for xcframework
needs: [create-final-package, prepare]
strategy:
matrix:
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
exclude:
- xcode-version: '15.1'
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode-version }}
- name: Read SDK version
id: get-version
run: |
version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${GITHUB_WORKSPACE}/dependencies.list")"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Download ios xcframework for ${{ matrix.xcode_version }}
uses: actions/download-artifact@v3
if: ${{ matrix.installation }} == 'xcframework'
with:
name: realm-swift-${{ steps.get-version.outputs.version }}.zip
path: realm-swift-${{ steps.get-version.outputs.version }}.zip
- name: Read SDK version
if: ${{ matrix.installation }} == 'xcframework'
run: |
mv *.zip examples/installation
- name: Run installation test
run: |
echo "REALM_TEST_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT
cd examples/installation
./build.rb ${{ matrix.xcode-version }} xcframework dynamic