Skip to content

add: create xcframework workflow#15

Closed
minjae999 wants to merge 1 commit intomainfrom
feature/create_xcframework
Closed

add: create xcframework workflow#15
minjae999 wants to merge 1 commit intomainfrom
feature/create_xcframework

Conversation

@minjae999
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Aug 26, 2025

Walkthrough

새 GitHub Actions 워크플로우 .github/workflows/create-release.yml가 추가되어, 메인 브랜치 대상 PR 이벤트에서 레이블 검사 후 create 레이블이 있을 때만 XCFramework 생성 작업을 수행하도록 구성되었습니다.

Changes

Cohort / File(s) Change Summary
Release 워크플로우 추가
\.github/workflows/create-release.yml``
PR 이벤트(opened, labeled, synchronize) 트리거, check-label 잡에서 GitHub API+jq로 create 레이블 존재 여부를 출력으로 제공, 조건부로 create_release 잡(macos) 실행, unsignedapps/swift-create-xcframework@v2 액션으로 XCFramework 생성

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant PR as PR Event (opened/labeled/synchronize)
    participant JL as Job: check-label (ubuntu)
    participant GH as GitHub REST API
    participant JR as Job: create_release (macOS)
    participant XC as Action: swift-create-xcframework

    PR->>JL: 워크플로우 트리거
    JL->>GH: PR 라벨 조회 (GITHUB_TOKEN)
    GH-->>JL: 라벨 목록(JSON)
    JL->>JL: jq로 'create' 라벨 여부 판별
    note right of JL: output has_label = true/false

    alt has_label == 'true'
        JL-->>JR: needs.check-label.outputs.has_label = 'true'
        PR->>JR: 조건 만족 시 잡 실행
        JR->>XC: XCFramework 생성 액션 실행
        XC-->>JR: 생성 완료
    else has_label != 'true'
        JL-->>JR: 조건 불충족
        PR--xJR: 잡 미실행(스킵)
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

깃허브 별 아래 폴짝, 레이블을 살짝 견줘보니
"create"라 쓰였구나—이제는 출발할 때지!
맥에서 톱니가 윙, XCFramework 딱-하고
당근 깃털 깃든 패키지, 릴리스로 점프!
폴짝폴짝 PR 길 위에, 버전의 달이 뜬다 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/create_xcframework

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/create-release.yml (1)

29-37: 생성된 XCFramework 산출물 보존(artifact 업로드) 누락

현재 워크플로우는 XCFramework를 만들기만 하고 산출물을 어디에도 업로드하지 않습니다. 리뷰어나 CI 소비를 위해 artifact 업로드 단계를 추가하세요.

아래는 일반적인 예시입니다. 실제 경로는 액션 출력물에 맞춰 조정하세요.

       - name: Create XCFramework
         uses: unsignedapps/swift-create-xcframework@v2
+      - name: Upload XCFramework artifact
+        uses: actions/upload-artifact@v4
+        with:
+          name: xcframework-${{ github.sha }}
+          path: |
+            **/*.xcframework
+          if-no-files-found: error
🧹 Nitpick comments (7)
.github/workflows/create-release.yml (7)

1-1: 워크플로우 이름이 동작과 불일치

워크플로우 이름이 "Create Release"이지만 실제로는 GitHub Release를 생성하지 않습니다. 오해를 줄이기 위해 이름을 "Create XCFramework" 등으로 바꾸는 것을 권장합니다.

-name: Create Release
+name: Create XCFramework

3-8: 트리거 보완 제안: unlabeled/ready_for_review, paths 필터

  • 라벨 제거 시 재평가하려면 unlabeled 타입을 추가하는 것이 유용합니다.
  • 리뷰 전 환수 시 동작하려면 ready_for_review도 고려하세요.
  • iOS/Swift 관련 파일 변경에만 빌드하도록 paths 필터를 추가하면 러너 낭비를 줄일 수 있습니다.

예시:

 on:
   pull_request:
-    types: [opened, labeled, synchronize]
+    types: [opened, labeled, unlabeled, synchronize, reopened, ready_for_review]
     branches:
       - main
+    paths:
+      - 'Sources/**'
+      - 'Package.swift'
+      - '**/*.xcodeproj/**'
+      - '**/*.xcworkspace/**'
+      - '.github/workflows/create-release.yml'

3-9: 최소 권한 원칙 적용을 위한 permissions 블록 추가

API 호출 및 체크아웃에 필요한 권한만 부여하도록 명시하면 보안을 강화할 수 있습니다. 이 워크플로우는 쓰기 권한이 필요 없어 보입니다.

 name: Create XCFramework
 
 on:
   pull_request:
@@
   - main
+
+permissions:
+  contents: read
+  pull-requests: read
+  issues: read

29-33: 라벨 기반 조건을 더 간결하게 구성 가능한 대안

현재는 별도 check-label 잡과 API 호출로 라벨 여부를 판별합니다. GitHub 이벤트 페이로드의 라벨 배열을 직접 활용하면 잡을 하나로 줄일 수 있습니다.

예시(단일 잡 패턴):

-jobs:
-  check-label:
-    runs-on: ubuntu-latest
-    outputs:
-      has_label: ${{ steps.label-check.outputs.has_label }}
-    steps:
-      ...
-
-  create_release:
-    needs: check-label
-    if: needs.check-label.outputs.has_label == 'true'
+jobs:
+  create_release:
+    if: contains(github.event.pull_request.labels.*.name, 'create')
     runs-on: macos-latest
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
       - name: Create XCFramework
         uses: unsignedapps/swift-create-xcframework@v2
+      - name: Upload XCFramework artifact
+        uses: actions/upload-artifact@v4
+        with:
+          name: xcframework-${{ github.sha }}
+          path: '**/*.xcframework'

참고: 조건식의 contains(array, 'create')는 정확 매칭으로 동작합니다.


32-36: 러너/도구 버전 고정 및 실행 안정성 개선

  • macos-latest는 시점에 따라 Xcode 버전이 변동합니다. 해당 액션이 특정 Xcode/Swift 버전에 의존한다면 러너 버전을 명시하거나 Xcode 셀렉션을 추가하세요.
  • 필요 시 DerivedData 캐시나 CODE_SIGNING_ALLOWED=NO 환경 설정으로 재현성과 속도를 높일 수 있습니다.

예시:

-    runs-on: macos-latest
+    runs-on: macos-14
     steps:
       - uses: actions/checkout@v4
+      - name: Select Xcode
+        run: sudo xcode-select -s "/Applications/Xcode_15.4.app"
+      - name: Create XCFramework
+        env:
+          CODE_SIGNING_ALLOWED: "NO"
         uses: unsignedapps/swift-create-xcframework@v2

(실제 설치된 Xcode 버전은 러너 이미지 릴리스 노트를 확인하여 맞춰 주세요.)


29-37: 산출물 경로/스킴 등 액션 입력값 검증 필요

unsignedapps/swift-create-xcframework@v2는 기본값만으로 성공하려면 프로젝트 구조가 전제됩니다. 스킴, 패키지/프로젝트 경로, 대상 플랫폼 등을 입력으로 명시하는지 확인하세요. 실패 시 명시적 입력을 추가하세요.

필요하시면 해당 액션의 입력 파라미터(예: project, scheme, output-path, platforms)에 맞춰 구체 설정을 제안드릴 수 있습니다. 현재 리포지토리의 실제 스킴/타깃명을 알려주시면 바로 패치 드리겠습니다.


3-8: 동시 실행(중복 빌드) 방지

PR에서 커밋을 연속 푸시하면 이전 빌드를 취소하도록 concurrency를 추가하는 것을 권장합니다.

 on:
   pull_request:
@@
   - main
+
+concurrency:
+  group: create-xcframework-${{ github.event.pull_request.number }}
+  cancel-in-progress: true
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e894bb4 and 2b734da.

📒 Files selected for processing (1)
  • .github/workflows/create-release.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/create-release.yml

17-17: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


17-17: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


34-34: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: task-list-completed

Comment on lines +15 to +27
- name: Check for 'create' label
id: label-check
run: |
labels=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" \
| jq -r '.[].name')
if echo "$labels" | grep -q 'create'; then
echo "Label 'create' found."
echo "::set-output name=has_label::true"
else
echo "Label 'create' not found."
echo "::set-output name=has_label::false"
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Deprecated set-output 사용 및 라벨 매칭 방식 개선 필요

  • GitHub Actions의 ::set-output은 더 이상 지원되지 않습니다. $GITHUB_OUTPUT 파일에 쓰는 방식으로 교체하세요.
  • grep -q 'create'는 부분 일치(예: recreate)에도 매칭됩니다. jq로 정확히 "create" 라벨 존재 여부를 판별하는 편이 안전합니다.
  • 토큰 헤더는 Authorization: Bearer 형태가 최신 권장 사항이며, ${{ github.token }}env로 주입해 사용하는 편이 간결합니다.

아래 diff를 적용해 주세요.

       - name: Check for 'create' label
         id: label-check
-        run: |
-          labels=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-            "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" \
-            | jq -r '.[].name')
-          if echo "$labels" | grep -q 'create'; then
-            echo "Label 'create' found."
-            echo "::set-output name=has_label::true"
-          else
-            echo "Label 'create' not found."
-            echo "::set-output name=has_label::false"
-          fi
+        env:
+          GITHUB_TOKEN: ${{ github.token }}
+        run: |
+          resp="$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
+            "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels")"
+          if echo "$resp" | jq -e '.[] | select(.name=="create")' > /dev/null; then
+            echo "Label 'create' found."
+            echo "has_label=true" >> "$GITHUB_OUTPUT"
+          else
+            echo "Label 'create' not found."
+            echo "has_label=false" >> "$GITHUB_OUTPUT"
+          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Check for 'create' label
id: label-check
run: |
labels=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" \
| jq -r '.[].name')
if echo "$labels" | grep -q 'create'; then
echo "Label 'create' found."
echo "::set-output name=has_label::true"
else
echo "Label 'create' not found."
echo "::set-output name=has_label::false"
fi
- name: Check for 'create' label
id: label-check
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
resp="$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels")"
if echo "$resp" | jq -e '.[] | select(.name=="create")' > /dev/null; then
echo "Label 'create' found."
echo "has_label=true" >> "$GITHUB_OUTPUT"
else
echo "Label 'create' not found."
echo "has_label=false" >> "$GITHUB_OUTPUT"
fi
🧰 Tools
🪛 actionlint (1.7.7)

17-17: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)


17-17: workflow command "set-output" was deprecated. use echo "{name}={value}" >> $GITHUB_OUTPUT instead: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions

(deprecated-commands)

🤖 Prompt for AI Agents
In .github/workflows/create-release.yml around lines 15 to 27, replace the
deprecated ::set-output usage and loose grep check: read the GitHub token from
env and use an Authorization: Bearer header, fetch labels, use jq to test for
exact equality to "create" (not substring), and write the result to
$GITHUB_OUTPUT (e.g. append "has_label=true" or "has_label=false" to that file)
instead of using ::set-output; ensure the curl uses the env-injected token
variable for clarity and security.

if: needs.check-label.outputs.has_label == 'true'
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

actions/checkout 버전 업데이트 필요 (@v2@v4)

actions/checkout@v2 는 최신 러너에서 비호환 문제가 있으며 보안/성능 측면에서도 구버전입니다. @v4로 올려주세요.

-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@v2
- uses: actions/checkout@v4
🧰 Tools
🪛 actionlint (1.7.7)

34-34: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
.github/workflows/create-release.yml around line 34: the workflow is using
actions/checkout@v2 which is outdated; update the step to use
actions/checkout@v4 by changing the uses reference to @v4, verify any option
keys (e.g., fetch-depth or token) remain compatible with v4, run the workflow or
a linting action to ensure no breakages, and commit the change.

@minjae999 minjae999 closed this Dec 15, 2025
@minjae999 minjae999 deleted the feature/create_xcframework branch December 15, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant