-
Notifications
You must be signed in to change notification settings - Fork 0
Fix CI workflow issues flagged in Copilot review of PR #12 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
eb65e20
Fix all Copilot review issues in GitHub Actions workflows from PR #12
Copilot c9e5246
Fix: replace -derivedDataPath with SYMROOT= in xcodebuild commands
Copilot 967d770
Update .github/workflows/build-and-release.yml
kiyarose 0eb632c
Update .github/workflows/prerelease.yml
kiyarose 7be08a7
Update .github/workflows/build-and-release.yml
kiyarose 0a0cf7f
Fix iOS linker error: set SDKROOT=iphoneos and clean macOS-specific t…
Copilot 44494d5
style: format code with PHP CS Fixer, StandardJS and swift-format
deepsource-autofix[bot] 7133f17
Plan: sync build-and-release.yml with prerelease.yml and add duplicat…
Copilot 399964b
Sync build-and-release.yml with prerelease.yml and add duplicate-tag …
Copilot 65d9c8d
Fix xcodebuild archive -target incompatibility in iOS build steps
Copilot b5f63e0
Package iOS CI build as Flean.ipa instead of Flean-iOS.app.zip
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,169 @@ | ||
| name: Build & Release iOS and macOS Extensions | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - '**.swift' | ||
| - 'ios/**' | ||
| - 'mos/**' | ||
| - '.github/workflows/build-and-release.yml' | ||
| workflow_dispatch: | ||
| inputs: | ||
| draft: | ||
| description: 'Create as draft (for testing)' | ||
| required: true | ||
| default: 'true' | ||
| type: choice | ||
| options: | ||
| - 'true' | ||
| - 'false' | ||
|
|
||
| jobs: | ||
| check-version: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| version: ${{ steps.extract.outputs.version }} | ||
| tag_exists: ${{ steps.check_tag.outputs.exists }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| fetch-tags: true | ||
|
|
||
| - name: Extract version from Xcode project | ||
| id: extract | ||
| run: | | ||
| VERSION=$(grep -m1 'MARKETING_VERSION = ' ios/Flean.xcodeproj/project.pbxproj | awk -F ' = ' '{ gsub(/;/,"",$2); print $2; exit }') | ||
| echo "version=v$VERSION" >> $GITHUB_OUTPUT | ||
| echo "Detected version: v$VERSION" | ||
|
|
||
| - name: Check if tag exists | ||
| id: check_tag | ||
| run: | | ||
| if git ls-remote --tags --exit-code origin "refs/tags/${{ steps.extract.outputs.version }}" >/dev/null 2>&1; then | ||
| echo "exists=true" >> $GITHUB_OUTPUT | ||
| echo "Tag already exists!" | ||
| else | ||
| echo "exists=false" >> $GITHUB_OUTPUT | ||
| echo "Tag does not exist - ready to build" | ||
| fi | ||
|
|
||
| build-and-release: | ||
| needs: check-version | ||
| if: needs.check-version.outputs.tag_exists == 'false' | ||
| runs-on: macos-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| # iOS Build | ||
| - name: Build iOS App | ||
| run: | | ||
| cd ios | ||
| mkdir -p build | ||
|
|
||
| xcodebuild build \ | ||
| -project Flean.xcodeproj \ | ||
| -target Flean \ | ||
| -configuration Release \ | ||
| -destination 'generic/platform=iOS' \ | ||
| -skipPackagePluginValidation \ | ||
| SYMROOT=build \ | ||
| CODE_SIGN_IDENTITY="" \ | ||
| CODE_SIGNING_REQUIRED=NO \ | ||
| CODE_SIGN_ENTITLEMENTS="" | ||
|
|
||
| # Package the .app as a proper IPA (Payload/Flean.app zipped) | ||
| APP_PATH=$(find build -name "Flean.app" -type d | head -1) | ||
| if [ -z "$APP_PATH" ]; then | ||
| echo "❌ Flean.app not found" | ||
| exit 1 | ||
| fi | ||
| mkdir -p build/ipa/Payload | ||
| cp -r "$APP_PATH" build/ipa/Payload/ | ||
| ( cd build/ipa && zip -r ../Flean.ipa Payload ) | ||
| echo "✅ iOS build succeeded" | ||
|
|
||
| # macOS Build | ||
| - name: Build macOS App | ||
| run: | | ||
| cd mos | ||
| mkdir -p build | ||
|
|
||
| xcodebuild build \ | ||
| -project Flean.xcodeproj \ | ||
| -target Flean \ | ||
| -configuration Release \ | ||
| -skipPackagePluginValidation \ | ||
| SYMROOT=build \ | ||
| CODE_SIGN_IDENTITY="" \ | ||
| CODE_SIGNING_REQUIRED=NO \ | ||
| CODE_SIGN_ENTITLEMENTS="" | ||
|
|
||
| # Find and zip the .app into a fixed location matching the upload step | ||
| APP_PATH=$(find build -name "Flean.app" -type d | head -1) | ||
| if [ -z "$APP_PATH" ]; then | ||
| echo "❌ Flean.app not found" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Create a zip whose top-level entry is Flean.app | ||
| OUT_ZIP="$(pwd)/build/Flean.app.zip" | ||
| APP_DIR="$(dirname "$APP_PATH")" | ||
| APP_NAME="$(basename "$APP_PATH")" | ||
| ( cd "$APP_DIR" && zip -r "$OUT_ZIP" "$APP_NAME" ) | ||
| echo "✅ macOS build succeeded" | ||
|
|
||
| # Create tag | ||
| - name: Create Git Tag | ||
| run: | | ||
| git config user.name "github-actions" | ||
| git config user.email "github-actions@github.com" | ||
| VERSION="${{ needs.check-version.outputs.version }}" | ||
| # Create local tag (no-op if already exists locally from a shallow clone) | ||
| git tag "$VERSION" 2>/dev/null || echo "Local tag $VERSION already exists, proceeding with push" | ||
| # Push to remote; fail clearly if the tag was created by a concurrent run | ||
| if ! git push origin "$VERSION"; then | ||
| echo "::error::Tag $VERSION already exists on remote. A release for this version may already exist." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Create Release | ||
| - name: Create Release | ||
| uses: actions/create-release@v1 | ||
| id: create_release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: ${{ needs.check-version.outputs.version }} | ||
| release_name: "Flean ${{ needs.check-version.outputs.version }}" | ||
| draft: ${{ github.event.inputs.draft == 'true' }} | ||
| prerelease: false | ||
|
|
||
| # Upload iOS App | ||
| - name: Upload iOS App | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
| asset_path: ./ios/build/Flean.ipa | ||
| asset_name: Flean.ipa | ||
| asset_content_type: application/octet-stream | ||
|
|
||
| # Upload macOS App | ||
| - name: Upload macOS App | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
| asset_path: ./mos/build/Flean.app.zip | ||
| asset_name: Flean.app.zip | ||
| asset_content_type: application/zip |
This file contains hidden or 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,122 @@ | ||
| name: Create Prerelease on PR Ready | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| types: | ||
| - ready_for_review | ||
| paths: | ||
| - '.github/workflows/**' | ||
| - '**.swift' | ||
| - 'ios/**' | ||
| - 'mos/**' | ||
|
|
||
| jobs: | ||
| create-prerelease: | ||
| runs-on: macos-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Extract version from Xcode project | ||
| id: extract | ||
| run: | | ||
| VERSION=$(grep -m1 'MARKETING_VERSION = ' ios/Flean.xcodeproj/project.pbxproj | awk -F ' = ' '{ gsub(/;/,"",$2); print $2; exit }') | ||
| echo "version=v$VERSION" >> $GITHUB_OUTPUT | ||
| echo "Detected version: v$VERSION" | ||
|
|
||
| - name: Build iOS | ||
| run: | | ||
| cd ios | ||
| mkdir -p build | ||
|
|
||
| xcodebuild build \ | ||
| -project Flean.xcodeproj \ | ||
| -target Flean \ | ||
| -configuration Release \ | ||
| -destination 'generic/platform=iOS' \ | ||
| -skipPackagePluginValidation \ | ||
| SYMROOT=build \ | ||
| CODE_SIGN_IDENTITY="" \ | ||
| CODE_SIGNING_REQUIRED=NO \ | ||
| CODE_SIGN_ENTITLEMENTS="" | ||
|
|
||
| # Package the .app as a proper IPA (Payload/Flean.app zipped) | ||
| APP_PATH=$(find build -name "Flean.app" -type d | head -1) | ||
| if [ -z "$APP_PATH" ]; then | ||
| echo "❌ Flean.app not found" | ||
| exit 1 | ||
| fi | ||
| mkdir -p build/ipa/Payload | ||
| cp -r "$APP_PATH" build/ipa/Payload/ | ||
| ( cd build/ipa && zip -r ../Flean.ipa Payload ) | ||
| echo "✅ iOS build succeeded" | ||
|
|
||
| - name: Build macOS | ||
| run: | | ||
| cd mos | ||
| mkdir -p build | ||
|
|
||
| xcodebuild build \ | ||
| -project Flean.xcodeproj \ | ||
| -target Flean \ | ||
| -configuration Release \ | ||
| -skipPackagePluginValidation \ | ||
| SYMROOT=build \ | ||
| CODE_SIGN_IDENTITY="" \ | ||
| CODE_SIGNING_REQUIRED=NO \ | ||
| CODE_SIGN_ENTITLEMENTS="" | ||
|
|
||
| # Find and zip the .app | ||
| APP_PATH=$(find build -name "Flean.app" -type d | head -1) | ||
| if [ -z "$APP_PATH" ]; then | ||
| echo "❌ Flean.app not found" | ||
| exit 1 | ||
| fi | ||
| OUT_ZIP="$(pwd)/build/Flean.app.zip" | ||
| APP_DIR="$(dirname "$APP_PATH")" | ||
| APP_NAME="$(basename "$APP_PATH")" | ||
| ( cd "$APP_DIR" && zip -r "$OUT_ZIP" "$APP_NAME" ) | ||
| echo "✅ macOS build succeeded" | ||
|
|
||
| - name: Create Prerelease | ||
| uses: actions/create-release@v1 | ||
| id: create_prerelease | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: ${{ steps.extract.outputs.version }}-prerelease-${{ github.run_number }} | ||
| release_name: "Flean ${{ steps.extract.outputs.version }} - Prerelease (PR #${{ github.event.pull_request.number }})" | ||
| body: | | ||
| 🧪 **Prerelease Build** from PR #${{ github.event.pull_request.number }} | ||
|
|
||
| **Branch:** ${{ github.event.pull_request.head.ref }} | ||
| **Author:** @${{ github.event.pull_request.user.login }} | ||
|
|
||
| This is a prerelease. Testing and feedback welcome! | ||
| draft: false | ||
| prerelease: true | ||
|
|
||
| - name: Upload iOS App | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ steps.create_prerelease.outputs.upload_url }} | ||
| asset_path: ./ios/build/Flean.ipa | ||
| asset_name: Flean.ipa | ||
| asset_content_type: application/octet-stream | ||
|
|
||
| - name: Upload macOS App | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| upload_url: ${{ steps.create_prerelease.outputs.upload_url }} | ||
| asset_path: ./mos/build/Flean.app.zip | ||
| asset_name: Flean.app.zip | ||
| asset_content_type: application/zip | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,16 +1,11 @@ | ||
| // iOS-only app entry. Guard so the file can live in the repo without | ||
| // conflicting with the macOS `@main` app in `Flean/AppDelegate.swift`. | ||
| #if os(iOS) | ||
| import SwiftUI | ||
| import WebKit | ||
|
|
||
| @main | ||
| struct FleanApp: App { | ||
| var body: some Scene { | ||
| WindowGroup { | ||
| WebViewContainer() | ||
| } | ||
| var body: some Scene { | ||
| WindowGroup { | ||
| WebViewContainer() | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.