|
| 1 | +# Author by chanhihi |
| 2 | +# Date 2023.08.09 |
| 3 | + |
| 4 | +name: Deployment |
| 5 | + |
| 6 | +on: |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - cluster-main |
| 10 | + - main |
| 11 | + types: |
| 12 | + - closed |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + name: Deploy on macOS 11 - Archive / Release |
| 17 | + runs-on: macos-11 |
| 18 | + env: |
| 19 | + XCODE_VERSION: "12.4.0" |
| 20 | + SWIFT_VERSION: "5.3" |
| 21 | + XCODE_PROJECT: "Box42.xcodeproj" |
| 22 | + XCODE_SCHEME: "Box42" |
| 23 | + XCODE_ARCHIVE_PATH: "Box42.xcarchive" |
| 24 | + XCODE_ARCHIVE_EXPORT_PATH: "./archive" |
| 25 | + XCODE_EXPORT_PATH: "./artifacts" |
| 26 | + steps: |
| 27 | + - name: Checkout |
| 28 | + uses: actions/checkout@v3 |
| 29 | + |
| 30 | + - name: Set Xcode version |
| 31 | + run: sudo xcode-select -s '/Applications/Xcode_12.4.0.app/Contents/Developer' |
| 32 | + |
| 33 | + - name: Set SDK version |
| 34 | + run: echo 'SDKROOT=/Applications/Xcode_12.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk' >> $GITHUB_ENV |
| 35 | + |
| 36 | + - name: setup-swift |
| 37 | + uses: swift-actions/setup-swift@v1 |
| 38 | + with: |
| 39 | + swift-version: 5.3 |
| 40 | + |
| 41 | + - name: Archive |
| 42 | + run: | |
| 43 | + mv Box42/Resources/ExportOptions.plist . && |
| 44 | + xcodebuild archive -project $XCODE_PROJECT -scheme $XCODE_SCHEME -archivePath "$XCODE_ARCHIVE_EXPORT_PATH"/"$XCODE_ARCHIVE_PATH" |
| 45 | +
|
| 46 | + # - name: Distribute |
| 47 | + # run: | |
| 48 | + # mkdir -p artifacts && |
| 49 | + # xcodebuild -exportArchive -archivePath "$XCODE_ARCHIVE_PATH" -exportOptionsPlist ExportOptions.plist -exportPath "$XCODE_EXPORT_PATH" |
| 50 | + |
| 51 | + - name: Tagging |
| 52 | + id: tag_version |
| 53 | + uses: mathieudutour/github-tag-action@v6.1 |
| 54 | + with: |
| 55 | + github_token: ${{ secrets.CHANHIHI }} |
| 56 | + |
| 57 | + - name: Draft Release |
| 58 | + id: draft_release |
| 59 | + uses: release-drafter/release-drafter@v5 |
| 60 | + with: |
| 61 | + config-name: Release-note.yml |
| 62 | + env: |
| 63 | + GITHUB_TOKEN: ${{ secrets.CHANHIHI }} |
| 64 | + |
| 65 | + # Artifact가 Archive 기능으로 사용할 부분 |
| 66 | + - name: Upload Box42-Archive |
| 67 | + uses: actions/upload-artifact@v2 |
| 68 | + with: |
| 69 | + name: Box42-${{ steps.tag_version.outputs.new_tag }} |
| 70 | + path: ${{ env.XCODE_ARCHIVE_EXPORT_PATH }} |
| 71 | + |
| 72 | + # Distribute 기능 활성화시 Artifact에서 사용할 부분 |
| 73 | + # - name: Upload Box42-Artifacts |
| 74 | + # uses: actions/upload-artifact@v2 |
| 75 | + # with: |
| 76 | + # name: Box42-${{ steps.tag_version.outputs.new_tag }} |
| 77 | + # path: $XCODE_EXPORT_PATH |
0 commit comments