Merge pull request #445 from pusher/release-10.1.6 #52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| check-release-tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v3 | |
| - name: Prepare tag | |
| id: prepare_tag | |
| continue-on-error: true | |
| run: | | |
| npm install --location=global podspec-bump | |
| export TAG=$(podspec-bump --dump-version -p PusherSwift.podspec) | |
| echo "TAG=$TAG" >> $GITHUB_ENV | |
| export CHECK_TAG=$(git tag | grep $TAG) | |
| if [[ $CHECK_TAG ]]; then | |
| echo "Skipping because release tag already exists" | |
| exit 1 | |
| fi | |
| - name: Output | |
| id: release_output | |
| if: ${{ steps.prepare_tag.outcome == 'success' }} | |
| run: | | |
| echo "::set-output name=tag::${{ env.TAG }}" | |
| outputs: | |
| tag: ${{ steps.release_output.outputs.tag }} | |
| build: | |
| runs-on: macos-latest | |
| needs: check-release-tag | |
| if: ${{ needs.check-release-tag.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: maxim-lobanov/setup-xcode@v1 | |
| with: | |
| xcode-version: '15.0.1' | |
| - name: Clear Carthage cache | |
| run: | | |
| echo "🧹 Clearing Carthage caches for clean build..." | |
| rm -rf ~/Library/Caches/org.carthage.CarthageKit | |
| - name: Build with Carthage | |
| continue-on-error: true | |
| id: carthage-build | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PUSHER_CI_GITHUB_PRIVATE_TOKEN }} | |
| GITHUB_ACCESS_TOKEN: ${{ secrets.PUSHER_CI_GITHUB_PRIVATE_TOKEN }} | |
| run: | | |
| sh ./Consumption-Tests/Shared/carthage.sh bootstrap --use-xcframeworks | |
| - name: Check Carthage build result | |
| id: check-carthage | |
| run: | | |
| if [ -f "Carthage/Build/NWWebSocket.xcframework" ] && [ -f "Carthage/Build/TweetNacl.xcframework" ]; then | |
| echo "carthage_success=true" >> $GITHUB_OUTPUT | |
| echo "✅ Carthage frameworks found" | |
| else | |
| echo "carthage_success=false" >> $GITHUB_OUTPUT | |
| echo "❌ Carthage frameworks missing, will use SPM" | |
| fi | |
| - name: Build with Carthage | |
| if: steps.check-carthage.outputs.carthage_success == 'true' | |
| run: | | |
| echo "🎯 Building with Carthage dependencies" | |
| set -o pipefail && env NSUnbufferedIO=YES xcodebuild \ | |
| -project PusherSwift.xcodeproj \ | |
| -scheme PusherSwift \ | |
| build \ | |
| | xcpretty --color | |
| - name: Build with Swift Package Manager | |
| if: steps.check-carthage.outputs.carthage_success == 'false' | |
| run: | | |
| echo "🎯 Building with Swift Package Manager" | |
| swift build -c release | |
| echo "✅ SPM build completed successfully" | |
| outputs: | |
| tag: ${{ needs.check-release-tag.outputs.tag }} | |
| publish-cocoapods: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: ${{ needs.build.outputs.tag }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2.2' | |
| - run: | | |
| gem install cocoapods | |
| git config user.email "pusher-ci@pusher.com" | |
| git config user.name "Pusher CI" | |
| git tag -a ${{ needs.build.outputs.tag }} -m "${{ needs.build.outputs.tag }}" | |
| git push origin ${{ needs.build.outputs.tag }} | |
| pod trunk push PusherSwift.podspec | |
| pod trunk push PusherSwiftWithEncryption.podspec | |
| env: | |
| COCOAPODS_TRUNK_TOKEN: ${{ secrets.PUSHER_CI_COCOAPODS_TOKEN }} | |
| outputs: | |
| release_version: ${{ needs.build.outputs.tag }} | |
| create-github-release: | |
| runs-on: ubuntu-latest | |
| needs: publish-cocoapods | |
| if: ${{ needs.publish-cocoapods.outputs.release_version }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Prepare tag | |
| run: | | |
| export TAG=${{ needs.publish-cocoapods.outputs.release_version }} | |
| echo "TAG=$TAG" >> $GITHUB_ENV | |
| - name: Setup git | |
| run: | | |
| git config user.email "pusher-ci@pusher.com" | |
| git config user.name "Pusher CI" | |
| - name: Create Release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ env.TAG }} | |
| release_name: ${{ env.TAG }} | |
| draft: false | |
| prerelease: false |