Skip to content

Commit b99f388

Browse files
author
Di Wu
authored
chore: kickoff release
2 parents dfe0ad3 + 947a38d commit b99f388

File tree

9 files changed

+84
-43
lines changed

9 files changed

+84
-43
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
<<: *default-executor
4444

4545
steps:
46+
- add_ssh_keys:
47+
fingerprints:
48+
- "5a:23:0e:1d:98:0c:04:dc:73:06:5f:c3:19:72:e2:93"
4649
- checkout
4750
- ruby/install-deps
4851
- run:
@@ -53,6 +56,9 @@ jobs:
5356
<<: *default-executor
5457

5558
steps:
59+
- add_ssh_keys:
60+
fingerprints:
61+
- "5a:23:0e:1d:98:0c:04:dc:73:06:5f:c3:19:72:e2:93"
5662
- checkout
5763
- ruby/install-deps
5864
- run:

.github/workflows/release-kickoff.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release new version
2+
3+
on:
4+
workflow_dispatch
5+
6+
permissions:
7+
pull-requests: write
8+
9+
jobs:
10+
release:
11+
name: Release
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
16+
- name: Create PR to push main to release branch
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
run: "gh pr create --title 'chore: kickoff release' --body 'kickoff release' --head main --base release"

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AmplifyUtilsNotifications.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Pod::Spec.new do |spec|
2121
spec.osx.deployment_target = "10.15"
2222
spec.swift_version = "5.6"
2323

24-
spec.source = { :git => "https://github.com/aws-amplify/amplify-swift-utils-notifications.git", :tag => "v#{spec.version}" }
24+
spec.source = { :git => "https://github.com/aws-amplify/amplify-swift-utils-notifications.git", :tag => spec.version }
2525

2626
spec.source_files = "Sources/AmplifyUtilsNotifications/**/*.swift"
2727

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Changelog
22

3-
3+
## Prepare for version 1.0.0

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ source 'https://rubygems.org'
33
gem 'cocoapods', '~> 1.11.3'
44
gem 'fastlane', '~> 2.211'
55
gem 'jazzy', '~> 0.14.3'
6-
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
7-
eval_gemfile(plugins_path) if File.exist?(plugins_path)
6+
eval_gemfile('fastlane/Pluginfile')
7+

Gemfile.lock

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GIT
22
remote: https://github.com/aws-amplify/amplify-ci-support
3-
revision: 8b34bda1805cf89fcdb6fa67038784109ac0100a
3+
revision: 74ed2db1f09d93b48129590bcd17cc9b53251756
44
branch: main
55
glob: src/fastlane/release_actions/*.gemspec
66
specs:
@@ -9,9 +9,9 @@ GIT
99
GEM
1010
remote: https://rubygems.org/
1111
specs:
12-
CFPropertyList (3.0.5)
12+
CFPropertyList (3.0.6)
1313
rexml
14-
activesupport (6.1.7)
14+
activesupport (6.1.7.2)
1515
concurrent-ruby (~> 1.0, >= 1.0.2)
1616
i18n (>= 1.6, < 2)
1717
minitest (>= 5.1)
@@ -25,16 +25,16 @@ GEM
2525
artifactory (3.0.15)
2626
atomos (0.1.3)
2727
aws-eventstream (1.2.0)
28-
aws-partitions (1.660.0)
29-
aws-sdk-core (3.167.0)
28+
aws-partitions (1.708.0)
29+
aws-sdk-core (3.170.0)
3030
aws-eventstream (~> 1, >= 1.0.2)
3131
aws-partitions (~> 1, >= 1.651.0)
3232
aws-sigv4 (~> 1.5)
3333
jmespath (~> 1, >= 1.6.1)
34-
aws-sdk-kms (1.59.0)
34+
aws-sdk-kms (1.62.0)
3535
aws-sdk-core (~> 3, >= 3.165.0)
3636
aws-sigv4 (~> 1.1)
37-
aws-sdk-s3 (1.117.1)
37+
aws-sdk-s3 (1.119.0)
3838
aws-sdk-core (~> 3, >= 3.165.0)
3939
aws-sdk-kms (~> 1)
4040
aws-sigv4 (~> 1.4)
@@ -83,7 +83,7 @@ GEM
8383
colored2 (3.1.2)
8484
commander (4.6.0)
8585
highline (~> 2.0.0)
86-
concurrent-ruby (1.1.10)
86+
concurrent-ruby (1.2.0)
8787
declarative (0.0.20)
8888
digest-crc (0.6.4)
8989
rake (>= 12.0.0, < 14.0.0)
@@ -94,8 +94,8 @@ GEM
9494
escape (0.0.4)
9595
ethon (0.16.0)
9696
ffi (>= 1.15.0)
97-
excon (0.94.0)
98-
faraday (1.10.2)
97+
excon (0.99.0)
98+
faraday (1.10.3)
9999
faraday-em_http (~> 1.0)
100100
faraday-em_synchrony (~> 1.0)
101101
faraday-excon (~> 1.1)
@@ -167,9 +167,9 @@ GEM
167167
fourflusher (2.3.1)
168168
fuzzy_match (2.0.4)
169169
gh_inspector (1.1.3)
170-
google-apis-androidpublisher_v3 (0.31.0)
170+
google-apis-androidpublisher_v3 (0.33.0)
171171
google-apis-core (>= 0.9.1, < 2.a)
172-
google-apis-core (0.9.1)
172+
google-apis-core (0.11.0)
173173
addressable (~> 2.5, >= 2.5.1)
174174
googleauth (>= 0.16.2, < 2.a)
175175
httpclient (>= 2.8.1, < 3.a)
@@ -221,15 +221,15 @@ GEM
221221
sassc (~> 2.1)
222222
sqlite3 (~> 1.3)
223223
xcinvoke (~> 0.3.0)
224-
jmespath (1.6.1)
225-
json (2.6.2)
226-
jwt (2.5.0)
224+
jmespath (1.6.2)
225+
json (2.6.3)
226+
jwt (2.7.0)
227227
liferaft (0.0.6)
228228
memoist (0.16.2)
229-
mini_magick (4.11.0)
229+
mini_magick (4.12.0)
230230
mini_mime (1.1.2)
231-
mini_portile2 (2.8.0)
232-
minitest (5.16.3)
231+
mini_portile2 (2.8.1)
232+
minitest (5.17.0)
233233
molinillo (0.8.0)
234234
multi_json (1.15.0)
235235
multipart-post (2.0.0)
@@ -244,7 +244,7 @@ GEM
244244
plist (3.6.0)
245245
public_suffix (4.0.7)
246246
rake (13.0.6)
247-
redcarpet (3.5.1)
247+
redcarpet (3.6.0)
248248
representable (3.2.0)
249249
declarative (< 0.1.0)
250250
trailblazer-option (>= 0.1.1, < 0.2.0)
@@ -263,10 +263,10 @@ GEM
263263
faraday (>= 0.17.5, < 3.a)
264264
jwt (>= 1.5, < 3.0)
265265
multi_json (~> 1.10)
266-
simctl (1.6.8)
266+
simctl (1.6.10)
267267
CFPropertyList
268268
naturally
269-
sqlite3 (1.5.3)
269+
sqlite3 (1.6.0)
270270
mini_portile2 (~> 2.8.0)
271271
terminal-notifier (2.0.0)
272272
terminal-table (1.8.0)
@@ -278,14 +278,14 @@ GEM
278278
tty-cursor (~> 0.7)
279279
typhoeus (1.4.0)
280280
ethon (>= 0.9.0)
281-
tzinfo (2.0.5)
281+
tzinfo (2.0.6)
282282
concurrent-ruby (~> 1.0)
283283
uber (0.1.0)
284284
unf (0.1.4)
285285
unf_ext
286286
unf_ext (0.0.8.2)
287287
unicode-display_width (1.8.0)
288-
webrick (1.7.0)
288+
webrick (1.8.1)
289289
word_wrap (1.0.0)
290290
xcinvoke (0.3.0)
291291
liferaft (~> 0.0.6)
@@ -312,4 +312,4 @@ DEPENDENCIES
312312
jazzy (~> 0.14.3)
313313

314314
BUNDLED WITH
315-
1.17.2
315+
2.1.2

Sources/AmplifyUtilsNotifications/AUNotificationPermissions.swift

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,17 @@ public class AUNotificationPermissions {
2626

2727
/// Check if notifications are allowed
2828
public static var allowed: Bool {
29+
get async {
30+
await status == .authorized ? true : false
31+
}
32+
}
33+
34+
/// Check the notification permission status
35+
public static var status: UNAuthorizationStatus {
2936
get async {
3037
await withCheckedContinuation { continuation in
3138
UNUserNotificationCenter.current().getNotificationSettings { settings in
32-
continuation.resume(returning: settings.authorizationStatus == .authorized ? true : false)
39+
continuation.resume(returning: settings.authorizationStatus)
3340
}
3441
}
3542
}
@@ -44,11 +51,13 @@ public class AUNotificationPermissions {
4451
options: options
4552
)
4653

47-
if notificationsAllowed {
48-
// Register with Apple Push Notification service
49-
await Application.shared.registerForRemoteNotifications()
50-
}
51-
5254
return notificationsAllowed
5355
}
56+
57+
/// Register device with APNs
58+
public static func registerForRemoteNotifications() async {
59+
await MainActor.run {
60+
Application.shared.registerForRemoteNotifications()
61+
}
62+
}
5463
}

fastlane/Fastfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ platform :ios do
3939
generate_version_bump_commit(version: next_version)
4040
generate_changelog_commit(version: next_version, commits: commits)
4141
create_new_version_tag(version: next_version)
42-
# publish_to_cocoapod_trunk
43-
# sync_up_main_release_branch
42+
publish_to_cocoapod_trunk
43+
sync_up_main_release_branch
4444
end
4545

4646
desc "Generate and publish documentaion for new version"
4747
lane :publish_doc do
4848
new_version = generate_doc
4949
git_add(path: "docs/*")
5050
git_commit(path: "docs/*", message: "chore: update API document for #{new_version} [skip ci]")
51-
# push_to_git_remote(
52-
# local_branch: "release",
53-
# remote_branch: "gh-pages",
54-
# tags: true,
55-
# force: true,
56-
# )
51+
push_to_git_remote(
52+
local_branch: "release",
53+
remote_branch: "gh-pages",
54+
tags: true,
55+
force: true,
56+
)
5757
end
5858

5959
desc "Generate jazzy documentaion"
@@ -97,7 +97,7 @@ platform :ios do
9797
next_version = options[:version]
9898
UI.user_error!("version shouldn't be nil") if next_version.nil?
9999

100-
add_git_tag(tag: "v#{next_version}", grouping: nil)
100+
add_git_tag(tag: next_version, grouping: nil)
101101
end
102102

103103
desc "Publish new version to cocoapod trunck"

0 commit comments

Comments
 (0)