|
| 1 | +name: Publish release |
| 2 | +on: workflow_dispatch |
| 3 | +env: |
| 4 | + XCODE_VERSION: "['14.2', '14.3.1', '15.1', '15.2']" |
| 5 | + TEST_XCODE_VERSION: '15.1' |
| 6 | +jobs: |
| 7 | + prepare: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + name: Prepare outputs |
| 10 | + outputs: |
| 11 | + XCODE_VERSIONS_MATRIX: ${{ env.XCODE_VERSION }} |
| 12 | + VERSION: ${{ steps.get-version.outputs.VERSION }} |
| 13 | + steps: |
| 14 | + - name: Checkout |
| 15 | + uses: actions/checkout@v4 |
| 16 | + - name: Compute outputs |
| 17 | + run: | |
| 18 | + echo "XCODE_VERSIONS_MATRIX=${{ env.XCODE_VERSION }}" >> $GITHUB_OUTPUT |
| 19 | + - name: Read SDK version |
| 20 | + id: get-version |
| 21 | + run: | |
| 22 | + version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${GITHUB_WORKSPACE}/dependencies.list")" |
| 23 | + echo "VERSION=$version" >> $GITHUB_OUTPUT |
| 24 | + tag-release: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + name: Tag Release |
| 27 | + needs: prepare |
| 28 | + steps: |
| 29 | + - name: Checkout |
| 30 | + uses: actions/checkout@v4 |
| 31 | + - uses: rickstaa/action-create-tag@v1 |
| 32 | + id: "tag_create" |
| 33 | + with: |
| 34 | + tag: "v${{ needs.prepare.outputs.VERSION }}" |
| 35 | + tag_exists_error: false |
| 36 | + message: "" |
| 37 | + publish-docs: |
| 38 | + runs-on: macos-latest |
| 39 | + name: Publish docs to S3 Bucket |
| 40 | + needs: tag-release |
| 41 | + env: |
| 42 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 43 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 44 | + steps: |
| 45 | + - name: Checkout |
| 46 | + uses: actions/checkout@v4 |
| 47 | + - name: Gem install |
| 48 | + run: | |
| 49 | + gem install octokit |
| 50 | + gem install pathname |
| 51 | + gem install fileutils |
| 52 | + - name: Export GITHUB_TOKEN to workspace |
| 53 | + run: echo "GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV |
| 54 | + - name: Publish docs |
| 55 | + run: | |
| 56 | + sh -x build.sh publish-docs ${{ github.sha }} |
| 57 | + create-release: |
| 58 | + runs-on: macos-latest |
| 59 | + name: Create github release |
| 60 | + needs: [tag-release, prepare] |
| 61 | + steps: |
| 62 | + - name: Checkout |
| 63 | + uses: actions/checkout@v4 |
| 64 | + - name: Gem install |
| 65 | + run: | |
| 66 | + gem install octokit |
| 67 | + gem install pathname |
| 68 | + gem install fileutils |
| 69 | + - name: Export GITHUB_TOKEN to workspace |
| 70 | + run: echo "GITHUB_ACCESS_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV |
| 71 | + - name: Create Github release |
| 72 | + run: ./build.sh publish-github ${{ github.sha }} |
| 73 | + publish-cocoapods: |
| 74 | + runs-on: macos-latest |
| 75 | + name: Publish Cocoapods specs |
| 76 | + needs: [tag-release, prepare] |
| 77 | + env: |
| 78 | + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} |
| 79 | + steps: |
| 80 | + - name: Checkout |
| 81 | + uses: actions/checkout@v4 |
| 82 | + - name: Install ruby |
| 83 | + uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 |
| 84 | + with: |
| 85 | + ruby-version: '3.1.2' |
| 86 | + bundler-cache: true |
| 87 | + - name: Publish |
| 88 | + run: ./build.sh publish-cocoapods v${{ needs.prepare.outputs.VERSION }} |
| 89 | + update-checker: |
| 90 | + runs-on: macos-latest |
| 91 | + name: Update to latest version update checker file |
| 92 | + needs: tag-release |
| 93 | + env: |
| 94 | + AWS_ACCESS_KEY_ID: ${{ secrets.UPDATE_CHECKER_ACCESS_KEY }} |
| 95 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.UPDATE_CHECKER_SECRET_KEY }} |
| 96 | + steps: |
| 97 | + - name: Checkout |
| 98 | + uses: actions/checkout@v4 |
| 99 | + - name: Install ruby |
| 100 | + uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 |
| 101 | + with: |
| 102 | + ruby-version: '3.1.2' |
| 103 | + bundler-cache: true |
| 104 | + - name: Create Github release |
| 105 | + run: ./build.sh publish-update-checker |
| 106 | + test-installation: |
| 107 | + runs-on: macos-13 |
| 108 | + name: Run installation test for ${{ matrix.platform }}, ${{ matrix.installation }} and ${{ matrix.linkage }} |
| 109 | + needs: [create-release, prepare] |
| 110 | + strategy: |
| 111 | + matrix: |
| 112 | + platform: [ios, osx, watchos, tvos, catalyst, visionos] |
| 113 | + installation: [cocoapods, spm, carthage, xcframework] |
| 114 | + linkage: [static, dynamic] |
| 115 | + exclude: |
| 116 | + - installation: carthage |
| 117 | + linkage: static |
| 118 | + - platform: catalyst |
| 119 | + installation: carthage |
| 120 | + - platform: osx |
| 121 | + installation: xcframework |
| 122 | + linkage: static |
| 123 | + - platform: watchos |
| 124 | + installation: xcframework |
| 125 | + linkage: static |
| 126 | + - platform: tvos |
| 127 | + installation: xcframework |
| 128 | + linkage: static |
| 129 | + - platform: catalyst |
| 130 | + installation: xcframework |
| 131 | + linkage: static |
| 132 | + - platform: visionos |
| 133 | + installation: xcframework |
| 134 | + linkage: static |
| 135 | + - platform: catalyst |
| 136 | + installation: carthage |
| 137 | + linkage: static |
| 138 | + - platform: visionos |
| 139 | + installation: carthage |
| 140 | + - platform: visionos |
| 141 | + installation: cocoapods |
| 142 | + steps: |
| 143 | + - name: Checkout |
| 144 | + uses: actions/checkout@v4 |
| 145 | + - name: Install FileUtils |
| 146 | + run: gem install fileutils |
| 147 | + - uses: maxim-lobanov/setup-xcode@v1 |
| 148 | + with: |
| 149 | + xcode-version: ${{ env.TEST_XCODE_VERSION }} |
| 150 | + - name: Set REALM_TEST_RELEASE |
| 151 | + run: echo "REALM_TEST_RELEASE=${{ needs.prepare.outputs.VERSION }}" >> $GITHUB_ENV |
| 152 | + - name: Run installation test |
| 153 | + run: | |
| 154 | + cd examples/installation |
| 155 | + ./build.rb ${{ matrix.platform }} ${{ matrix.installation }} ${{ matrix.linkage }} |
| 156 | + post-slack-release: |
| 157 | + runs-on: macos-latest |
| 158 | + name: Publish to release Slack channel |
| 159 | + needs: [test-installation, prepare] |
| 160 | + env: |
| 161 | + WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK }} |
| 162 | + steps: |
| 163 | + - name: Checkout |
| 164 | + uses: actions/checkout@v4 |
| 165 | + - name: Gem install |
| 166 | + run: | |
| 167 | + gem install octokit |
| 168 | + gem install pathname |
| 169 | + gem install fileutils |
| 170 | + - name: Prepare Changelog |
| 171 | + run: ./build.sh prepare-publish-changelog |
| 172 | + - name: 'Post to #realm-releases' |
| 173 | + uses: realm/ci-actions/release-to-slack@v3 |
| 174 | + with: |
| 175 | + changelog: ExtractedChangelog/CHANGELOG.md |
| 176 | + sdk: Swift |
| 177 | + webhook-url: ${{ env.WEBHOOK_URL }} |
| 178 | + version: ${{ needs.prepare.outputs.VERSION }} |
0 commit comments