From d45d94be1e5efd2358dcf9021d84ed7273afcd6c Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 13:54:05 -0300 Subject: [PATCH] change CD --- .github/workflows/CD.yml | 94 ++--------------------------------- .github/workflows/release.yml | 2 +- 2 files changed, 4 insertions(+), 92 deletions(-) diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 51101889..106e835b 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -1,99 +1,11 @@ name: CD on: + workflow_dispatch: pull_request_target: branches: [main] types: [closed] - workflow_dispatch: jobs: - build: - name: Build XCFramework for Multiple Platforms - runs-on: macos-latest - strategy: - matrix: - build-config: - - { - scheme: "SkeletonView iOS", - destination: "generic/platform=iOS", - sdk: "iphoneos", - archive_path: "build/Release-iphoneos", - } - - { - scheme: "SkeletonView iOS", - destination: "generic/platform=iOS Simulator", - sdk: "iphonesimulator", - archive_path: "build/Release-iphonesimulator", - } - - { - scheme: "SkeletonView tvOS", - destination: "generic/platform=tvOS", - sdk: "appletvos", - archive_path: "build/Release-appletvos", - } - - { - scheme: "SkeletonView tvOS", - destination: "generic/platform=tvOS Simulator", - sdk: "appletvsimulator", - archive_path: "build/Release-appletvsimulator", - } - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Build framework - run: | - xcodebuild archive \ - -scheme "${{ matrix.build-config.scheme }}" \ - -destination "${{ matrix.build-config.destination }}" \ - -sdk "${{ matrix.build-config.sdk }}" \ - -archivePath "${{ matrix.build-config.archive_path }}/SkeletonView.xcarchive" \ - SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES - - release_version: - if: github.event.pull_request.milestone == null && github.event.pull_request.merged == true - runs-on: macOS-latest - steps: - - uses: actions/checkout@v2 - - - name: Publish release - id: publish_release - uses: release-drafter/release-drafter@v5 - with: - publish: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Update podspec - run: fastlane bump_version next_version:${{ steps.publish_release.outputs.tag_name }} - - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - branch: "main" - commit_message: "Bump version ${{ steps.publish_release.outputs.tag_name }}" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Deploy to Cocoapods - continue-on-error: true - env: - COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} - run: | - set -eo pipefail - pod lib lint --allow-warnings - pod trunk push --allow-warnings - - - name: Tweet the release - uses: ethomson/send-tweet-action@v1 - with: - consumer-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} - consumer-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} - access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} - access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} - status: | - 🎉 New release ${{ steps.publish_release.outputs.tag_name }} is out 🚀 - - Check out all the changes here: - ${{ steps.publish_release.outputs.html_url }} + call_reusable_workflow: + uses: ./.github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ad1f9b4f..4be386b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ name: Release -on: [workflow_dispatch] +on: [workflow_dispatch, workflow_call:] jobs: build: