Skip to content

Commit

Permalink
Use reusable GitHub workflows for archiving and creating the XCFramew…
Browse files Browse the repository at this point in the history
…ork (#9)

# Use template GitHub workflows for archiving and creating the
XCFramework

## ♻️ Current situation & Problem
In StanfordBDHG/.github#40, we introduced
reusable GitHub Actions workflows for the archiving and creation of
XCFrameworks. This enables us to avoid code duplication.


## ⚙️ Release Notes 
- GitHub Actions workflow utilizes shared reusable workflows.
- ResearchKit updated to latest version v2.2.12


## 📚 Documentation
Provided in the workflow files


## ✅ Testing
Manually tested by creating an example release of ResearchKit.


### Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md):
- [X] I agree to follow the [Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).

---------

Co-authored-by: Pariece McKinney <[email protected]>
Co-authored-by: philippzagar <[email protected]>
  • Loading branch information
3 people authored Nov 10, 2023
1 parent 9530fad commit 23ce5f2
Show file tree
Hide file tree
Showing 112 changed files with 2,235 additions and 1,645 deletions.
57 changes: 22 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#
# This source file is part of the Stanford Biodesign Digital Health Group open-source organization
#
# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

name: Build XCArchive

on:
Expand All @@ -6,43 +14,22 @@ on:
workflow_call:
inputs:
version:
description: 'The version number of the framework embedded in the XCArchives'
description: 'The version number of the framework embedded in the XCArchives.'
type: string
required: true
configuration:
description: 'The build configuration to use when archiving the scheme, either Debug or Release.'
type: string
required: false
default: 'Release'

jobs:
build-xcarchive:
name: Build XCArchive
runs-on: macos-13
strategy:
matrix:
sdk: [iphoneos, iphonesimulator]
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Check environment
run: |
xcodebuild -version
swift --version
echo Release version: ${{ inputs.version }}
echo SDK: ${{ matrix.sdk }}
- name: Archive for iOS
run: |
xcodebuild archive \
-workspace RKWorkspace.xcworkspace \
-scheme ResearchKit \
-configuration Release \
-sdk ${{ matrix.sdk }} \
-archivePath './.build/ResearchKit-${{ matrix.sdk }}.xcarchive' \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
ONLY_ACTIVE_ARCH=NO \
CI=TRUE \
ORK_FRAMEWORK_VERSION_NUMBER=${{ inputs.version }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ResearchKit-${{ matrix.sdk }}.xcarchive
path: ./.build/ResearchKit-${{ matrix.sdk }}.xcarchive
uses: StanfordBDHG/.github/.github/workflows/archive.yml@v2
with:
workspaceFile: 'RKWorkspace.xcworkspace'
xcArchiveName: 'ResearchKit'
scheme: 'ResearchKit'
version: ${{ inputs.version }}
configuration: ${{ inputs.configuration || 'Release' }}
runsonlabels: '["macOS", "self-hosted"]'
71 changes: 23 additions & 48 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,33 @@
name: Release
#
# This source file is part of the Stanford Biodesign Digital Health Group open-source organization
#
# SPDX-FileCopyrightText: 2022 Stanford University and the project authors (see CONTRIBUTORS.md)
#
# SPDX-License-Identifier: MIT
#

on:
name: Create XCFramework and Release

on:
workflow_dispatch:
inputs:
version:
description: 'The version number that should be used to tag the release'
description: 'The version number of the framework embedded in the XCArchives. This version number is also used for the release tag.'
type: string
required: true
configuration:
description: 'The build configuration to use when archiving the scheme, either Debug or Release.'
type: string
required: false
default: 'Release'

jobs:
build-xcarchive:
name: Build XCArchive
uses: ./.github/workflows/build.yml
create-xcframework-and-release-workflow:
uses: StanfordBDHG/.github/.github/workflows/xcframework.yml@v2
with:
workspaceFile: 'RKWorkspace.xcworkspace'
xcFrameworkName: 'ResearchKit'
scheme: 'ResearchKit'
version: ${{ inputs.version }}
create-xcframework:
name: Build XCFramework
runs-on: macos-13
needs: build-xcarchive
steps:
- uses: actions/checkout@v3
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Check environment
run: |
xcodebuild -version
swift --version
echo Release version: ${{ inputs.version }}
- uses: actions/download-artifact@v3
with:
path: ./.build
- name: Create XCFramework
run: |
rm -rf ResearchKit.xcframework
xcodebuild -create-xcframework \
-framework ./.build/ResearchKit-iphoneos.xcarchive/Products/Library/Frameworks/ResearchKit.framework \
-framework ./.build/ResearchKit-iphonesimulator.xcarchive/Products/Library/Frameworks/ResearchKit.framework \
-output ResearchKit.xcframework
rm -rf .build
- name: Commit and push XCFramework
uses: EndBug/add-and-commit@v9
with:
add: ResearchKit.xcframework
message: Create XCFramework for release ${{ inputs.version }}
tag: '${{ inputs.version }} --force'
tag_push: '--force'
- name: Create Artifacts
run: |
tar -zcvf ResearchKit.xcframework.tar.gz ResearchKit.xcframework
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.version }}
generate_release_notes: true
fail_on_unmatched_files: true
files: ResearchKit.xcframework.tar.gz
configuration: ${{ inputs.configuration }}
runsonlabels: '["macOS", "self-hosted"]'
10 changes: 5 additions & 5 deletions ResearchKit.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
<key>BinaryPath</key>
<string>ResearchKit.framework/ResearchKit</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>ResearchKit.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>ResearchKit.framework/ResearchKit</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>ResearchKit.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file modified ResearchKit.xcframework/ios-arm64/ResearchKit.framework/Assets.car
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ ORK_CLASS_AVAILABLE API_AVAILABLE(ios(11.0), watchos(6.0))
*/
@property (nonatomic, copy, nullable) UIImage *iconImage;

/**
A property that gates automatic tint color image changes based on appearance changes
like userInterfaceStyle changes, and set to NO by default.
*/
@property (nonatomic) BOOL shouldAutomaticallyAdjustImageTintColor;

/**
Whether to show progress for this step when it is presented. The default is YES.
*/
Expand Down
Binary file not shown.
Loading

0 comments on commit 23ce5f2

Please sign in to comment.