From 838185beb5c75d56eaa77795af4fda0152ff93a7 Mon Sep 17 00:00:00 2001 From: gumob Date: Wed, 28 Aug 2024 01:28:07 +0900 Subject: [PATCH 1/6] build: Add Cocoapods trunk push and GitHub tag update to run script This commit adds support for pushing the TLDExtractSwift pod to the Cocoapods trunk and updating its version on GitHub. The changes include adding a new function `cocoapods_trunk_push` that cleans the cache, deletes the old version if it exists, and pushes the new version to the trunk. Additionally, a new function `github_update_tag` is added that retrieves the current version number from the project's build settings, checks for existing tags, deletes them if they exist, and creates a new tag with the current version number. The run script now includes these new functions in its list of options. --- run.sh | 71 +++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/run.sh b/run.sh index 7442915..cb1e91d 100755 --- a/run.sh +++ b/run.sh @@ -23,6 +23,9 @@ local option_list=( " " "Carthage - Update all platforms" "Cocoapods - Clean all cache" + "Cocoapods - Trunk push" + " " + "Github - Update tag" " " "Public Suffix List - Download latest data" ) @@ -46,14 +49,6 @@ local xcode_init() { psl_download; } -local cocoapods_clean() { - pod cache clean --all; -} - -local psl_download() { - python update-psl.py; -} - local carthage_update() { carthage update --platform macos; carthage update --platform ios; @@ -62,6 +57,61 @@ local carthage_update() { carthage update --platform visionos; } +local cocoapods_clean() { + pod cache clean --all; +} + +local cocoapods_trunk_push() { + # Enable error handling and exit the script on pipe failures + set -eo pipefail + # Retrieve the current version from the project file + current_version=$(grep -m1 'MARKETING_VERSION' 'TLDExtractSwift.xcodeproj/project.pbxproj' | sed 's/.*= //;s/;//') + echo "Current version: $current_version" + # Check if the current version is a valid semantic version + if [[ ! "$current_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: Invalid version number" + exit 1 + fi + # Check if the current version already exists in the CocoaPods trunk + if pod trunk info TLDExtractSwift | grep -q "$current_version"; then + echo "Start deleting $current_version" + # Delete the existing version from the CocoaPods trunk + echo "y" | pod trunk delete TLDExtractSwift $current_version || true + fi + echo "Start pushing $current_version" + # Push the new version to the CocoaPods trunk + pod trunk push TLDExtractSwift.podspec --allow-warnings +} + +local github_update_tag() { + # Enable error handling and exit the script on pipe failures + set -eo pipefail + # Checkout main branch + git checkout main + # Retrieve build settings and execute a command to filter MARKETING_VERSION + current_version=$(grep -m1 'MARKETING_VERSION' 'TLDExtractSwift.xcodeproj/project.pbxproj' | sed 's/.*= //;s/;//') + echo "Current version: $current_version" + # If the current version is found + if [[ $current_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + # Check if a tag for the current version already exists + if git tag -l | grep -q "$current_version"; then + # If the tag exists, delete it from both local and remote + git tag -d "$current_version" + git push origin ":refs/tags/$current_version" + fi + # Create a new tag for the current version and push it to the remote repository + git tag "$current_version" + git push origin "$current_version" + else + # If the version could not be retrieved, display an error message + echo "Error: Could not retrieve the version." + fi +} + +local psl_download() { + python update-psl.py; +} + local bundle_init() { rm -rf .bundle; rm -rf Gemfile.lock; @@ -77,9 +127,10 @@ case "$selected_option" in fastlane*) fastlane_command $selected_option;; "Xcode - Initialize project") xcode_init;; "Xcode - Clean all build cache") xcode_clean;; - "Cocoapods - Clean all cache") cocoapods_clean;; "Carthage - Update all platforms") carthage_update;; - "Public Suffix List - Download latest data") psl_download;; + "Cocoapods - Clean all cache") cocoapods_clean;; + "Cocoapods - Trunk push") cocoapods_trunk_push;; + "Github - Update tag") github_update_tag;; *) echo "Invalid option $selected_option" && exit 1;; esac From d17b4fee8fc7936f5c6e11b9b67d47166c441c58 Mon Sep 17 00:00:00 2001 From: gumob Date: Wed, 28 Aug 2024 01:30:33 +0900 Subject: [PATCH 2/6] ci(workflows/main.yml): Add error handling and exit script on pipe failures, retrieve current version from project file, check if the current version is a valid semantic version, delete existing version from CocoaPods trunk before pushing a new one This commit adds error handling to the workflow by setting `set -eo pipefail` and exiting the script on pipe failures. It also retrieves the current version from the project file, checks if it is a valid semantic version, deletes the existing version from the CocoaPods trunk before pushing a new one. This improves the reliability of the workflow by ensuring that only valid versions are pushed to the CocoaPods trunk and that errors are handled gracefully. --- .github/workflows/main.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58e5c8e..5a375f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -442,14 +442,23 @@ jobs: env: COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} run: | + # Enable error handling and exit the script on pipe failures set -eo pipefail + # Retrieve the current version from the project file current_version=$(grep -m1 'MARKETING_VERSION' 'TLDExtractSwift.xcodeproj/project.pbxproj' | sed 's/.*= //;s/;//') + echo "Current version: $current_version" + # Check if the current version is a valid semantic version if [[ ! "$current_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Error: Invalid version number" - exit 1 + echo "Error: Invalid version number" + exit 1 fi - if pod trunk info TLDExtractSwift | grep "$current_version"; then - pod trunk delete TLDExtractSwift $current_version --silent + # Check if the current version already exists in the CocoaPods trunk + if pod trunk info TLDExtractSwift | grep -q "$current_version"; then + echo "Start deleting $current_version" + # Delete the existing version from the CocoaPods trunk + echo "y" | pod trunk delete TLDExtractSwift $current_version || true fi + echo "Start pushing $current_version" + # Push the new version to the CocoaPods trunk pod trunk push TLDExtractSwift.podspec --allow-warnings needs: update_tag \ No newline at end of file From 34e57586dcc265506df4c6e0cc090ebae0b7859b Mon Sep 17 00:00:00 2001 From: gumob Date: Wed, 28 Aug 2024 10:13:10 +0900 Subject: [PATCH 3/6] build: Fix hard-coded xcodeproj name --- run.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/run.sh b/run.sh index cb1e91d..a9b450b 100755 --- a/run.sh +++ b/run.sh @@ -64,8 +64,13 @@ local cocoapods_clean() { local cocoapods_trunk_push() { # Enable error handling and exit the script on pipe failures set -eo pipefail + # Checkout main branch + git checkout main + # Find the project name and podspec name + project_name=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \;) + podspec_name=$(find . -maxdepth 1 -name "*.podspec" -exec basename {} .podspec \;) # Retrieve the current version from the project file - current_version=$(grep -m1 'MARKETING_VERSION' 'TLDExtractSwift.xcodeproj/project.pbxproj' | sed 's/.*= //;s/;//') + current_version=$(grep -m1 'MARKETING_VERSION' "${project_name}.xcodeproj/project.pbxproj" | sed 's/.*= //;s/;//') echo "Current version: $current_version" # Check if the current version is a valid semantic version if [[ ! "$current_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then @@ -73,23 +78,26 @@ local cocoapods_trunk_push() { exit 1 fi # Check if the current version already exists in the CocoaPods trunk - if pod trunk info TLDExtractSwift | grep -q "$current_version"; then + if pod trunk info ${podspec_name} | grep -q "$current_version"; then echo "Start deleting $current_version" # Delete the existing version from the CocoaPods trunk - echo "y" | pod trunk delete TLDExtractSwift $current_version || true + echo "y" | pod trunk delete ${podspec_name} $current_version || true fi echo "Start pushing $current_version" # Push the new version to the CocoaPods trunk - pod trunk push TLDExtractSwift.podspec --allow-warnings + pod trunk push ${podspec_name}.podspec --allow-warnings } local github_update_tag() { # Enable error handling and exit the script on pipe failures set -eo pipefail - # Checkout main branch - git checkout main + # # Checkout main branch + # git checkout main + # Find the project name and podspec name + project_name=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj) + podspec_name=$(find . -maxdepth 1 -name "*.podspec" -exec basename {} .podspec) # Retrieve build settings and execute a command to filter MARKETING_VERSION - current_version=$(grep -m1 'MARKETING_VERSION' 'TLDExtractSwift.xcodeproj/project.pbxproj' | sed 's/.*= //;s/;//') + current_version=$(grep -m1 'MARKETING_VERSION' "${project_name}.xcodeproj/project.pbxproj" | sed 's/.*= //;s/;//') echo "Current version: $current_version" # If the current version is found if [[ $current_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then From 21c056eac89c8162f2ee18a04eae51137fb50eb8 Mon Sep 17 00:00:00 2001 From: gumob Date: Wed, 28 Aug 2024 10:27:43 +0900 Subject: [PATCH 4/6] ci: Changed xcodeproj and scheme from hardcoded to external variables --- .github/workflows/main.yml | 86 ++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 35 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a375f1..528f2c5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,10 @@ on: - Sources/** - Tests/** +env: + project_name: TLDExtractSwift + podspec_name: TLDExtractSwift + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -53,31 +57,36 @@ jobs: runsOn: macos-14 name: "Test: macOS 14, Xcode 15.4, Swift 5.10" testPlan: "macOS" + scheme: "TLDExtractSwift" outputFilter: xcbeautify --renderer github-actions coverage: YES - xcode: "Xcode_15.2" runsOn: macos-14 name: "Test: macOS 14, Xcode 15.2, Swift 5.9.2" testPlan: "macOS" + scheme: "TLDExtractSwift" outputFilter: xcbeautify --renderer github-actions coverage: NO - xcode: "Xcode_14.3.1" runsOn: macOS-13 name: "Test: macOS 13, Xcode 14.3.1, Swift 5.8.0" testPlan: "macOS" + scheme: "TLDExtractSwift" outputFilter: xcbeautify --renderer github-actions coverage: NO - xcode: "Xcode_14.2" runsOn: macOS-12 name: "Test: macOS 12, Xcode 14.2, Swift 5.7.2" testPlan: "macOS" + scheme: "TLDExtractSwift" outputFilter: xcpretty coverage: NO steps: - uses: actions/checkout@v4 - name: ${{ matrix.name }} run: |- - set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "TLDExtractSwift.xcodeproj" -scheme "TLDExtractSwift" -destination "platform=macOS" -enableCodeCoverage ${{ matrix.coverage }} clean test | ${{ matrix.outputFilter }} + set -o pipefail + env NSUnbufferedIO=YES xcodebuild -project "${project_name}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "platform=macOS" -enableCodeCoverage ${{ matrix.coverage }} clean test | ${{ matrix.outputFilter }} - name: Upload coverage to Codecov if: ${{ matrix.coverage == 'YES' }} uses: codecov/codecov-action@v4 @@ -99,14 +108,17 @@ jobs: include: - xcode: "Xcode_15.4" name: "Test: Catalyst 15.4" + scheme: "TLDExtractSwift" runsOn: macos-14 - xcode: "Xcode_14.3.1" name: "Test: Catalyst 14.3.1" + scheme: "TLDExtractSwift" runsOn: macOS-13 steps: - uses: actions/checkout@v4 - name: Catalyst - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "TLDExtractSwift.xcodeproj" -scheme "TLDExtractSwift" -destination "platform=macOS" clean test 2>&1 | xcbeautify --renderer github-actions + run: | + set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${project_name}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "platform=macOS" clean test 2>&1 | xcbeautify --renderer github-actions needs: lint_code test_iOS: @@ -122,22 +134,26 @@ jobs: - destination: "OS=17.5,name=iPhone 15 Pro" name: "Test: iOS 17.6" testPlan: "iOS" + scheme: "TLDExtractSwift" xcode: "Xcode_15.4" runsOn: macos-14 - destination: "OS=16.4,name=iPhone 14 Pro" name: "Test: iOS 16.4" testPlan: "iOS" + scheme: "TLDExtractSwift" xcode: "Xcode_14.3.1" runsOn: macOS-13 - destination: "OS=15.5,name=iPhone 13 Pro" name: "Test: iOS 15.5" testPlan: "iOS" + scheme: "TLDExtractSwift" xcode: "Xcode_13.4.1" runsOn: macOS-12 steps: - uses: actions/checkout@v4 - name: ${{ matrix.name }} - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "TLDExtractSwift.xcodeproj" -scheme "TLDExtractSwift" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions + run: | + set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${project_name}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions needs: lint_code test_tvOS: @@ -153,22 +169,27 @@ jobs: - destination: "OS=17.5,name=Apple TV" name: "Test: tvOS 17.5" testPlan: "tvOS" + scheme: "TLDExtractSwift" xcode: "Xcode_15.4" runsOn: macos-14 - destination: "OS=16.4,name=Apple TV" name: "Test: tvOS 16.4" testPlan: "tvOS" + scheme: "TLDExtractSwift" xcode: "Xcode_14.3.1" runsOn: macOS-13 - destination: "OS=15.4,name=Apple TV" name: "Test: tvOS 15.4" testPlan: "tvOS" + scheme: "TLDExtractSwift" xcode: "Xcode_13.4.1" runsOn: macOS-12 steps: - uses: actions/checkout@v4 - name: ${{ matrix.name }} - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "TLDExtractSwift.xcodeproj" -scheme "TLDExtractSwift" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions + run: | + set -o pipefail + env NSUnbufferedIO=YES xcodebuild -project "${project_name}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions needs: lint_code test_visionOS: @@ -190,7 +211,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: ${{ matrix.name }} - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "TLDExtractSwift.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions + run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${project_name}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions needs: lint_code test_watchOS: @@ -383,18 +404,13 @@ jobs: pod lib lint --verbose \ --configuration=${{ matrix.configuration }} \ --platforms=${{ matrix.platform }} \ - TLDExtractSwift.podspec + ${podspec_name}.podspec - name: Pod lib lint - Use Static Frameworks run: | pod lib lint --verbose --use-static-frameworks \ --configuration=${{ matrix.configuration }} \ --platforms=${{ matrix.platform }} \ - TLDExtractSwift.podspec - # - name: Pod Push - # if: github.ref == 'refs/heads/main' - # run: | - # pod repo update - # pod trunk push TLDExtractSwift.podspec --allow-warnings + ${podspec_name}.podspec needs: carthage update_tag: @@ -410,26 +426,26 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # Enable error handling and exit the script on pipe failures - set -eo pipefail - # Retrieve build settings and execute a command to filter MARKETING_VERSION - # current_version=$(xcodebuild -showBuildSettings | grep MARKETING_VERSION | awk -F= '{print $2}' | xargs) - current_version=$(grep -m1 'MARKETING_VERSION' 'TLDExtractSwift.xcodeproj/project.pbxproj' | sed 's/.*= //;s/;//') - # If the current version is found - if [[ $current_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - # Check if a tag for the current version already exists - if git tag -l | grep -q "$current_version"; then - # If the tag exists, delete it from both local and remote - git tag -d "$current_version" - git push origin ":refs/tags/$current_version" - fi - # Create a new tag for the current version and push it to the remote repository - git tag "$current_version" - git push origin "$current_version" - else - # If the version could not be retrieved, display an error message - echo "Could not retrieve the version." + # Enable error handling and exit the script on pipe failures + set -eo pipefail + # Retrieve build settings and execute a command to filter MARKETING_VERSION + current_version=$(grep -m1 'MARKETING_VERSION' "${project_name}.xcodeproj/project.pbxproj" | sed 's/.*= //;s/;//') + echo "Current version: $current_version" + # If the current version is found + if [[ $current_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + # Check if a tag for the current version already exists + if git tag -l | grep -q "$current_version"; then + # If the tag exists, delete it from both local and remote + git tag -d "$current_version" + git push origin ":refs/tags/$current_version" fi + # Create a new tag for the current version and push it to the remote repository + git tag "$current_version" + git push origin "$current_version" + else + # If the version could not be retrieved, display an error message + echo "Error: Could not retrieve the version." + fi needs: lint_cocoapods push_cocoapods: @@ -445,7 +461,7 @@ jobs: # Enable error handling and exit the script on pipe failures set -eo pipefail # Retrieve the current version from the project file - current_version=$(grep -m1 'MARKETING_VERSION' 'TLDExtractSwift.xcodeproj/project.pbxproj' | sed 's/.*= //;s/;//') + current_version=$(grep -m1 'MARKETING_VERSION' "${project_name}.xcodeproj/project.pbxproj" | sed 's/.*= //;s/;//') echo "Current version: $current_version" # Check if the current version is a valid semantic version if [[ ! "$current_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then @@ -453,12 +469,12 @@ jobs: exit 1 fi # Check if the current version already exists in the CocoaPods trunk - if pod trunk info TLDExtractSwift | grep -q "$current_version"; then + if pod trunk info ${podspec_name} | grep -q "$current_version"; then echo "Start deleting $current_version" # Delete the existing version from the CocoaPods trunk - echo "y" | pod trunk delete TLDExtractSwift $current_version || true + echo "y" | pod trunk delete ${podspec_name} $current_version || true fi echo "Start pushing $current_version" # Push the new version to the CocoaPods trunk - pod trunk push TLDExtractSwift.podspec --allow-warnings + pod trunk push ${podspec_name}.podspec --allow-warnings needs: update_tag \ No newline at end of file From 67a3246e8f30834dc794015312eb8437fe3eba22 Mon Sep 17 00:00:00 2001 From: gumob Date: Wed, 28 Aug 2024 10:35:47 +0900 Subject: [PATCH 5/6] build: Added branch check for 'main' before running Cocoapods commands to prevent accidental changes on wrong branches --- run.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/run.sh b/run.sh index a9b450b..1c3610e 100755 --- a/run.sh +++ b/run.sh @@ -64,8 +64,11 @@ local cocoapods_clean() { local cocoapods_trunk_push() { # Enable error handling and exit the script on pipe failures set -eo pipefail - # Checkout main branch - git checkout main + # Check if the current branch is 'main' + if [[ $(git rev-parse --abbrev-ref HEAD) != "main" ]]; then + echo "Warning: You are not on the main branch. Please switch to the main branch and run again." + exit 1 + fi # Find the project name and podspec name project_name=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \;) podspec_name=$(find . -maxdepth 1 -name "*.podspec" -exec basename {} .podspec \;) @@ -91,8 +94,11 @@ local cocoapods_trunk_push() { local github_update_tag() { # Enable error handling and exit the script on pipe failures set -eo pipefail - # # Checkout main branch - # git checkout main + # Check if the current branch is 'main' + if [[ $(git rev-parse --abbrev-ref HEAD) != "main" ]]; then + echo "Warning: You are not on the main branch. Please switch to the main branch and run again." + exit 1 + fi # Find the project name and podspec name project_name=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj) podspec_name=$(find . -maxdepth 1 -name "*.podspec" -exec basename {} .podspec) From 3028846ad0a1534a194a0916f7fa1b152a81bdfc Mon Sep 17 00:00:00 2001 From: gumob Date: Wed, 28 Aug 2024 10:55:23 +0900 Subject: [PATCH 6/6] ci(workflows/main.yml): Use env.project_name in xcodebuild commands to make the workflow more flexible and reusable across multiple projects --- .github/workflows/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 528f2c5..a54d87a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -86,7 +86,7 @@ jobs: - name: ${{ matrix.name }} run: |- set -o pipefail - env NSUnbufferedIO=YES xcodebuild -project "${project_name}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "platform=macOS" -enableCodeCoverage ${{ matrix.coverage }} clean test | ${{ matrix.outputFilter }} + env NSUnbufferedIO=YES xcodebuild -project "${{ env.project_name }}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "platform=macOS" -enableCodeCoverage ${{ matrix.coverage }} clean test | ${{ matrix.outputFilter }} - name: Upload coverage to Codecov if: ${{ matrix.coverage == 'YES' }} uses: codecov/codecov-action@v4 @@ -118,7 +118,7 @@ jobs: - uses: actions/checkout@v4 - name: Catalyst run: | - set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${project_name}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "platform=macOS" clean test 2>&1 | xcbeautify --renderer github-actions + set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${{ env.project_name }}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "platform=macOS" clean test 2>&1 | xcbeautify --renderer github-actions needs: lint_code test_iOS: @@ -153,7 +153,7 @@ jobs: - uses: actions/checkout@v4 - name: ${{ matrix.name }} run: | - set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${project_name}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions + set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${{ env.project_name }}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions needs: lint_code test_tvOS: @@ -189,7 +189,7 @@ jobs: - name: ${{ matrix.name }} run: | set -o pipefail - env NSUnbufferedIO=YES xcodebuild -project "${project_name}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions + env NSUnbufferedIO=YES xcodebuild -project "${{ env.project_name }}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions needs: lint_code test_visionOS: @@ -211,7 +211,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: ${{ matrix.name }} - run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${project_name}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions + run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "${{ env.project_name }}.xcodeproj" -scheme "${{ matrix.scheme }}" -destination "${{ matrix.destination }}" clean test 2>&1 | xcbeautify --renderer github-actions needs: lint_code test_watchOS: @@ -429,7 +429,7 @@ jobs: # Enable error handling and exit the script on pipe failures set -eo pipefail # Retrieve build settings and execute a command to filter MARKETING_VERSION - current_version=$(grep -m1 'MARKETING_VERSION' "${project_name}.xcodeproj/project.pbxproj" | sed 's/.*= //;s/;//') + current_version=$(grep -m1 'MARKETING_VERSION' "${{ env.project_name }}.xcodeproj/project.pbxproj" | sed 's/.*= //;s/;//') echo "Current version: $current_version" # If the current version is found if [[ $current_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then @@ -461,7 +461,7 @@ jobs: # Enable error handling and exit the script on pipe failures set -eo pipefail # Retrieve the current version from the project file - current_version=$(grep -m1 'MARKETING_VERSION' "${project_name}.xcodeproj/project.pbxproj" | sed 's/.*= //;s/;//') + current_version=$(grep -m1 'MARKETING_VERSION' "${{ env.project_name }}.xcodeproj/project.pbxproj" | sed 's/.*= //;s/;//') echo "Current version: $current_version" # Check if the current version is a valid semantic version if [[ ! "$current_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then