From 43e4918c0ebddc31f8eefc6411b093b2c136bf12 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Sat, 18 May 2024 15:46:19 -0700 Subject: [PATCH 1/8] Update Setup --- .github/workflows/xcframework.yml | 69 +++++++++++++++++++------------ 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/.github/workflows/xcframework.yml b/.github/workflows/xcframework.yml index 3ecf537..1f581dd 100644 --- a/.github/workflows/xcframework.yml +++ b/.github/workflows/xcframework.yml @@ -15,8 +15,8 @@ on: description: 'The path of the Xcode Workspace file (including the file extension).' type: string required: true - 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.' + xcFrameworkNames: + description: 'A JSON-based collection of framework names to be built and included in the XCFramework.' type: string required: true scheme: @@ -62,23 +62,29 @@ on: description: 'GitHub Personal Access Token (PAT) if the to-be-commited-to branch is protected and needs a specific access token to push commits to the branch' required: false - + jobs: - build-xcarchive: - name: Build XCArchive + build-xcarchives: + name: Build XCArchives + strategy: + matrix: + framework: ${{ fromJson(inputs.frameworkNames) }} uses: StanfordBDHG/.github/.github/workflows/archive.yml@v2 with: workspaceFile: ${{ inputs.workspaceFile }} - xcArchiveName: ${{ inputs.xcFrameworkName }} + xcArchiveName: ${{ matrix.framework }} scheme: ${{ inputs.scheme }} version: ${{ inputs.version }} configuration: ${{ inputs.configuration }} runsonlabels: ${{ inputs.runsonlabels }} sdk: ${{ inputs.sdk }} - create-xcframework-and-release: - name: Build XCFramework + build-xcframeworks: + name: Build XCFrameworks runs-on: ${{ fromJson(inputs.runsonlabels) }} - needs: build-xcarchive + needs: build-xcarchives + strategy: + matrix: + framework: ${{ fromJson(inputs.frameworkNames) }} steps: - uses: actions/checkout@v4 with: @@ -97,7 +103,7 @@ jobs: merge-multiple: true - name: Unpack XCArchives and create XCFramework run: | - rm -rf ${{ inputs.xcFrameworkName }}.xcframework + rm -rf ${{ matrix.framework }}.xcframework # Convert JSON array to space-separated string SDK_LIST="${{ inputs.sdk }}" @@ -108,9 +114,9 @@ jobs: FRAMEWORKS_ARGS="" for SDK in "${SDKS[@]}"; do # Unpack the XCArchive - tar -zxvf ./.build/${{ inputs.xcFrameworkName }}-${SDK}.xcarchive.tar.gz -C ./.build/ + tar -zxvf ./.build/${{ matrix.framework }}-${SDK}.xcarchive.tar.gz -C ./.build/ # Specify the path to the framework within the XCArchive - ARCHIVE_PATH="./.build/${{ inputs.xcFrameworkName }}-${SDK}.xcarchive/Products/Library/Frameworks/${{ inputs.xcFrameworkName }}.framework" + ARCHIVE_PATH="./.build/${{ matrix.framework }}-${SDK}.xcarchive/Products/Library/Frameworks/${{ matrix.framework }}.framework" echo "Checking archive path: $ARCHIVE_PATH" if [ -d "$ARCHIVE_PATH" ]; then FRAMEWORKS_ARGS+="-framework $ARCHIVE_PATH " @@ -124,28 +130,38 @@ jobs: FRAMEWORKS_ARGS=$(echo "$FRAMEWORKS_ARGS" | xargs) echo "Executing xcodebuild with args: $FRAMEWORKS_ARGS" - xcodebuild -create-xcframework $FRAMEWORKS_ARGS -output ${{ inputs.outputpath }}/${{ inputs.xcFrameworkName }}.xcframework | xcbeautify || { echo "xcodebuild failed"; exit 1; } + xcodebuild -create-xcframework $FRAMEWORKS_ARGS -output ${{ matrix.framework }}.xcframework | xcbeautify || { echo "xcodebuild failed"; exit 1; } rm -rf .build - - name: Commit and push XCFramework + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.framework }}.xcframework + path: ${{ matrix.framework }}.xcframework + + commit-and-release: + name: Commit and Release XCFrameworks + runs-on: ${{ fromJson(inputs.runsonlabels) }} + needs: build-xcframeworks + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.access-token || github.token }} + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + path: ./ + merge-multiple: true + - name: Commit and push XCFrameworks uses: EndBug/add-and-commit@v9 - if: ${{ !inputs.dryRun }} with: - add: ${{ inputs.xcFrameworkName }}.xcframework - message: Create XCFramework for release ${{ inputs.version }} + add: "*.xcframework" + message: Create XCFrameworks for release ${{ inputs.version }} tag: '${{ inputs.version }} --force' tag_push: '--force' github_token: ${{ secrets.access-token || github.token }} author_name: ${{ inputs.user || github.actor }} author_email: ${{ inputs.user || github.actor }}@users.noreply.github.com - - name: Create Artifacts - run: | - tar -zcvf ${{ inputs.xcFrameworkName }}.xcframework.tar.gz ${{ inputs.xcFrameworkName }}.xcframework - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.xcFrameworkName }}.xcframework.tar.gz - path: ${{ inputs.xcFrameworkName }}.xcframework.tar.gz - name: Create Release uses: softprops/action-gh-release@v1 if: ${{ !inputs.dryRun }} @@ -153,4 +169,5 @@ jobs: tag_name: ${{ inputs.version }} generate_release_notes: true fail_on_unmatched_files: true - files: ${{ inputs.xcFrameworkName }}.xcframework.tar.gz + files: | + *.xcframework From 6ae41bcc8cf75a94cca61d4d6e2c814fc9b5135f Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Sat, 18 May 2024 16:15:41 -0700 Subject: [PATCH 2/8] Split GitHub Actions --- .../xcframework-commit-and-release.yml | 76 +++++++++++++++++++ .github/workflows/xcframework.yml | 74 +++++------------- 2 files changed, 95 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/xcframework-commit-and-release.yml diff --git a/.github/workflows/xcframework-commit-and-release.yml b/.github/workflows/xcframework-commit-and-release.yml new file mode 100644 index 0000000..41910e5 --- /dev/null +++ b/.github/workflows/xcframework-commit-and-release.yml @@ -0,0 +1,76 @@ +# +# 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: Commit and Release XCFrameworks + +on: + workflow_call: + inputs: + dryRun: + description: 'If true, the workflow will not commit and release the built XCFramework.' + type: boolean + required: false + default: false + sdk: + description: 'JSON-based collection of SDK for the exported framework. Defaults to all SDKs. You can list SDKs using `xcodebuild -showsdks`.' + type: string + required: false + default: '["iphoneos", "iphonesimulator", "macosx", "appletvos", "appletvsimulator", "xros", "xrsimulator", "watchos", "watchsimulator"]' + outputpath: + description: 'Optional Prefix for the output path' + type: string + required: false + default: '.' + user: + description: 'Optional GitHub username that is associated with the GitHub Personal Access Token (PAT)' + type: string + required: false + default: '' + secrets: + access-token: + description: 'GitHub Personal Access Token (PAT) if the to-be-commited-to branch is protected and needs a specific access token to push commits to the branch' + required: false + + +jobs: + xcframework-commit-and-release: + name: Commit and Release XCFrameworks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.access-token || github.token }} + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + path: ${{ inputs.outputpath }} + merge-multiple: true + - name: Dry Run + if: ${{ inputs.dryRun }} + run: | + git status + - name: Commit and push XCFrameworks + if: ${{ !inputs.dryRun }} + uses: EndBug/add-and-commit@v9 + with: + add: "*.xcframework" + message: Create XCFrameworks for release ${{ inputs.version }} + tag: '${{ inputs.version }} --force' + tag_push: '--force' + github_token: ${{ secrets.access-token || github.token }} + author_name: ${{ inputs.user || github.actor }} + author_email: ${{ inputs.user || github.actor }}@users.noreply.github.com + - name: Create Release + uses: softprops/action-gh-release@v1 + if: ${{ !inputs.dryRun }} + with: + tag_name: ${{ inputs.version }} + generate_release_notes: true + fail_on_unmatched_files: true + files: | + ${{ inputs.outputpath }}/*.xcframework diff --git a/.github/workflows/xcframework.yml b/.github/workflows/xcframework.yml index 1f581dd..c7512a9 100644 --- a/.github/workflows/xcframework.yml +++ b/.github/workflows/xcframework.yml @@ -15,8 +15,8 @@ on: description: 'The path of the Xcode Workspace file (including the file extension).' type: string required: true - xcFrameworkNames: - description: 'A JSON-based collection of framework names to be built and included in the XCFramework.' + 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 scheme: @@ -61,30 +61,24 @@ on: access-token: description: 'GitHub Personal Access Token (PAT) if the to-be-commited-to branch is protected and needs a specific access token to push commits to the branch' required: false - - + + jobs: - build-xcarchives: - name: Build XCArchives - strategy: - matrix: - framework: ${{ fromJson(inputs.frameworkNames) }} + build-xcarchive: + name: Build XCArchive uses: StanfordBDHG/.github/.github/workflows/archive.yml@v2 with: workspaceFile: ${{ inputs.workspaceFile }} - xcArchiveName: ${{ matrix.framework }} + xcArchiveName: ${{ inputs.xcFrameworkName }} scheme: ${{ inputs.scheme }} version: ${{ inputs.version }} configuration: ${{ inputs.configuration }} runsonlabels: ${{ inputs.runsonlabels }} sdk: ${{ inputs.sdk }} - build-xcframeworks: - name: Build XCFrameworks + create-xcframework-and-release: + name: Build XCFramework runs-on: ${{ fromJson(inputs.runsonlabels) }} - needs: build-xcarchives - strategy: - matrix: - framework: ${{ fromJson(inputs.frameworkNames) }} + needs: build-xcarchive steps: - uses: actions/checkout@v4 with: @@ -103,7 +97,7 @@ jobs: merge-multiple: true - name: Unpack XCArchives and create XCFramework run: | - rm -rf ${{ matrix.framework }}.xcframework + rm -rf ${{ inputs.xcFrameworkName }}.xcframework # Convert JSON array to space-separated string SDK_LIST="${{ inputs.sdk }}" @@ -114,9 +108,9 @@ jobs: FRAMEWORKS_ARGS="" for SDK in "${SDKS[@]}"; do # Unpack the XCArchive - tar -zxvf ./.build/${{ matrix.framework }}-${SDK}.xcarchive.tar.gz -C ./.build/ + tar -zxvf ./.build/${{ inputs.xcFrameworkName }}-${SDK}.xcarchive.tar.gz -C ./.build/ # Specify the path to the framework within the XCArchive - ARCHIVE_PATH="./.build/${{ matrix.framework }}-${SDK}.xcarchive/Products/Library/Frameworks/${{ matrix.framework }}.framework" + ARCHIVE_PATH="./.build/${{ inputs.xcFrameworkName }}-${SDK}.xcarchive/Products/Library/Frameworks/${{ inputs.xcFrameworkName }}.framework" echo "Checking archive path: $ARCHIVE_PATH" if [ -d "$ARCHIVE_PATH" ]; then FRAMEWORKS_ARGS+="-framework $ARCHIVE_PATH " @@ -130,44 +124,14 @@ jobs: FRAMEWORKS_ARGS=$(echo "$FRAMEWORKS_ARGS" | xargs) echo "Executing xcodebuild with args: $FRAMEWORKS_ARGS" - xcodebuild -create-xcframework $FRAMEWORKS_ARGS -output ${{ matrix.framework }}.xcframework | xcbeautify || { echo "xcodebuild failed"; exit 1; } + xcodebuild -create-xcframework $FRAMEWORKS_ARGS -output ${{ inputs.xcFrameworkName }}.xcframework | xcbeautify || { echo "xcodebuild failed"; exit 1; } rm -rf .build + - name: Create Artifacts + run: | + tar -zcvf ${{ inputs.xcFrameworkName }}.xcframework.tar.gz ${{ inputs.xcFrameworkName }}.xcframework - name: Upload Artifact uses: actions/upload-artifact@v4 with: - name: ${{ matrix.framework }}.xcframework - path: ${{ matrix.framework }}.xcframework - - commit-and-release: - name: Commit and Release XCFrameworks - runs-on: ${{ fromJson(inputs.runsonlabels) }} - needs: build-xcframeworks - steps: - - uses: actions/checkout@v4 - with: - token: ${{ secrets.access-token || github.token }} - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - path: ./ - merge-multiple: true - - name: Commit and push XCFrameworks - uses: EndBug/add-and-commit@v9 - with: - add: "*.xcframework" - message: Create XCFrameworks for release ${{ inputs.version }} - tag: '${{ inputs.version }} --force' - tag_push: '--force' - github_token: ${{ secrets.access-token || github.token }} - author_name: ${{ inputs.user || github.actor }} - author_email: ${{ inputs.user || github.actor }}@users.noreply.github.com - - name: Create Release - uses: softprops/action-gh-release@v1 - if: ${{ !inputs.dryRun }} - with: - tag_name: ${{ inputs.version }} - generate_release_notes: true - fail_on_unmatched_files: true - files: | - *.xcframework + name: ${{ inputs.xcFrameworkName }}.xcframework.tar.gz + path: ${{ inputs.xcFrameworkName }}.xcframework.tar.gz From 80ece07f54164166c183dae49495c65a31592812 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Sat, 18 May 2024 16:17:08 -0700 Subject: [PATCH 3/8] Update Setup --- .github/workflows/xcframework-commit-and-release.yml | 4 +++- .github/workflows/xcframework.yml | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/xcframework-commit-and-release.yml b/.github/workflows/xcframework-commit-and-release.yml index 41910e5..06f0162 100644 --- a/.github/workflows/xcframework-commit-and-release.yml +++ b/.github/workflows/xcframework-commit-and-release.yml @@ -36,7 +36,6 @@ on: description: 'GitHub Personal Access Token (PAT) if the to-be-commited-to branch is protected and needs a specific access token to push commits to the branch' required: false - jobs: xcframework-commit-and-release: name: Commit and Release XCFrameworks @@ -50,6 +49,9 @@ jobs: with: path: ${{ inputs.outputpath }} merge-multiple: true + - name: Untar XCFrameworks + run: | + find ${{ inputs.outputpath }} -name "*.tar.gz" -exec tar -zxvf {} -C ${{ inputs.outputpath }} \; - name: Dry Run if: ${{ inputs.dryRun }} run: | diff --git a/.github/workflows/xcframework.yml b/.github/workflows/xcframework.yml index c7512a9..1f48d7c 100644 --- a/.github/workflows/xcframework.yml +++ b/.github/workflows/xcframework.yml @@ -6,7 +6,7 @@ # SPDX-License-Identifier: MIT # -name: Create XCFramework and Release +name: Create XCFramework on: workflow_call: @@ -62,7 +62,6 @@ on: description: 'GitHub Personal Access Token (PAT) if the to-be-commited-to branch is protected and needs a specific access token to push commits to the branch' required: false - jobs: build-xcarchive: name: Build XCArchive @@ -75,7 +74,7 @@ jobs: configuration: ${{ inputs.configuration }} runsonlabels: ${{ inputs.runsonlabels }} sdk: ${{ inputs.sdk }} - create-xcframework-and-release: + create-xcframework: name: Build XCFramework runs-on: ${{ fromJson(inputs.runsonlabels) }} needs: build-xcarchive From e7110a3544359a604eaf2a743bfc79fc205802c5 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Sat, 18 May 2024 16:26:07 -0700 Subject: [PATCH 4/8] Improve Arguments --- .github/workflows/xcframework-commit-and-release.yml | 7 +------ .github/workflows/xcframework.yml | 5 ----- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/xcframework-commit-and-release.yml b/.github/workflows/xcframework-commit-and-release.yml index 06f0162..c3db9a8 100644 --- a/.github/workflows/xcframework-commit-and-release.yml +++ b/.github/workflows/xcframework-commit-and-release.yml @@ -11,16 +11,11 @@ name: Commit and Release XCFrameworks on: workflow_call: inputs: - dryRun: + dryrun: description: 'If true, the workflow will not commit and release the built XCFramework.' type: boolean required: false default: false - sdk: - description: 'JSON-based collection of SDK for the exported framework. Defaults to all SDKs. You can list SDKs using `xcodebuild -showsdks`.' - type: string - required: false - default: '["iphoneos", "iphonesimulator", "macosx", "appletvos", "appletvsimulator", "xros", "xrsimulator", "watchos", "watchsimulator"]' outputpath: description: 'Optional Prefix for the output path' type: string diff --git a/.github/workflows/xcframework.yml b/.github/workflows/xcframework.yml index 1f48d7c..9035b96 100644 --- a/.github/workflows/xcframework.yml +++ b/.github/workflows/xcframework.yml @@ -32,11 +32,6 @@ on: type: string required: false default: 'Release' - dryRun: - description: 'If true, the workflow will not commit and release the built XCFramework.' - type: boolean - required: false - default: false runsonlabels: description: 'JSON-based collection of labels indicating which type of github runner should be chosen.' type: string From a091cbafa5fa62af109dda7775d161431587b2a4 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Sat, 18 May 2024 16:38:10 -0700 Subject: [PATCH 5/8] Update Setup --- .../xcframework-commit-and-release.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/xcframework-commit-and-release.yml b/.github/workflows/xcframework-commit-and-release.yml index c3db9a8..4f65eff 100644 --- a/.github/workflows/xcframework-commit-and-release.yml +++ b/.github/workflows/xcframework-commit-and-release.yml @@ -39,23 +39,26 @@ jobs: - uses: actions/checkout@v4 with: token: ${{ secrets.access-token || github.token }} - - name: Download Artifacts + - name: Download Artifacts to Temp Directory uses: actions/download-artifact@v4 with: - path: ${{ inputs.outputpath }} + path: ./.build merge-multiple: true - name: Untar XCFrameworks run: | - find ${{ inputs.outputpath }} -name "*.tar.gz" -exec tar -zxvf {} -C ${{ inputs.outputpath }} \; + mkdir -p ${{ inputs.outputpath }} + find ./.build -name "*.tar.gz" -exec tar -zxvf {} -C ./.build \; + find ./.build -name "*.xcframework" -exec mv {} ${{ inputs.outputpath }} \; - name: Dry Run - if: ${{ inputs.dryRun }} + if: ${{ inputs.dryrun }} run: | + git add ${{ inputs.outputpath }}/*.xcframework git status - name: Commit and push XCFrameworks - if: ${{ !inputs.dryRun }} + if: ${{ !inputs.dryrun }} uses: EndBug/add-and-commit@v9 with: - add: "*.xcframework" + add: '${{ inputs.outputpath }}/*.xcframework' message: Create XCFrameworks for release ${{ inputs.version }} tag: '${{ inputs.version }} --force' tag_push: '--force' @@ -64,7 +67,7 @@ jobs: author_email: ${{ inputs.user || github.actor }}@users.noreply.github.com - name: Create Release uses: softprops/action-gh-release@v1 - if: ${{ !inputs.dryRun }} + if: ${{ !inputs.dryrun }} with: tag_name: ${{ inputs.version }} generate_release_notes: true From 824d08893c7e4b5a632f61cbb1b6a5318c851ddb Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Sat, 18 May 2024 16:48:46 -0700 Subject: [PATCH 6/8] Update Setup --- .github/workflows/archive.yml | 3 ++- .github/workflows/xcframework-commit-and-release.yml | 2 +- .github/workflows/xcframework.yml | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/archive.yml b/.github/workflows/archive.yml index 38d6eae..e376a80 100644 --- a/.github/workflows/archive.yml +++ b/.github/workflows/archive.yml @@ -26,7 +26,8 @@ on: version: description: 'The version number of the XCFramework embedded in the XCArchives.' type: string - required: true + required: false + default: 'ci' configuration: description: 'The build configuration to use when archiving the scheme, either Debug or Release.' type: string diff --git a/.github/workflows/xcframework-commit-and-release.yml b/.github/workflows/xcframework-commit-and-release.yml index 4f65eff..bb01b87 100644 --- a/.github/workflows/xcframework-commit-and-release.yml +++ b/.github/workflows/xcframework-commit-and-release.yml @@ -48,7 +48,7 @@ jobs: run: | mkdir -p ${{ inputs.outputpath }} find ./.build -name "*.tar.gz" -exec tar -zxvf {} -C ./.build \; - find ./.build -name "*.xcframework" -exec mv {} ${{ inputs.outputpath }} \; + find ./temp -name "*.xcframework" -exec sh -c 'rm -rf ${{ inputs.outputpath }}/${0##*/} && mv "$0" ${{ inputs.outputpath }}' {} \; - name: Dry Run if: ${{ inputs.dryrun }} run: | diff --git a/.github/workflows/xcframework.yml b/.github/workflows/xcframework.yml index 9035b96..d019b23 100644 --- a/.github/workflows/xcframework.yml +++ b/.github/workflows/xcframework.yml @@ -26,7 +26,8 @@ on: version: 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 + required: false + default: 'ci' configuration: description: 'The build configuration to use when archiving the scheme, either Debug or Release.' type: string From ab9b534c0649e9e46eb060787b2e0f870ac9cc20 Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Sat, 18 May 2024 16:54:00 -0700 Subject: [PATCH 7/8] Update Setup --- .github/workflows/xcframework-commit-and-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/xcframework-commit-and-release.yml b/.github/workflows/xcframework-commit-and-release.yml index bb01b87..7c027af 100644 --- a/.github/workflows/xcframework-commit-and-release.yml +++ b/.github/workflows/xcframework-commit-and-release.yml @@ -48,7 +48,7 @@ jobs: run: | mkdir -p ${{ inputs.outputpath }} find ./.build -name "*.tar.gz" -exec tar -zxvf {} -C ./.build \; - find ./temp -name "*.xcframework" -exec sh -c 'rm -rf ${{ inputs.outputpath }}/${0##*/} && mv "$0" ${{ inputs.outputpath }}' {} \; + find ./.build -name "*.xcframework" -exec sh -c 'rm -rf ${{ inputs.outputpath }}/${0##*/} && mv "$0" ${{ inputs.outputpath }}' {} \; - name: Dry Run if: ${{ inputs.dryrun }} run: | From fbd3b17b7f7b7a7277f0b1f50e7bc4275e53ee9f Mon Sep 17 00:00:00 2001 From: Paul Schmiedmayer Date: Sat, 18 May 2024 17:19:14 -0700 Subject: [PATCH 8/8] Update --- .github/workflows/xcframework-commit-and-release.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/xcframework-commit-and-release.yml b/.github/workflows/xcframework-commit-and-release.yml index 7c027af..cd9e376 100644 --- a/.github/workflows/xcframework-commit-and-release.yml +++ b/.github/workflows/xcframework-commit-and-release.yml @@ -28,7 +28,7 @@ on: default: '' secrets: access-token: - description: 'GitHub Personal Access Token (PAT) if the to-be-commited-to branch is protected and needs a specific access token to push commits to the branch' + description: 'GitHub Personal Access Token (PAT) if the to-be-committed-to branch is protected and needs a specific access token to push commits to the branch' required: false jobs: @@ -39,7 +39,7 @@ jobs: - uses: actions/checkout@v4 with: token: ${{ secrets.access-token || github.token }} - - name: Download Artifacts to Temp Directory + - name: Download Artifacts uses: actions/download-artifact@v4 with: path: ./.build @@ -48,7 +48,10 @@ jobs: run: | mkdir -p ${{ inputs.outputpath }} find ./.build -name "*.tar.gz" -exec tar -zxvf {} -C ./.build \; - find ./.build -name "*.xcframework" -exec sh -c 'rm -rf ${{ inputs.outputpath }}/${0##*/} && mv "$0" ${{ inputs.outputpath }}' {} \; + for xcframework in $(find ./.build -name "*.xcframework"); do + rm -rf ${{ inputs.outputpath }}/$(basename "$xcframework") + mv "$xcframework" ${{ inputs.outputpath }} + done - name: Dry Run if: ${{ inputs.dryrun }} run: |