Skip to content

Workflow file for this run

name: Publish release
on:
push:
branches:
- "dp/test_release"
jobs:
prepare:
runs-on: macos-latest
name: Check if draft release is created
steps:
- name: Get draft release
id: get_release
uses: agners/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
tag-release:
runs-on: macos-latest
name: Tag Release
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
- name: Tag release
run: ./build.sh publish-tag ${{ steps.extract_branch.outputs.branch }}
publish-docs:
runs-on: macos-latest
name: Publish docs to S3 Bucket
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export AWS Secrets to workspace
run: |
echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV
- name: Download docs and upload them to S3
run: |
./build.sh publish-docs
create-release:
runs-on: macos-latest
name: Create github 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: Create Github release
run: ./build.sh publish-github
publish-cocoapods:
runs-on: macos-latest
name: Publish Cocoapods specs
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read SDK version
id: get-version
run: |
version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${source_root}/dependencies.list")"pkgVersion=$(find . -type f -regex ".*Realm.[1-9].*.nupkg" -exec basename {} \; | sed -n 's/Realm\.\(.*\)\.nupkg$/\1/p')
echo "version=$version" >> $GITHUB_OUTPUT
- name: Export COCOAPODS_TRUNK_TOKEN to workspace
run: echo "COCOAPODS_TRUNK_TOKEN=${{ secrets.COCOAPODS_TRUNK_TOKEN }}" >> $GITHUB_ENV
- name: Publish
run: ./build.sh publish-cocoapods v${{ steps.get-version.outputs.version }}
update-update-checker:
runs-on: macos-latest
name: Publish Cocoapods specs
needs: prepare
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Export AWS Secrets to workspace
run: |
echo "AWS_ACCESS_KEY_ID=${{ secrets.UPDATE_CHECKER_ACCESS_KEY }}" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.UPDATE_CHECKER_SECRET_KEY }}" >> $GITHUB_ENV
- name: Create Github release
run: ./build.sh publish-update-checker
test-installation:
runs-on: ubuntu-latest
name: Run installation test for ${{ matrix.platform }}, ${{ matrix.installation }} and ${{ matrix.linkage }}
needs: update-update-checker
env:
XCODE_VERSION: '15.1'
strategy:
max-parallel: 5
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: Read SDK version
id: get-version
run: |
version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${source_root}/dependencies.list")"pkgVersion=$(find . -type f -regex ".*Realm.[1-9].*.nupkg" -exec basename {} \; | sed -n 's/Realm\.\(.*\)\.nupkg$/\1/p')
echo "version=$version" >> $GITHUB_OUTPUT
- 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 publish-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 }}
post-slack-release:
runs-on: macos-latest
name: Publish to release Slack channel
needs: test-installation
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Changelog
run: ./build.sh prepare-publish-changelog
- name: Read SDK version
id: get-version
run: |
version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${source_root}/dependencies.list")"pkgVersion=$(find . -type f -regex ".*Realm.[1-9].*.nupkg" -exec basename {} \; | sed -n 's/Realm\.\(.*\)\.nupkg$/\1/p')
echo "version=$version" >> $GITHUB_OUTPUT
- name: 'Post to #realm-releases'
uses: realm/ci-actions/release-to-slack@v3
with:
changelog: ExtractedChangelog/CHANGELOG.md
sdk: Swift
webhook-url: ${{ secrets.SLACK_RELEASE_WEBHOOK }}
version: ${{ steps.get-version.outputs.version }}
add-empty-changelog:
runs-on: macos-latest
name: Add empty changelog and push it to master, preparing for a future release
needs: post-slack-release
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Add empty changelog
run: ./build.sh add-empty-changelog
- name: Commit & Push changes to master
uses: actions-js/push@master
with:
github_token: ${{ github.token }}