From 2bfa3533a5db3de30474ad845340985c11dc50d6 Mon Sep 17 00:00:00 2001 From: yuncheol-AHN Date: Fri, 8 Nov 2024 00:14:17 +0900 Subject: [PATCH 1/5] build: github actions work flow for build process --- .github/workflows/swift.yml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/swift.yml diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 00000000..b0806f35 --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,51 @@ +name: My Swift Actions πŸš— + +on: + pull_request: + branches: ["develop"] + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + - name: πŸ”– certificate + env: + BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} + P12_PASSWORD: ${{ secrets.P12_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + run: | + # create variables + CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 + PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision + KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db + + # import certificate and provisioning profile from secrets + echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH + + # create temporary keychain + security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security set-keychain-settings -lut 21600 $KEYCHAIN_PATH + security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + + # import certificate to keychain + security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH + security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH + security list-keychain -d user -s $KEYCHAIN_PATH + + # apply provisioning profile + mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles + cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles + + - name: πŸ”¨ set up xcode version + run: | + sudo xcode-select -s /Applications/Xcode_16.1.app + + - name: βœ… check xcode version + run: | + sudo xcodebuild -version + + - name: Build + run: | + xcodebuild -workspace ./MemorialHouse/MemorialHouse.xcworkspace -scheme MemorialHouse -destination 'platform=iOS Simulator,name=iPhone 16 Pro' From 9b3018d67c8df7b82c9a83a405a3af80217cbf10 Mon Sep 17 00:00:00 2001 From: yuncheol-AHN Date: Fri, 8 Nov 2024 00:14:51 +0900 Subject: [PATCH 2/5] build: github actions work flow for swiftlint dependency delete and pull --- .github/workflows/swift.yml | 2 + .github/workflows/swiftlint.yml | 25 +++++++++ .../MHApplication.xcodeproj/project.pbxproj | 20 +------ .../MHCore/MHCore.xcodeproj/project.pbxproj | 4 +- .../MHData/MHData.xcodeproj/project.pbxproj | 4 +- .../MHDomain.xcodeproj/project.pbxproj | 4 +- .../MHFoundation.xcodeproj/project.pbxproj | 4 +- .../MHPresentation.xcodeproj/project.pbxproj | 4 +- Package.swift | 56 +++++++++++++++++++ 9 files changed, 95 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/swiftlint.yml create mode 100644 Package.swift diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index b0806f35..222bdb84 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -14,6 +14,7 @@ jobs: env: BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} P12_PASSWORD: ${{ secrets.P12_PASSWORD }} + BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} run: | # create variables @@ -23,6 +24,7 @@ jobs: # import certificate and provisioning profile from secrets echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH + echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH # create temporary keychain security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 00000000..b3931aa7 --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,25 @@ +name: swiftlint πŸ”¨ + +on: + pull_request: + branches: ["develop"] + paths: + - ".github/workflows/swiftlint.yml" + - ".swiftlint.yml" + - "**/*.swift" + +jobs: + SwiftLint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: GitHub Action for SwiftLint + uses: norio-nomura/action-swiftlint@3.2.1 + - name: GitHub Action for SwiftLint (Only files changed in the PR) + uses: norio-nomura/action-swiftlint@3.2.1 + env: + DIFF_BASE: ${{ github.base_ref }} + - name: GitHub Action for SwiftLint (Different working directory) + uses: norio-nomura/action-swiftlint@3.2.1 + env: + WORKING_DIRECTORY: Source diff --git a/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj b/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj index 08f934a8..b2ec49c0 100644 --- a/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHApplication/MHApplication.xcodeproj/project.pbxproj @@ -155,7 +155,6 @@ buildRules = ( ); dependencies = ( - CED59DC52CD9E07B005BE50D /* PBXTargetDependency */, ); name = MemorialHouse; packageProductDependencies = ( @@ -189,7 +188,7 @@ mainGroup = 0EE4A0772CD5DD1800F17FA5; minimizedProjectReferenceProxies = 1; packageReferences = ( - CED59DC32CD9E053005BE50D /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, + DB4326A12CDD1E78009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, ); preferredProjectObjectVersion = 77; productRefGroup = 0EE4A0812CD5DD1800F17FA5 /* Products */; @@ -247,13 +246,6 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - CED59DC52CD9E07B005BE50D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - productRef = CED59DC42CD9E07B005BE50D /* SwiftLintBuildToolPlugin */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ 0EE4A09C2CD5DD2400F17FA5 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; @@ -477,7 +469,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - CED59DC32CD9E053005BE50D /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { + DB4326A12CDD1E78009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SimplyDanny/SwiftLintPlugins"; requirement = { @@ -486,14 +478,6 @@ }; }; /* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - CED59DC42CD9E07B005BE50D /* SwiftLintBuildToolPlugin */ = { - isa = XCSwiftPackageProductDependency; - package = CED59DC32CD9E053005BE50D /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */; - productName = "plugin:SwiftLintBuildToolPlugin"; - }; -/* End XCSwiftPackageProductDependency section */ }; rootObject = 0EE4A0782CD5DD1800F17FA5 /* Project object */; } diff --git a/MemorialHouse/MHCore/MHCore.xcodeproj/project.pbxproj b/MemorialHouse/MHCore/MHCore.xcodeproj/project.pbxproj index 4da22713..990a6a18 100644 --- a/MemorialHouse/MHCore/MHCore.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHCore/MHCore.xcodeproj/project.pbxproj @@ -121,7 +121,7 @@ mainGroup = CE9AEBB12CD7B5EF00F8471D; minimizedProjectReferenceProxies = 1; packageReferences = ( - 0E7F28842CDA07E7007D4F2B /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, + DB4326A22CDD1E9A009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, ); preferredProjectObjectVersion = 77; productRefGroup = CE9AEBBC2CD7B5EF00F8471D /* Products */; @@ -405,7 +405,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 0E7F28842CDA07E7007D4F2B /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { + DB4326A22CDD1E9A009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SimplyDanny/SwiftLintPlugins"; requirement = { diff --git a/MemorialHouse/MHData/MHData.xcodeproj/project.pbxproj b/MemorialHouse/MHData/MHData.xcodeproj/project.pbxproj index 2a58438c..47dcd22e 100644 --- a/MemorialHouse/MHData/MHData.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHData/MHData.xcodeproj/project.pbxproj @@ -129,7 +129,7 @@ mainGroup = CE9AEB6D2CD7B46700F8471D; minimizedProjectReferenceProxies = 1; packageReferences = ( - 0E7F288B2CDA086E007D4F2B /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, + DB4326A52CDD1ECE009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, ); preferredProjectObjectVersion = 77; productRefGroup = CE9AEB782CD7B46700F8471D /* Products */; @@ -413,7 +413,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 0E7F288B2CDA086E007D4F2B /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { + DB4326A52CDD1ECE009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SimplyDanny/SwiftLintPlugins"; requirement = { diff --git a/MemorialHouse/MHDomain/MHDomain.xcodeproj/project.pbxproj b/MemorialHouse/MHDomain/MHDomain.xcodeproj/project.pbxproj index 79147575..01355c9e 100644 --- a/MemorialHouse/MHDomain/MHDomain.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHDomain/MHDomain.xcodeproj/project.pbxproj @@ -125,7 +125,7 @@ mainGroup = CE9AEB442CD7B31300F8471D; minimizedProjectReferenceProxies = 1; packageReferences = ( - 0E7F288D2CDA0881007D4F2B /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, + DB4326A62CDD1ED8009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, ); preferredProjectObjectVersion = 77; productRefGroup = CE9AEB4F2CD7B31300F8471D /* Products */; @@ -409,7 +409,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 0E7F288D2CDA0881007D4F2B /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { + DB4326A62CDD1ED8009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SimplyDanny/SwiftLintPlugins"; requirement = { diff --git a/MemorialHouse/MHFoundation/MHFoundation.xcodeproj/project.pbxproj b/MemorialHouse/MHFoundation/MHFoundation.xcodeproj/project.pbxproj index 0c3dff5d..8da7503f 100644 --- a/MemorialHouse/MHFoundation/MHFoundation.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHFoundation/MHFoundation.xcodeproj/project.pbxproj @@ -113,7 +113,7 @@ mainGroup = DB3CB96B2CD9B08A008186F4; minimizedProjectReferenceProxies = 1; packageReferences = ( - 0E7F28862CDA082A007D4F2B /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, + DB4326A32CDD1EB7009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, ); preferredProjectObjectVersion = 77; productRefGroup = DB3CB9762CD9B08A008186F4 /* Products */; @@ -397,7 +397,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 0E7F28862CDA082A007D4F2B /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { + DB4326A32CDD1EB7009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SimplyDanny/SwiftLintPlugins"; requirement = { diff --git a/MemorialHouse/MHPresentation/MHPresentation.xcodeproj/project.pbxproj b/MemorialHouse/MHPresentation/MHPresentation.xcodeproj/project.pbxproj index 94b0ace7..a3e45337 100644 --- a/MemorialHouse/MHPresentation/MHPresentation.xcodeproj/project.pbxproj +++ b/MemorialHouse/MHPresentation/MHPresentation.xcodeproj/project.pbxproj @@ -176,7 +176,7 @@ mainGroup = CE9AEB8F2CD7B4F200F8471D; minimizedProjectReferenceProxies = 1; packageReferences = ( - 0E7F28892CDA084F007D4F2B /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, + DB4326A42CDD1EC2009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, ); preferredProjectObjectVersion = 77; productRefGroup = CE9AEB9A2CD7B4F200F8471D /* Products */; @@ -465,7 +465,7 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 0E7F28892CDA084F007D4F2B /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { + DB4326A42CDD1EC2009C03B8 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SimplyDanny/SwiftLintPlugins"; requirement = { diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..f64c7f37 --- /dev/null +++ b/Package.swift @@ -0,0 +1,56 @@ +import PackageDescription + +let package = Package( + name: "MemorialHouse", + products: [ + .library(name: "MHDomain", targets: ["MHDomain"]), + .library(name: "MHCore", targets: ["MHCore"]), + .library(name: "MHData", targets: ["MHData"]), + .library(name: "MHFoundation", targets: ["MHFoundation"]), + .library(name: "MHPresentation", targets: ["MHPresentation"]), + .library(name: "MHApplication", targets: ["MHApplication"]), + ], + dependencies: [ + .package(url: "https://github.com/realm/SwiftLintPlugins", from: "0.57.0"), + ], + targets: [ + .target( + name: "MHDomain", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ), + .target( + name: "MHCore", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ), + .target( + name: "MHData", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ), + .target( + name: "MHFoundation", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ), + .target( + name: "MHPresentation", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") + ] + ), + .target( + name: "MHApplication", + dependencies: [ + .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") // ν”ŒλŸ¬κ·ΈμΈ ν™œμ„±ν™” + ] + ), + ], + swiftLanguageVersions: [.v6] +) + From 775c276d4203aa8474a4f73119ed0ee1850e5b00 Mon Sep 17 00:00:00 2001 From: yuncheol-AHN <70050038+yuncheol-AHN@users.noreply.github.com> Date: Fri, 8 Nov 2024 01:18:42 +0900 Subject: [PATCH 3/5] Update swift.yml --- .github/workflows/swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 222bdb84..d23c98aa 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -6,7 +6,7 @@ on: jobs: build: - runs-on: macos-latest + runs-on: macos-latest steps: - uses: actions/checkout@v4 From c3b0ab1baff574aca24e1dc2dc9a8e67c8127921 Mon Sep 17 00:00:00 2001 From: yuncheol-AHN <70050038+yuncheol-AHN@users.noreply.github.com> Date: Fri, 8 Nov 2024 01:27:43 +0900 Subject: [PATCH 4/5] Delete Package.swift --- Package.swift | 56 --------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 Package.swift diff --git a/Package.swift b/Package.swift deleted file mode 100644 index f64c7f37..00000000 --- a/Package.swift +++ /dev/null @@ -1,56 +0,0 @@ -import PackageDescription - -let package = Package( - name: "MemorialHouse", - products: [ - .library(name: "MHDomain", targets: ["MHDomain"]), - .library(name: "MHCore", targets: ["MHCore"]), - .library(name: "MHData", targets: ["MHData"]), - .library(name: "MHFoundation", targets: ["MHFoundation"]), - .library(name: "MHPresentation", targets: ["MHPresentation"]), - .library(name: "MHApplication", targets: ["MHApplication"]), - ], - dependencies: [ - .package(url: "https://github.com/realm/SwiftLintPlugins", from: "0.57.0"), - ], - targets: [ - .target( - name: "MHDomain", - dependencies: [ - .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") - ] - ), - .target( - name: "MHCore", - dependencies: [ - .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") - ] - ), - .target( - name: "MHData", - dependencies: [ - .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") - ] - ), - .target( - name: "MHFoundation", - dependencies: [ - .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") - ] - ), - .target( - name: "MHPresentation", - dependencies: [ - .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") - ] - ), - .target( - name: "MHApplication", - dependencies: [ - .product(name: "SwiftLintBuildToolPlugin", package: "SwiftLintPlugins") // ν”ŒλŸ¬κ·ΈμΈ ν™œμ„±ν™” - ] - ), - ], - swiftLanguageVersions: [.v6] -) - From efd97440e0687eca67d1e66b4cdc6703aec6495d Mon Sep 17 00:00:00 2001 From: yuncheol-AHN <70050038+yuncheol-AHN@users.noreply.github.com> Date: Fri, 8 Nov 2024 01:31:10 +0900 Subject: [PATCH 5/5] feat: github actions flow for build --- .github/workflows/swift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index d23c98aa..222bdb84 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -6,7 +6,7 @@ on: jobs: build: - runs-on: macos-latest + runs-on: macos-latest steps: - uses: actions/checkout@v4