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 668423e..976d883 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -5,36 +5,39 @@ name: Swift Build on: push: - branches: [ "feat/*", "fix/*", "refactor/*", "cluster_main", "main" ] + branches: + - feat/* + - fix/* + - refactor/* + 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" 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: ${{ env.SWIFT_VERSION }} - name: Build run: | mkdir Sources && 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 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 + +