Skip to content

Commit

Permalink
Release 17.9.1 (#3034)
Browse files Browse the repository at this point in the history
* Fix edit button adaptive color application

* Update CHANGELOG

* Bump versions to 17.9.1

* Update release workflow

* Tint refresh and sync ProgressViews with UIRefreshControl appearance

* Add logging to contact

---------

Co-authored-by: crow <[email protected]>
Co-authored-by: Ryan Lepinski <[email protected]>
  • Loading branch information
3 people authored Mar 21, 2024
1 parent 609838a commit 79f4370
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 117 deletions.
103 changes: 15 additions & 88 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,6 @@ jobs:
job_name: "iOS SDK Release Started :apple_og:"
url: ${{ secrets.SLACK_WEBHOOK }}

build-package:
needs: check-version
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v4
- name: Install Coreutils
run: brew install coreutils
- name: Install Apple Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATEXC }}
p12-password: ${{ secrets.CERTIFICATEXC_PASS }}
- name: Build SDK
run: make build-package XCODE=14.3.1
- name: Upload zip distribution
uses: actions/upload-artifact@v3
with:
name: airship
path: ./build/Airship.zip
- name: Upload zip distribution
uses: actions/upload-artifact@v3
with:
name: airship-carthage
path: ./build/Airship.xcframeworks.zip
- name: Upload Documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: ./build/Documentation

build-package-xcode15:
needs: check-version
runs-on: macos-13-xlarge
Expand All @@ -70,15 +40,15 @@ jobs:
p12-password: ${{ secrets.CERTIFICATEXC_PASS }}
- name: Build SDK
run: make build-package
- name: Upload zip distribution
- name: Upload zip distribution for Xcode 15
uses: actions/upload-artifact@v3
with:
name: airship-xcode15
name: Airship-Xcode15.zip
path: ./build/Airship.zip
- name: Upload zip distribution
- name: Upload Xcode 15 Carthage zip distribution
uses: actions/upload-artifact@v3
with:
name: airship-carthage-xcode15
name: Airship-Xcode15.xcframeworks.zip
path: ./build/Airship.xcframeworks.zip
- name: Upload Documentation
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -114,7 +84,7 @@ jobs:
permissions:
contents: write
runs-on: macos-13-xlarge
needs: [run-tests, build-package, build-samples, build-package-xcode15]
needs: [run-tests, build-samples, build-package-xcode15]
steps:
- uses: actions/checkout@v4
- name: Get the version
Expand All @@ -130,29 +100,18 @@ jobs:
NOTES="${NOTES//$'\n'/%0A}"
NOTES="${NOTES//$'\r'/%0D}"
echo ::set-output name=NOTES::"$NOTES"
- name: Download zip distribution
uses: actions/download-artifact@v3
with:
name: airship
path: ./build
- name: Download Carthage zip distribution
uses: actions/download-artifact@v3
with:
name: airship-carthage-xcode15
path: ./build
- name: Download Xcode15 zip distribution
uses: actions/download-artifact@v3
with:
name: airship-xcode15
path: ./buildXcode15
name: Airship-Xcode15.zip
- name: Download Xcode15 Carthage zip distribution
uses: actions/download-artifact@v3
with:
name: airship-carthage
path: ./buildXcode15
name: Airship-Xcode15.xcframeworks.zip

- name: Github Release
id: create_release
uses: actions/create-release@v1.1.4
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -161,42 +120,10 @@ jobs:
body: ${{ steps.get_release_notes.outputs.NOTES }}
draft: false
prerelease: false
- name: Upload zip distribution
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/Airship.zip
asset_name: Airship.zip
asset_content_type: application/zip
- name: Upload carthage zip distribution
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/Airship.xcframeworks.zip
asset_name: Airship.xcframeworks.zip
asset_content_type: application/zip
- name: Upload Xcode15 zip distribution
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./buildXcode15/Airship.zip
asset_name: Airship-Xcode15.zip
asset_content_type: application/zip
- name: Upload Xcode 15 carthage zip distribution
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./buildXcode15/Airship.xcframeworks.zip
asset_name: Airship-Xcode15.xcframeworks.zip
asset_content_type: application/zip
files: |
Airship-Xcode15.zip
Airship-Xcode15.xcframeworks.zip
- name: Update prebuilt Xcode 14 repo
env:
GITHUB_TOKEN: ${{ secrets.IOS_DEPLOY_PREBUILT_PAT }}
Expand All @@ -215,7 +142,7 @@ jobs:

deploy-pods:
runs-on: macos-13-xlarge
needs: [run-tests, build-package, build-samples]
needs: [run-tests, build-package-xcode15, build-samples]
steps:
- uses: actions/checkout@v4
- name: Get the version
Expand All @@ -236,7 +163,7 @@ jobs:

deploy-docs:
runs-on: macos-13-xlarge
needs: [run-tests, build-package, build-samples]
needs: [run-tests, build-package-xcode15, build-samples]
steps:
- uses: actions/checkout@v4
- name: Get the version
Expand Down
2 changes: 1 addition & 1 deletion Airship.podspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AIRSHIP_VERSION="17.9.0"
AIRSHIP_VERSION="17.9.1"

Pod::Spec.new do |s|
s.version = AIRSHIP_VERSION
Expand Down
2 changes: 1 addition & 1 deletion Airship/AirshipConfig.xcconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//* Copyright Airship and Contributors */

CURRENT_PROJECT_VERSION = 17.9.0
CURRENT_PROJECT_VERSION = 17.9.1

// Uncomment to include the preview build warning
// OTHER_CFLAGS = $(inherited) -DUA_PREVIEW=1
5 changes: 5 additions & 0 deletions Airship/AirshipCore/Source/AirshipContact.swift
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ public final class AirshipContact: NSObject, AirshipComponent, AirshipContactPro
@objc
public func reset() {
guard self.privacyManager.isEnabled(.contacts) else {
AirshipLogger.trace("Contacts are disabled, ignoring reset request")
return
}
self.addOperation(.reset)
Expand All @@ -342,6 +343,7 @@ public final class AirshipContact: NSObject, AirshipComponent, AirshipContactPro
@objc
public func notifyRemoteLogin() {
guard self.privacyManager.isEnabled(.contacts) else {
AirshipLogger.trace("Contacts are disabled, ignoring notifyRemoteLogin request")
return
}
self.addOperation(.verify(self.date.now, required: true))
Expand All @@ -353,6 +355,7 @@ public final class AirshipContact: NSObject, AirshipComponent, AirshipContactPro
public func editTagGroups() -> TagGroupsEditor {
return TagGroupsEditor { updates in
guard !updates.isEmpty else {
AirshipLogger.trace("Empty tag group updates, ignoring")
return
}

Expand Down Expand Up @@ -384,6 +387,7 @@ public final class AirshipContact: NSObject, AirshipComponent, AirshipContactPro
public func editAttributes() -> AttributesEditor {
return AttributesEditor { updates in
guard !updates.isEmpty else {
AirshipLogger.trace("Empty attribute updates, ignoring")
return
}

Expand Down Expand Up @@ -684,6 +688,7 @@ public final class AirshipContact: NSObject, AirshipComponent, AirshipContactPro

private func addOperation(_ operation: ContactOperation) {
self.serialQueue.enqueue {
AirshipLogger.trace("Adding contact operation \(operation.type)")
await self.contactManager.addOperation(operation)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Airship/AirshipCore/Source/AirshipVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation

@objc(UAirshipVersion)
public class AirshipVersion: NSObject {
public static let version = "17.9.0"
public static let version = "17.9.1"

@objc
public class func get() -> String {
Expand Down
30 changes: 22 additions & 8 deletions Airship/AirshipCore/Source/ContactManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,13 @@ actor ContactManager: ContactManagerProtocol {

// Worker -> one at a time
private func perfromNextOperation() async throws -> Bool {
guard self.isEnabled else { return true }
guard self.isEnabled else {
AirshipLogger.trace("Contact manager is not enabled, unable to perform operation")
return true
}

guard !self.operationEntries.isEmpty else {
AirshipLogger.trace("Operations are empty")
return true
}

Expand All @@ -256,6 +260,7 @@ actor ContactManager: ContactManagerProtocol {
yieldContactUpdates()

guard let operationGroup = prepareNextOperationGroup() else {
AirshipLogger.trace("Next operation group is nil")
return true
}

Expand Down Expand Up @@ -287,10 +292,13 @@ actor ContactManager: ContactManagerProtocol {
}

private func enqueueTask() {
guard
self.channel.identifier != nil,
self.isEnabled
else {
guard self.isEnabled else {
AirshipLogger.trace("Contact manager is not enabled, unable to enqueue task")
return
}

guard self.channel.identifier != nil else {
AirshipLogger.trace("Channel not created, unable to enqueue task")
return
}

Expand Down Expand Up @@ -323,7 +331,9 @@ actor ContactManager: ContactManagerProtocol {
}

private func performOperation(_ operation: ContactOperation) async throws -> Bool {
AirshipLogger.trace("Performing operation \(operation.type)")
guard !self.isSkippable(operation: operation) else {
AirshipLogger.trace("Operation skippable, finished operation \(operation.type)")
return true
}

Expand Down Expand Up @@ -778,7 +788,12 @@ actor ContactManager: ContactManagerProtocol {
operationType == .resolve {

self.operationEntries = self.operationEntries.filter { entry in
result.contact.channelAssociatedDate < entry.date
if (result.contact.channelAssociatedDate < entry.date) {
return true
} else {
AirshipLogger.trace("Dropping operation \(entry.operation.type) due to channel association date")
return false
}
}
}

Expand Down Expand Up @@ -830,8 +845,7 @@ actor ContactManager: ContactManagerProtocol {
channel: AssociatedChannel? = nil
) async {

guard let contactInfo = self.lastContactInfo,
contactInfo.contactID == contactID else {
guard let contactInfo = self.lastContactInfo, contactInfo.contactID == contactID else {
return
}

Expand Down
14 changes: 14 additions & 0 deletions Airship/AirshipMessageCenter/Source/theme/MessageCenterUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
import Foundation
import SwiftUI

extension ProgressView {
@ViewBuilder
func appearanceTint() -> some View {
if let color = UIRefreshControl.appearance().tintColor {
let color = Color(color)
if #available(iOS 15.0, *) {
self.tint(color)
}
} else {
self
}
}
}

extension Color {
func adaptiveColor(for colorScheme: ColorScheme, darkVariation: Color?) -> Color? {
if colorScheme == .light {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,11 @@ public struct MessageCenterListView: View {

if !self.viewModel.messagesLoaded {
ProgressView()
.appearanceTint()
.opacity(1.0 - self.listOpacity)
} else if self.messageIDs.isEmpty {
VStack {
Button {
Task {
await self.viewModel.refreshList()
}
} label: {
Image(systemName: "arrow.clockwise")
}
refreshButton()
Text("ua_empty_message_list".messageCenterlocalizedString)
.opacity(1.0 - self.listOpacity)
}
Expand Down Expand Up @@ -280,19 +275,27 @@ public struct MessageCenterListView: View {

private func editButton() -> some View {
let isEditMode = self.editMode?.wrappedValue.isEditing ?? false
let color =
isEditMode
? theme.cancelButtonTitleColor : (theme.editButtonTitleColor != nil)
? theme.cancelButtonTitleColor?.adaptiveColor(for: colorScheme, darkVariation: theme.cancelButtonTitleColorDark) :
theme.editButtonTitleColor?.adaptiveColor(for: colorScheme, darkVariation: theme.editButtonTitleColorDark)

return EditButton().foregroundColor(color).accessibilityHint("ua_edit_messages_description".messageCenterlocalizedString)
var color: Color? = nil

if isEditMode {
color = theme.cancelButtonTitleColor?.adaptiveColor(for: colorScheme, darkVariation: theme.cancelButtonTitleColorDark)
} else {
color = theme.editButtonTitleColor?.adaptiveColor(for: colorScheme, darkVariation: theme.editButtonTitleColorDark)
}

return EditButton()
.foregroundColor(color)
.accessibilityHint("ua_edit_messages_description".messageCenterlocalizedString)
}

@ViewBuilder
private func refreshButton() -> some View {
let refreshColor = theme.refreshTintColor?.adaptiveColor(for: colorScheme, darkVariation: theme.refreshTintColorDark)

if isRefreshing {
ProgressView()
.appearanceTint()
} else {
Button {
Task {
Expand All @@ -302,6 +305,7 @@ public struct MessageCenterListView: View {
}
} label: {
Image(systemName: "arrow.clockwise")
.foregroundColor(refreshColor)
}
.disabled(isRefreshing)
.opacity(isRefreshing ? 0 : 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ private struct MessageCenterMessageContentView: View {
.animation(.easeInOut(duration: 0.5), value: self.opacity)

if case .loading = self.webViewPhase {
ProgressView()
ProgressView().appearanceTint()
} else if case .error(let error) = self.webViewPhase {
if let error = error as? MessageCenterMessageError,
error == .messageGone
Expand Down
Loading

0 comments on commit 79f4370

Please sign in to comment.