From a53a57088bbfa7b8fe5fd5185c98c9c75544b485 Mon Sep 17 00:00:00 2001 From: chanhihi Date: Tue, 22 Aug 2023 01:36:03 +0900 Subject: [PATCH 1/3] =?UTF-8?q?ci:=20=F0=9F=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/swift.yml | 48 ++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 668423e..a9f2606 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -5,30 +5,44 @@ name: Swift Build on: push: - branches: [ "feat/*", "fix/*", "refactor/*", "cluster_main", "main" ] + branches: + - feat/* + - fix/* + - refactor/* + - cluster_main + - main + tags: + - "v*" + pull_request: - branches: [ "cluster_develop" ] + branches: + - cluster_develop jobs: build: name: Swift 5.3 on macOS 11 runs-on: macos-11 + env: + XCODE_VERSION: "12.4.0" + SWIFT_VERSION: "5.3" + XCODE_PROJECT: "Box42.xcodeproj" + XCODE_SCHEME: "Box42" + XCODE_ARCHIVE_PATH: "Box42.xcarchive" + XCODE_EXPORT_PATH: "./artifacts" steps: - name: Checkout uses: actions/checkout@v3 - name: Set Xcode version - run: - sudo xcode-select -s '/Applications/Xcode_12.4.0.app/Contents/Developer' + run: sudo xcode-select -s '/Applications/Xcode_12.4.0.app/Contents/Developer' - name: Set SDK version - run: - echo 'SDKROOT=/Applications/Xcode_12.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk' >> $GITHUB_ENV + run: echo 'SDKROOT=/Applications/Xcode_12.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk' >> $GITHUB_ENV - name: setup-swift uses: swift-actions/setup-swift@v1 with: - swift-version: 5.3 + swift-version: 5.3 - name: Build run: | @@ -36,5 +50,21 @@ jobs: mv Box42 Sources/Box42 && swift build -# This workflow will build a Swift project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift + - name: Archive + if: github.ref == 'refs/heads/cluster_main' + run: | + mv Sources/Box42/Resources/ExportOptions.plist . && + xcodebuild archive -project $XCODE_PROJECT -scheme $XCODE_SCHEME -archivePath $XCODE_ARCHIVE_PATH + + - name: Distribute + if: github.ref == 'refs/heads/cluster_main' + run: | + mkdir -p artifacts && + xcodebuild -exportArchive -archivePath "$XCODE_ARCHIVE_PATH" -exportOptionsPlist ExportOptions.plist -exportPath "$XCODE_EXPORT_PATH" + + - name: Upload Box42-Artifacts + if: github.ref == 'refs/heads/cluster_main' + uses: actions/upload-artifact@v2 + with: + name: Box42-${{ github.ref_name }} + path: $XCODE_EXPORT_PATH From 0b3c53ba8404376db0723447bee8dceab1c0c7e8 Mon Sep 17 00:00:00 2001 From: chanhihi Date: Tue, 22 Aug 2023 01:36:16 +0900 Subject: [PATCH 2/3] =?UTF-8?q?ci:=20=F0=9F=93=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Box42/Resources/ExportOptions.plist | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Box42/Resources/ExportOptions.plist diff --git a/Box42/Resources/ExportOptions.plist b/Box42/Resources/ExportOptions.plist new file mode 100644 index 0000000..31694a6 --- /dev/null +++ b/Box42/Resources/ExportOptions.plist @@ -0,0 +1,14 @@ + + + + + destination + export + method + development + signingStyle + automatic + teamID + QUAC995NAA + + From 3024d23a0362a8e1252e234188ecd4fb61b624c6 Mon Sep 17 00:00:00 2001 From: chanhihi Date: Tue, 22 Aug 2023 02:05:37 +0900 Subject: [PATCH 3/3] =?UTF-8?q?ci(=F0=9F=9B=A0):=20ci/cd=20=EB=B6=80?= =?UTF-8?q?=EB=B6=84=EC=9D=84=20=EB=B6=84=EB=A6=AC=ED=95=A9=EB=8B=88?= =?UTF-8?q?=EB=8B=A4=20!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Deployment.yml | 60 ++++++++++++++++++++++++++++++++ .github/workflows/swift.yml | 29 +-------------- 2 files changed, 61 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/Deployment.yml diff --git a/.github/workflows/Deployment.yml b/.github/workflows/Deployment.yml new file mode 100644 index 0000000..87ea009 --- /dev/null +++ b/.github/workflows/Deployment.yml @@ -0,0 +1,60 @@ +# Author by chanhihi +# Date 2023.08.09 + +name: Deployment + +on: + push: + branches: + - cluster_main + - main + tags: + - "v*" + +jobs: + build: + name: Deploy on macOS 11 + runs-on: macos-11 + env: + XCODE_VERSION: "12.4.0" + SWIFT_VERSION: "5.3" + XCODE_PROJECT: "Box42.xcodeproj" + XCODE_SCHEME: "Box42" + XCODE_ARCHIVE_PATH: "Box42.xcarchive" + XCODE_EXPORT_PATH: "./artifacts" + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set Xcode version + run: sudo xcode-select -s '/Applications/Xcode_12.4.0.app/Contents/Developer' + + - name: Set SDK version + run: echo 'SDKROOT=/Applications/Xcode_12.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk' >> $GITHUB_ENV + + - name: setup-swift + uses: swift-actions/setup-swift@v1 + with: + swift-version: $SWIFT_VERSION + + - name: Build + run: | + mkdir Sources && + mv Box42 Sources/Box42 && + swift build + + - name: Archive + run: | + mv Sources/Box42/Resources/ExportOptions.plist . && + xcodebuild archive -project $XCODE_PROJECT -scheme $XCODE_SCHEME -archivePath $XCODE_ARCHIVE_PATH + + - name: Distribute + run: | + mkdir -p artifacts && + xcodebuild -exportArchive -archivePath "$XCODE_ARCHIVE_PATH" -exportOptionsPlist ExportOptions.plist -exportPath "$XCODE_EXPORT_PATH" + + - name: Upload Box42-Artifacts + uses: actions/upload-artifact@v2 + with: + name: Box42-${{ github.ref_name }} + path: $XCODE_EXPORT_PATH diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index a9f2606..976d883 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -9,10 +9,6 @@ on: - feat/* - fix/* - refactor/* - - cluster_main - - main - tags: - - "v*" pull_request: branches: @@ -25,10 +21,6 @@ jobs: env: XCODE_VERSION: "12.4.0" SWIFT_VERSION: "5.3" - XCODE_PROJECT: "Box42.xcodeproj" - XCODE_SCHEME: "Box42" - XCODE_ARCHIVE_PATH: "Box42.xcarchive" - XCODE_EXPORT_PATH: "./artifacts" steps: - name: Checkout uses: actions/checkout@v3 @@ -42,29 +34,10 @@ jobs: - name: setup-swift uses: swift-actions/setup-swift@v1 with: - swift-version: 5.3 + swift-version: ${{ env.SWIFT_VERSION }} - name: Build run: | mkdir Sources && mv Box42 Sources/Box42 && swift build - - - name: Archive - if: github.ref == 'refs/heads/cluster_main' - run: | - mv Sources/Box42/Resources/ExportOptions.plist . && - xcodebuild archive -project $XCODE_PROJECT -scheme $XCODE_SCHEME -archivePath $XCODE_ARCHIVE_PATH - - - name: Distribute - if: github.ref == 'refs/heads/cluster_main' - run: | - mkdir -p artifacts && - xcodebuild -exportArchive -archivePath "$XCODE_ARCHIVE_PATH" -exportOptionsPlist ExportOptions.plist -exportPath "$XCODE_EXPORT_PATH" - - - name: Upload Box42-Artifacts - if: github.ref == 'refs/heads/cluster_main' - uses: actions/upload-artifact@v2 - with: - name: Box42-${{ github.ref_name }} - path: $XCODE_EXPORT_PATH