From 1bfe15278e7acb2c089af68af44da0861ec7bac9 Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 12:34:00 -0300 Subject: [PATCH 1/7] fix validations fix SwiftLint --- .github/workflows/validations.yml | 32 ++++++++++++------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/validations.yml b/.github/workflows/validations.yml index 624fd917..966cecaa 100644 --- a/.github/workflows/validations.yml +++ b/.github/workflows/validations.yml @@ -1,34 +1,26 @@ name: Validations -on: +on: pull_request_target: branches: [main] types: [opened, reoneped, edited, synchronized] -# workflow_dispatch: -# inputs: -# commit hash: -# description: "Commit hash" -# required: true -# default: "" - jobs: - lint: - runs-on: macos-latest + SwiftLint: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Run SwiftLint - run: swiftlint lint --reporter github-actions-logging - - danger: + - uses: actions/checkout@v1 + - name: GitHub Action for SwiftLint with --strict + uses: norio-nomura/action-swiftlint@3.2.1 + with: + args: --strict + Danger: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Danger - uses: docker://frmeloni/danger-swift-with-swiftlint:1.3.1 + uses: 417-72KI/danger-swiftlint@v5.10 # Look at the `Note for version` with: - args: --failOnErrors --verbose + args: --failOnErrors --verbose env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - From f4b33ae6bfef28f18595d1eea0851f445d55963d Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 12:51:37 -0300 Subject: [PATCH 2/7] add PrivacyInfo.xcprivacy --- SkeletonView.podspec | 1 + 1 file changed, 1 insertion(+) diff --git a/SkeletonView.podspec b/SkeletonView.podspec index bd48f7ca..8d2596f0 100644 --- a/SkeletonView.podspec +++ b/SkeletonView.podspec @@ -15,4 +15,5 @@ Pod::Spec.new do |s| s.swift_version = "5.0" s.source = { :git => "https://github.com/Juanpe/SkeletonView.git", :tag => s.version.to_s } s.source_files = "SkeletonViewCore/Sources/**/*.{swift,h}" + s.resource_bundles = {"SkeletonView" => ["SkeletonViewCore/Sources/Supporting Files/PrivacyInfo.xcprivacy"]} end From aa98fdba33f7f269b7a29d183cf2847b2131d66c Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 12:42:31 -0300 Subject: [PATCH 3/7] fix iPhone version to build --- .github/workflows/main.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 739883a1..86025a93 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,13 +10,28 @@ jobs: runs-on: macos-latest strategy: matrix: - build-config: - - { scheme: 'SkeletonView iOS', destination: 'platform=iOS Simulator,name=iPhone 8', sdk: 'iphonesimulator' } - - { scheme: 'SkeletonView tvOS', destination: 'platform=tvOS Simulator,name=Apple TV', sdk: 'appletvsimulator' } - - { scheme: 'iOS Example', destination: 'platform=iOS Simulator,name=iPhone 8', sdk: 'iphonesimulator' } - - { scheme: 'tvOS Example', destination: 'platform=tvOS Simulator,name=Apple TV', sdk: 'appletvsimulator' } + build-config: + - { + scheme: "SkeletonView iOS", + destination: "platform=iOS Simulator,name=iPhone 15", + sdk: "iphonesimulator", + } + - { + scheme: "SkeletonView tvOS", + destination: "platform=tvOS Simulator,name=Apple TV", + sdk: "appletvsimulator", + } + - { + scheme: "iOS Example", + destination: "platform=iOS Simulator,name=iPhone 15", + sdk: "iphonesimulator", + } + - { + scheme: "tvOS Example", + destination: "platform=tvOS Simulator,name=Apple TV", + sdk: "appletvsimulator", + } steps: - uses: actions/checkout@v2 - name: Build run: xcodebuild clean build -workspace 'SkeletonView.xcworkspace' -scheme '${{ matrix.build-config['scheme'] }}' -sdk '${{ matrix.build-config['sdk'] }}' -destination '${{ matrix.build-config['destination'] }}' - From e9bab99d67f6df1082750b5dfbe53e64183451b2 Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 12:53:39 -0300 Subject: [PATCH 4/7] fix bug on Xcode 16 - iOS12 --- .../API/AnimationBuilder/SkeletonAnimationBuilder.swift | 7 ++++++- .../Sources/API/UIKitExtensions/CALayer+Animations.swift | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/SkeletonViewCore/Sources/API/AnimationBuilder/SkeletonAnimationBuilder.swift b/SkeletonViewCore/Sources/API/AnimationBuilder/SkeletonAnimationBuilder.swift index 321c9b13..c7a52bd2 100644 --- a/SkeletonViewCore/Sources/API/AnimationBuilder/SkeletonAnimationBuilder.swift +++ b/SkeletonViewCore/Sources/API/AnimationBuilder/SkeletonAnimationBuilder.swift @@ -27,10 +27,15 @@ public class SkeletonAnimationBuilder { let animGroup = CAAnimationGroup() animGroup.animations = [startPointAnim, endPointAnim] animGroup.duration = duration - animGroup.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeIn) animGroup.repeatCount = .infinity animGroup.autoreverses = autoreverses animGroup.isRemovedOnCompletion = false + + if #available(iOS 12.0, *) { + animGroup.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeIn) + } else { + animGroup.timingFunction = CAMediaTimingFunction(controlPoints: 0.42, 0.0, 1.0, 1.0) + } return animGroup } diff --git a/SkeletonViewCore/Sources/API/UIKitExtensions/CALayer+Animations.swift b/SkeletonViewCore/Sources/API/UIKitExtensions/CALayer+Animations.swift index 89d22194..87e518c3 100644 --- a/SkeletonViewCore/Sources/API/UIKitExtensions/CALayer+Animations.swift +++ b/SkeletonViewCore/Sources/API/UIKitExtensions/CALayer+Animations.swift @@ -22,10 +22,15 @@ public extension CALayer { // swiftlint:disable:next force_unwrapping pulseAnimation.toValue = UIColor(cgColor: backgroundColor!).complementaryColor.cgColor pulseAnimation.duration = 1 - pulseAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) pulseAnimation.autoreverses = true pulseAnimation.repeatCount = .infinity pulseAnimation.isRemovedOnCompletion = false + + if #available(iOS 12.0, *) { + pulseAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut) + } else { + pulseAnimation.timingFunction = CAMediaTimingFunction(controlPoints: 0.42, 0.0, 0.58, 1.0) + } return pulseAnimation } From 534814551f7c44fd04517e8513b57b18de874a57 Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 12:58:13 -0300 Subject: [PATCH 5/7] remove strict swiftlint --- .github/workflows/validations.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/validations.yml b/.github/workflows/validations.yml index 966cecaa..3eb570bc 100644 --- a/.github/workflows/validations.yml +++ b/.github/workflows/validations.yml @@ -12,8 +12,7 @@ jobs: - uses: actions/checkout@v1 - name: GitHub Action for SwiftLint with --strict uses: norio-nomura/action-swiftlint@3.2.1 - with: - args: --strict + Danger: runs-on: ubuntu-latest steps: From d17c08e89ca24eebd1206b83cd345ec96e104251 Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 13:03:09 -0300 Subject: [PATCH 6/7] fix Twiteet step on release workflow --- .github/workflows/release.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 101f5772..fea8df8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,30 +1,30 @@ name: Release on: [workflow_dispatch] - + jobs: release_version: runs-on: macOS-latest steps: - uses: actions/checkout@v2 - + - name: Publish release id: publish_release uses: release-drafter/release-drafter@v5 - with: + with: publish: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Update podspec + - 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 }}' + branch: "main" + commit_message: "Bump version ${{ steps.publish_release.outputs.tag_name }}" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Deploy to Cocoapods env: @@ -32,16 +32,16 @@ jobs: run: | set -eo pipefail pod lib lint --allow-warnings - pod trunk push --allow-warnings - + pod trunk push --allow-warnings + - name: Tweet the release - uses: ethomson/send-tweet-action@v1 + uses: nearform-actions/github-action-notify-twitter@master 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: | + message: | 🎉 New release ${{ steps.publish_release.outputs.tag_name }} is out 🚀 Check out all the changes here: - ${{ steps.publish_release.outputs.html_url }} + ${{ steps.publish_release.outputs.html_url }} + twitter-app-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} + twitter-app-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} + twitter-access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} + twitter-access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} From ea97d7230f5df52de02411f7c12f387c4fedc7c5 Mon Sep 17 00:00:00 2001 From: Lucas Romano Date: Fri, 29 Nov 2024 13:03:44 -0300 Subject: [PATCH 7/7] revert validations jobs --- .github/workflows/validations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validations.yml b/.github/workflows/validations.yml index 3eb570bc..9766c9d6 100644 --- a/.github/workflows/validations.yml +++ b/.github/workflows/validations.yml @@ -6,14 +6,14 @@ on: types: [opened, reoneped, edited, synchronized] jobs: - SwiftLint: + lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: GitHub Action for SwiftLint with --strict uses: norio-nomura/action-swiftlint@3.2.1 - Danger: + danger: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3