-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Improve XCFramework Creation ## ⚙️ Release Notes - Improve XCFramework Creation ### 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).
- Loading branch information
1 parent
8cee273
commit 1ec21f3
Showing
3 changed files
with
86 additions
and
30 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
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,79 @@ | ||
# | ||
# 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 | ||
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-committed-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: ./.build | ||
merge-multiple: true | ||
- name: Untar XCFrameworks | ||
run: | | ||
mkdir -p ${{ inputs.outputpath }} | ||
find ./.build -name "*.tar.gz" -exec tar -zxvf {} -C ./.build \; | ||
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: | | ||
git add ${{ inputs.outputpath }}/*.xcframework | ||
git status | ||
- name: Commit and push XCFrameworks | ||
if: ${{ !inputs.dryrun }} | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: '${{ inputs.outputpath }}/*.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 |
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