Release 10.53.0 #420
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: Prepare Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "master" | |
- "release/**" | |
env: | |
XCODE_VERSION: "['15.3', '15.4', '16', '16.1_beta_2']" | |
PLATFORM: "['ios', 'osx', 'watchos', 'tvos', 'catalyst', 'visionos']" | |
DOC_VERSION: '15.4' | |
RELEASE_VERSION: '15.4' | |
jobs: | |
prepare: | |
runs-on: ubuntu-latest | |
name: Prepare outputs | |
outputs: | |
XCODE_VERSIONS_MATRIX: ${{ env.XCODE_VERSION }} | |
PLATFORM_MATRIX: ${{ env.PLATFORM }} | |
VERSION: ${{ steps.get-version.outputs.VERSION }} | |
steps: | |
- name: Compute outputs | |
run: | | |
echo "XCODE_VERSIONS_MATRIX=${{ env.XCODE_VERSION }}" >> $GITHUB_OUTPUT | |
echo "PLATFORM_MATRIX=${{ env.PLATFORM }}" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v4 | |
- name: Read SDK version | |
id: get-version | |
run: | | |
version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${GITHUB_WORKSPACE}/dependencies.list")" | |
echo "VERSION=$version" >> $GITHUB_OUTPUT | |
build-docs: | |
runs-on: macos-14 | |
name: Package docs | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Select Xcode Version | |
run: sudo xcode-select -switch /Applications/Xcode_${{ env.DOC_VERSION }}.app | |
- name: Prepare docs for packaging | |
run: bundle exec sh -x build.sh release-package-docs | |
- name: Upload docs to artifacts library | |
uses: actions/upload-artifact@v4 | |
with: | |
name: realm-docs | |
path: docs/realm-docs.zip | |
build-examples: | |
runs-on: macos-14 | |
name: Package examples | |
needs: prepare | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare examples for packaging | |
run: sh -x build.sh release-package-examples | |
- name: Upload examples to artifacts library | |
uses: actions/upload-artifact@v4 | |
with: | |
name: realm-examples | |
path: realm-examples.zip | |
build-product: # Creates framework for each platform, xcode version, target and configuration | |
runs-on: macos-14 | |
name: Package framework | |
needs: prepare | |
strategy: | |
max-parallel: 20 # Blocks of 20, therefore if any of the build fails, we don't get a lot of XCode Clouds builds hanging, which are expensive. | |
matrix: | |
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }} | |
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }} | |
configuration: [swift, static] | |
exclude: | |
- platform: osx | |
configuration: static | |
- platform: tvos | |
configuration: static | |
- platform: watchos | |
configuration: static | |
- platform: visionos | |
configuration: static | |
- platform: catalyst | |
configuration: static | |
- platform: visionos | |
xcode-version: 15.1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build ${{ matrix.platform }} with Xcode ${{ matrix.xcode-version }} | |
run: DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer sh build.sh ${{ matrix.platform }}-${{matrix.configuration}} | |
- run: rm -r build/DerivedData | |
- name: Upload framework | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.platform }}-${{ matrix.xcode-version }}-${{ matrix.configuration }} | |
path: build | |
compression-level: 1 | |
package-xcframework-platform: # Creates xcframework for each platform and xcode version | |
runs-on: macos-14 | |
name: Package xcframework for platform | |
needs: [build-product, prepare] | |
strategy: | |
matrix: | |
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }} | |
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }} | |
exclude: | |
- platform: visionos | |
xcode-version: 15.1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Select Xcode Version | |
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app | |
- name: Install the Apple certificate and provisioning profile | |
env: | |
DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
run: | | |
sh -x build.sh install-apple-certificates | |
- name: Restore frameworks | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: build-${{ matrix.platform }}*-${{ matrix.xcode-version }}-* | |
- name: Create xcframework | |
env: | |
SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }} | |
run: | | |
sh -x build.sh release-create-xcframework-${{ matrix.xcode-version }} ${{ matrix.platform }} | |
- name: Upload xcframework | |
uses: actions/upload-artifact@v4 | |
with: | |
name: realm-${{ matrix.platform }}-${{ matrix.xcode-version }} | |
path: realm-${{ matrix.platform }}-${{ matrix.xcode-version }}.zip | |
package-release: # Creates xcframework for each platform and xcode version | |
runs-on: macos-14 | |
name: Package release file | |
needs: [package-xcframework-platform, prepare] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Select Xcode Version | |
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app | |
- name: Install the Apple certificate and provisioning profile | |
env: | |
DEVELOPMENT_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_BASE64 }} | |
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | |
run: | | |
sh -x build.sh install-apple-certificates | |
- name: Restore packages xcframeworks | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: realm-* | |
- name: Create release | |
env: | |
SIGNING_IDENTITY: ${{ secrets.SIGNING_IDENTITY }} | |
run: | | |
sh -x build.sh release-package | |
- name: Upload release artifactss | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release-package | |
path: pkg/*.zip | |
- name: Upload release for testing | |
uses: actions/upload-artifact@v4 | |
with: | |
name: realm-swift-${{ needs.prepare.outputs.VERSION }} | |
path: pkg/realm-swift-${{ needs.prepare.outputs.VERSION }}.zip | |
test-package-examples: | |
runs-on: macos-14 | |
name: Test examples | |
needs: [package-release, prepare] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Select Xcode Version | |
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app | |
- name: Restore release | |
uses: actions/download-artifact@v4 | |
with: | |
name: realm-swift-${{ needs.prepare.outputs.VERSION }} | |
- name: Test examples | |
run: sh -x build.sh release-test-examples | |
test-ios-static: | |
runs-on: macos-14 | |
name: Run tests on iOS with configuration Static | |
needs: package-release | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Select Xcode Version | |
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app | |
- name: Test ios static | |
run: sh -x build.sh test-ios-static | |
test-osx-static: | |
runs-on: macos-14 | |
name: Run tests on macOS | |
needs: package-release | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Select Xcode Version | |
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app | |
- name: Test osx static | |
run: | | |
export REALM_DISABLE_METADATA_ENCRYPTION=1 | |
sh -x build.sh test-osx | |
test-installation: | |
runs-on: macos-14 | |
name: Run installation test | |
needs: [package-release, 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: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Select Xcode Version | |
run: sudo xcode-select -switch /Applications/Xcode_${{ env.RELEASE_VERSION }}.app | |
- name: Restore release | |
uses: actions/download-artifact@v4 | |
if: ${{ matrix.installation == 'xcframework' }} | |
with: | |
name: realm-${{ matrix.platform }}-${{ env.RELEASE_VERSION }} | |
- name: Unzip package release | |
if: ${{ matrix.installation == 'xcframework' }} | |
run: | | |
mkdir -p build | |
unzip realm-${{ matrix.platform }}-${{ env.RELEASE_VERSION }}.zip -d build | |
- name: Run installation test | |
run: | | |
echo "REALM_TEST_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
cd examples/installation | |
bundle exec ./build.rb ${{ matrix.platform }} ${{ matrix.installation }} ${{ matrix.linkage }} | |
test-installation-xcframework: | |
runs-on: macos-14 | |
name: Run installation test for xcframework | |
needs: [package-release, prepare] | |
env: | |
PLATFORM: 'osx' | |
strategy: | |
matrix: | |
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Select Xcode Version | |
run: sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode-version }}.app | |
- name: Restore release | |
uses: actions/download-artifact@v4 | |
with: | |
name: realm-${{ env.PLATFORM }}-${{ matrix.xcode-version }} | |
- name: Unzip package release | |
run: | | |
mkdir -p build | |
unzip realm-${{ env.PLATFORM }}-${{ matrix.xcode-version }}.zip -d build | |
- name: Run installation test | |
run: | | |
echo "REALM_TEST_BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
cd examples/installation | |
bundle exec ./build.rb osx xcframework dynamic | |