-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cd36e7
commit d071895
Showing
4 changed files
with
158 additions
and
57 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,13 @@ on: | |
branches: | ||
- "master" | ||
env: | ||
XCODE_VERSION: "['15.1']" # '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' | ||
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 | ||
|
@@ -111,7 +112,7 @@ jobs: | |
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 prevous step which that a package for ${{ matrix.platform }} in ${{ matrix.xcode-version }} with configuration ${{ matrix.configuration }} | ||
- 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 }})) | ||
|
@@ -405,8 +406,19 @@ jobs: | |
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 }} | ||
- name: Creates on demand XCode Cloud's workflows for running ios-static test | ||
id: create-workflow | ||
run: | | ||
workflow_id=$(echo $(ruby ./scripts/xcode_cloud_helper.rb --create-test-workflow "ios-static-${{ env.TEST_VERSION }}" --token ${{ steps.token.outputs.token }} --xcode-version ${{ env.TEST_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 }} | ||
test-osx-static: | ||
runs-on: ubuntu-latest | ||
name: Run tests on macOS | ||
|
@@ -424,14 +436,23 @@ jobs: | |
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 }} | ||
- name: Creates on demand XCode Cloud's workflows for running osx-static test | ||
id: create-workflow | ||
run: | | ||
workflow_id=$(echo $(ruby ./scripts/xcode_cloud_helper.rb --create-test-workflow "osx-static-${{ env.TEST_VERSION }}" --token ${{ steps.token.outputs.token }} --xcode-version ${{ env.TEST_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 }} | ||
test-installation: | ||
runs-on: ubuntu-latest | ||
name: Run installation test for ${{ matrix.platform }}, ${{ matrix.installation }} and ${{ matrix.linkage }} | ||
name: Run installation test | ||
needs: create-final-package | ||
env: | ||
XCODE_VERSION: '14.3.1' | ||
strategy: | ||
matrix: | ||
platform: [ios, osx, watchos, tvos, catalyst] | ||
|
@@ -455,48 +476,58 @@ jobs: | |
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 | ||
- name: Creates on demand XCode Cloud's workflows to run installation test for ${{ matrix.platform }}, ${{ matrix.installation }}, ${{ matrix.linkage }} | ||
id: create-workflow | ||
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 }} | ||
test-installation-xcode: # we run this installation tests separatly because we need xcode cloud workflows previsously created with a GITHUB token so we can download the release package for this tests | ||
runs-on: ubuntu-latest | ||
name: Run installation xcframework ${{ matrix.platform }}, ${{ matrix.linkage }} in ${{ matrix.xcode_version }} | ||
needs: create-final-package | ||
strategy: | ||
max-parallel: 5 | ||
matrix: | ||
platform: [osx] | ||
xcode_version: ['14.1', '14.2', '14.3.1', '15.0.1', '15.1'] | ||
linkage: [dynamic] | ||
include: | ||
- platform: ios | ||
xcode_version: '14.3.1' | ||
linkage: dynamic | ||
- platform: watchos | ||
xcode_version: '14.3.1' | ||
linkage: dynamic | ||
- platform: tvos | ||
xcode_version: '14.3.1' | ||
linkage: dynamic | ||
- platform: catalyst | ||
xcode_version: '14.3.1' | ||
linkage: dynamic | ||
- platform: ios | ||
installation: '14.3.1' | ||
linkage: static | ||
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 installation tests for ${{ matrix.platform }} xcframework ${{ matrix.linkage }} in xcode version ${{ matrix.xcode-version }} | ||
workflow_id=$(echo $(ruby ./scripts/xcode_cloud_helper.rb --create-test-workflow "test-installation-${{ matrix.platform }}-${{ matrix.installation }}-${{ matrix.linkage }}" --token ${{ steps.token.outputs.token }} --xcode-version ${{ env.TEST_VERSION }})) | ||
echo "WORKFLOW_ID=$workflow_id" >> $GITHUB_OUTPUT | ||
- name: Runs the XCode Cloud workflow created by the previous step | ||
id: build-run | ||
run: | | ||
ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow "release_test-installation-${{ matrix.platform }}-xcframework-${{ matrix.linkage }}_${{ matrix.xcode-version }}" --token ${{ steps.token.outputs.token }} | ||
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 }} | ||
# test-installation-xcode: # we run this installation tests separatly because we need xcode cloud workflows previsously created with a GITHUB token so we can download the release package for this tests | ||
# runs-on: ubuntu-latest | ||
# name: Run installation xcframework ${{ matrix.platform }}, ${{ matrix.linkage }} in ${{ matrix.xcode_version }} | ||
# needs: create-final-package | ||
# strategy: | ||
# max-parallel: 5 | ||
# matrix: | ||
# platform: [osx] | ||
# xcode_version: ['14.1', '14.2', '14.3.1', '15.0.1', '15.1'] | ||
# linkage: [dynamic] | ||
# include: | ||
# - platform: ios | ||
# xcode_version: '14.3.1' | ||
# linkage: dynamic | ||
# - platform: watchos | ||
# xcode_version: '14.3.1' | ||
# linkage: dynamic | ||
# - platform: tvos | ||
# xcode_version: '14.3.1' | ||
# linkage: dynamic | ||
# - platform: catalyst | ||
# xcode_version: '14.3.1' | ||
# linkage: dynamic | ||
# - platform: ios | ||
# installation: '14.3.1' | ||
# linkage: static | ||
# 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 installation tests for ${{ matrix.platform }} xcframework ${{ matrix.linkage }} in xcode version ${{ matrix.xcode-version }} | ||
# run: | | ||
# ruby ./scripts/xcode_cloud_helper.rb --run-release-workflow "release_test-installation-${{ matrix.platform }}-xcframework-${{ matrix.linkage }}_${{ matrix.xcode-version }}" --token ${{ steps.token.outputs.token }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#!/usr/bin/env ruby | ||
|
||
module RELEASE | ||
DOCS_XCODE_VERSION = '14.3.1' | ||
XCODE_VERSIONS = ['14.1', '14.2', '14.3.1', '15.0.1', '15.1'] | ||
PLATFORMS_NAMES = ['osx': 'macOS', 'ios': 'iOS', 'watchos': 'watchOS', 'tvos': 'tvOS', 'catalyst': 'Catalyst', 'visionos': 'visionOS'] | ||
|
||
all = ->(v) { true } | ||
latest_only = ->(v) { v == XCODE_VERSIONS.last } | ||
doc_version = ->(v) { v == DOCS_XCODE_VERSION } | ||
|
||
PLATFORMS = { | ||
'osx' => all, | ||
'ios' => all, | ||
'watchos' => all, | ||
'tvos' => all, | ||
'catalyst' => all, | ||
'visionos' => latest_only, | ||
} | ||
|
||
RELEASE_XCODE_CLOUD_TARGETS = { | ||
'package-docs' => doc_version, | ||
'package' => all, | ||
'test-package-examples' => latest_only, | ||
'test-ios-static' => latest_only, | ||
'test-osx' => latest_only, | ||
'test-installation-osx-xcframework-dynamic' => all, | ||
'test-installation-ios-xcframework-dynamic' => doc_version, | ||
'test-installation-watchos-xcframework-dynamic' => doc_version, | ||
'test-installation-tvos-xcframework-dynamic' => doc_version, | ||
'test-installation-catalyst-xcframework-dynamic' => doc_version, | ||
'test-installation-ios-xcframework-static' => doc_version, | ||
} | ||
end | ||
|
||
def get_doc_version | ||
puts "#{RELEASE::DOCS_XCODE_VERSION}" | ||
end | ||
|
||
def plaforms_for_version(version) | ||
platforms_version = [] | ||
RELEASE::PLATFORMS.each { |platform, filter| | ||
if filter.call(version) | ||
platforms_version.append(platform) | ||
end | ||
} | ||
puts "#{platforms_version.join(",")}" | ||
end | ||
|
||
def get_xcode_versions | ||
puts "#{RELEASE::XCODE_VERSIONS.join(",")}" | ||
end | ||
|
||
if ARGV[0] == 'docs_version' | ||
get_doc_version | ||
elsif ARGV[0] == 'plaforms_for_version' | ||
version = ARGV[1] | ||
plaforms_for_version(version) | ||
elsif ARGV[0] == 'xcode_versions' | ||
get_xcode_versions | ||
end |
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