prepare-xcframework-release #10
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
name: prepare-xcframework-release | |
on: | |
workflow_dispatch: | |
inputs: | |
product_name: | |
description: 'The Xcode product name' | |
required: true | |
default: 'GliaWidgets' | |
xcode_scheme: | |
description: 'Xcode workspace scheme. It will be used for archieving project.' | |
required: true | |
default: 'GliaWidgets' | |
semver_bump_type: | |
description: 'Semver bump type. Options: major, minor, patch, premajor, preminor, prepatch, or prerelease. Default level is patch. Only one version may be specified.' | |
required: true | |
default: 'patch' | |
jobs: | |
build: | |
name: Build and analyse default scheme using xcodebuild command | |
runs-on: macos-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: | | |
pod install --repo-update | |
- name: Archieve iphoneos | |
run: | | |
xcodebuild archive \ | |
-workspace "${{ github.event.inputs.product_name }}.xcworkspace" \ | |
-scheme "${{ github.event.inputs.xcode_scheme }}" \ | |
-sdk iphoneos \ | |
-archivePath "xcf/${{ github.event.inputs.product_name }}-iphoneos.xcarchive" \ | |
SKIP_INSTALL=NO \ | |
BUILD_LIBRARY_FOR_DISTRIBUTION=YES | |
shell: bash | |
- name: Archieve iphonesimulator | |
run: | | |
xcodebuild archive \ | |
-workspace "${{ github.event.inputs.product_name }}.xcworkspace" \ | |
-scheme "${{ github.event.inputs.xcode_scheme }}" \ | |
-sdk iphonesimulator \ | |
-archivePath "xcf/${{ github.event.inputs.product_name }}-iossimulator.xcarchive" \ | |
SKIP_INSTALL=NO \ | |
BUILD_LIBRARY_FOR_DISTRIBUTION=YES | |
shell: bash | |
- name: Create xcframework | |
run: | | |
xcodebuild -create-xcframework \ | |
-framework "xcf/${{ github.event.inputs.product_name }}-iphoneos.xcarchive/Products/Library/Frameworks/${{ github.event.inputs.product_name }}.framework" \ | |
-framework "xcf/${{ github.event.inputs.product_name }}-iossimulator.xcarchive/Products/Library/Frameworks/${{ github.event.inputs.product_name }}.framework" \ | |
-output "xcf/${{ github.event.inputs.product_name }}.xcframework" | |
shell: bash | |
- uses: actions/create-release@v1 | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: "v1.0.0" | |
release_name: "My Release" | |
draft: true | |
prerelease: false | |
- uses: ksm2/archive-action@v1 | |
id: archive | |
with: | |
root-directory: "xcf/GliaWidgets.xcframework" | |
format: "zip" | |
name: "GliaWidgetsXcf.xcframework" | |
- uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ steps.archive.outputs.path }} | |
asset_name: ${{ steps.archive.outputs.name }} | |
asset_content_type: ${{ steps.archive.outputs.media-type }} |