Skip to content

Commit

Permalink
Improved docs
Browse files Browse the repository at this point in the history
  • Loading branch information
philippzagar committed Nov 8, 2023
1 parent 7487dfa commit 44141d5
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 31 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,37 @@ name: Build XCArchive
on:
workflow_call:
inputs:
archiveName:
description: 'The name of the archive'
workspaceFile:
description: 'The path of the Xcode Workspace file (including the file extension).'
type: string
required: true
workspaceFile:
description: 'The path to the workspace file'
XCArchiveName:
description: 'The name of the to be created XCArchive. It must not include the default XCArchive extension ".xcarchive" as the file naming is automatically done be the workflow.'
type: string
required: true
scheme:
description: 'The scheme to archive'
description: 'The project scheme that should be used for the archiving process.'
type: string
required: true
version:
description: 'The version number of the framework embedded in the XCArchives'
description: 'The version number of the XCFramework embedded in the XCArchives.'
type: string
required: true
configuration:
description: 'The configuration to use when archiving the scheme'
description: 'The build configuration to use when archiving the scheme, either Debug or Release.'
type: string
required: false
default: 'Release'
runsonlabels:
description: 'JSON-based collection of labels indicating which type of github runner should be chosen.'
required: false
type: string
default: '["macos-13"]'

jobs:
build-xcarchive:
name: Build XCArchive
runs-on: macos-13
runs-on: ${{ fromJson(inputs.runsonlabels) }}
strategy:
matrix:
sdk: [iphoneos, iphonesimulator]
Expand All @@ -58,7 +63,7 @@ jobs:
-scheme ${{ inputs.scheme }} \
-configuration ${{ inputs.configuration }} \
-sdk ${{ matrix.sdk }} \
-archivePath './.build/${{ inputs.archiveName }}-${{ matrix.sdk }}.xcarchive' \
-archivePath './.build/${{ inputs.XCArchiveName }}-${{ matrix.sdk }}.xcarchive' \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
ONLY_ACTIVE_ARCH=NO \
Expand All @@ -67,5 +72,5 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.archiveName }}-${{ matrix.sdk }}.xcarchive
path: ./.build/${{ inputs.archiveName }}-${{ matrix.sdk }}.xcarchive
name: ${{ inputs.XCArchiveName }}-${{ matrix.sdk }}.xcarchive
path: ./.build/${{ inputs.XCArchiveName }}-${{ matrix.sdk }}.xcarchive
47 changes: 27 additions & 20 deletions .github/workflows/xcframework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,57 @@
# SPDX-License-Identifier: MIT
#

name: Release
name: Create XCFramework and Release

on:
workflow_call:
inputs:
xcFrameworkName:
description: 'The name of the XCFramework'
workspaceFile:
description: 'The path of the Xcode Workspace file (including the file extension).'
type: string
required: true
archiveName:
description: 'The name of the archive'
XCFrameworkName:
description: 'The name of the to be created XCFramework. It must not include the default XCFramework extension ".xcframework" as the file naming is automatically done be the workflow.'
type: string
required: true
workspaceFile:
description: 'The path to the workspace file'
XCArchiveName:
description: 'The name of the to be created XCArchive. It must not include the default XCArchive extension ".xcarchive" as the file naming is automatically done be the workflow.'
type: string
required: true
scheme:
description: 'The scheme to archive'
description: 'The project scheme that should be used for the archiving process.'
type: string
required: true
version:
description: 'The version number of the framework embedded in the XCArchives'
description: 'The version number of the XCFramework embedded in the XCArchives. This version number is also used for the release tag.'
type: string
required: true
configuration:
description: 'The configuration to use when archiving the scheme'
description: 'The build configuration to use when archiving the scheme, either Debug or Release.'
type: string
required: false
default: 'Release'
runsonlabels:
description: 'JSON-based collection of labels indicating which type of github runner should be chosen.'
required: false
type: string
default: '["macos-13"]'


jobs:
build-xcarchive:
name: Build XCArchive
uses: ./.github/workflows/archive.yml
with:
archiveName: ${{ inputs.archiveName }}
archiveName: ${{ inputs.XCArchiveName }}
workspaceFile: ${{ inputs.workspaceFile }}
scheme: ${{ inputs.scheme }}
version: ${{ inputs.version }}
configuration: ${{ inputs.configuration }}
create-xcframework:
runs-on: ${{ fromJson(inputs.runsonlabels) }}
create-xcframework-and-release:
name: Build XCFramework
runs-on: macos-13
runs-on: ${{ fromJson(inputs.runsonlabels) }}
needs: build-xcarchive
steps:
- uses: actions/checkout@v3
Expand All @@ -66,26 +73,26 @@ jobs:
path: ./.build
- name: Create XCFramework
run: |
rm -rf ${{ inputs.xcFrameworkName }}.xcframework
rm -rf ${{ inputs.XCFrameworkName }}.xcframework
xcodebuild -create-xcframework \
-framework ./.build/${{ inputs.archiveName }}-iphoneos.xcarchive/Products/Library/Frameworks/${{ inputs.archiveName }}.framework \
-framework ./.build/${{ inputs.archiveName }}-iphonesimulator.xcarchive/Products/Library/Frameworks/${{ inputs.archiveName }}.framework \
-output ${{ inputs.xcFrameworkName }}.xcframework
-framework ./.build/${{ inputs.XCArchiveName }}-iphoneos.xcarchive/Products/Library/Frameworks/${{ inputs.XCArchiveName }}.framework \
-framework ./.build/${{ inputs.XCArchiveName }}-iphonesimulator.xcarchive/Products/Library/Frameworks/${{ inputs.XCArchiveName }}.framework \
-output ${{ inputs.XCFrameworkName }}.xcframework
rm -rf .build
- name: Commit and push XCFramework
uses: EndBug/add-and-commit@v9
with:
add: ${{ inputs.xcFrameworkName }}.xcframework
add: ${{ inputs.XCFrameworkName }}.xcframework
message: Create XCFramework for release ${{ inputs.version }}
tag: '${{ inputs.version }} --force'
tag_push: '--force'
- name: Create Artifacts
run: |
tar -zcvf ${{ inputs.xcFrameworkName }}.xcframework.tar.gz ${{ inputs.xcFrameworkName }}.xcframework
tar -zcvf ${{ inputs.XCFrameworkName }}.xcframework.tar.gz ${{ inputs.XCFrameworkName }}.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: ${{ inputs.xcFrameworkName }}.xcframework.tar.gz
files: ${{ inputs.XCFrameworkName }}.xcframework.tar.gz

0 comments on commit 44141d5

Please sign in to comment.