Skip to content

Commit 1cce100

Browse files
author
Houn
committed
2.1.23
1 parent b542fcc commit 1cce100

File tree

12 files changed

+69
-34
lines changed

12 files changed

+69
-34
lines changed

particle-aa/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 2.1.23
2+
13
## 2.1.22
24

35
## 2.1.21

particle-aa/example/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ dependencies:
2727
# the parent directory to use the current plugin's version.
2828
path: ../
2929

30-
particle_connect: ^2.1.22
31-
particle_base: ^2.1.22
32-
particle_auth_core: ^2.1.22
30+
particle_connect: ^2.1.23
31+
particle_base: ^2.1.23
32+
particle_auth_core: ^2.1.23
3333
# particle_auth_core: ^2.0.0
3434
# path: ../../particle-auth-core/
3535
# particle_connect: ^2.0.0

particle-aa/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: particle_aa
22
description: A flutter plugin project for particle aa
3-
version: 2.1.22
3+
version: 2.1.23
44
homepage: https://particle.network
55

66
environment:
@@ -12,7 +12,7 @@ dependencies:
1212
sdk: flutter
1313
plugin_platform_interface: ^2.1.6
1414

15-
particle_base: ^2.1.22
15+
particle_base: ^2.1.23
1616

1717
# particle_base: ^2.0.0
1818
# path: ../particle-base/

particle-auth-core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 2.1.23
2+
13
## 2.1.22
24

35
## 2.1.21

particle-auth-core/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: particle_auth_core
22
description: A flutter plugin project for particle auth core
3-
version: 2.1.22
3+
version: 2.1.23
44
homepage: https://particle.network
55

66
environment:
@@ -11,7 +11,7 @@ dependencies:
1111
flutter:
1212
sdk: flutter
1313
plugin_platform_interface: ^2.1.6
14-
particle_base: ^2.1.22
14+
particle_base: ^2.1.23
1515
# particle_base: ^2.0.0
1616
# path: ../particle-base/
1717

particle-base/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 2.1.23
2+
13
## 2.1.22
24

35
## 2.1.21

particle-base/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: particle_base
22
description: A flutter plugin project for particle base
3-
version: 2.1.22
3+
version: 2.1.23
44
homepage: https://particle.network
55

66
environment:

particle-connect/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 2.1.23
2+
13
## 2.1.22
24

35
## 2.1.21

particle-connect/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: particle_connect
22
description: A flutter plugin project for particle connect
3-
version: 2.1.22
3+
version: 2.1.23
44
homepage: https://particle.network/
55

66
environment:
@@ -11,8 +11,8 @@ dependencies:
1111
flutter:
1212
sdk: flutter
1313
plugin_platform_interface: ^2.1.6
14-
particle_base: ^2.1.22
15-
particle_auth_core: ^2.1.22
14+
particle_base: ^2.1.23
15+
particle_auth_core: ^2.1.23
1616
# particle_base: ^2.0.0
1717
# path: ../particle-base/
1818
# particle_auth_core: ^2.0.0

particle-wallet/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 2.1.23
2+
13
## 2.1.22
24

35
## 2.1.21

particle-wallet/pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: particle_wallet
22
description: A flutter plugin project for particle wallet
3-
version: 2.1.22
3+
version: 2.1.23
44
homepage: https://particle.network
55

66
environment:
@@ -10,9 +10,9 @@ environment:
1010
dependencies:
1111
flutter:
1212
sdk: flutter
13-
particle_connect: ^2.1.22
14-
particle_auth_core: ^2.1.22
15-
particle_base: ^2.1.22
13+
particle_connect: ^2.1.23
14+
particle_auth_core: ^2.1.23
15+
particle_base: ^2.1.23
1616

1717
plugin_platform_interface: ^2.1.6
1818

pub.py

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import os
2+
import requests
23
import subprocess
34
import time
45

56
class ParticleBase:
67
def update_pubspec_dependency(self, version):
7-
# Read the original pubspec.yaml file content
88
with open('pubspec.yaml', 'r') as file:
99
lines = file.readlines()
1010

11-
# Find the particle_auth dependency and update the version number
1211
updated_lines = []
1312
for line in lines:
1413
if line.strip().startswith('#'):
@@ -22,7 +21,6 @@ def update_pubspec_dependency(self, version):
2221
else:
2322
updated_lines.append(line)
2423

25-
# Write the updated content back to the file
2624
with open('pubspec.yaml', 'w') as file:
2725
file.writelines(updated_lines)
2826

@@ -35,7 +33,6 @@ def replace_version(self):
3533
with open(self.pubspec_path, 'r') as file:
3634
lines = file.readlines()
3735

38-
# Modify the third line
3936
lines[2] = f'version: {self.version}\n'
4037

4138
with open(self.pubspec_path, 'w') as file:
@@ -45,9 +42,7 @@ def add_to_changelog(self):
4542
with open(self.changelog_path, 'r') as file:
4643
lines = file.readlines()
4744

48-
# Check if the first line contains the new version number
4945
if f'## {self.version}\n' not in lines:
50-
# Add new version information to the first line
5146
lines.insert(0, f'## {self.version}\n\n')
5247

5348
with open(self.changelog_path, 'w') as file:
@@ -82,11 +77,6 @@ def publish(self):
8277
self.flutter_publish()
8378
self.close()
8479

85-
def publish_dry_run(self):
86-
self.prepare()
87-
self.flutter_publish_dry_run()
88-
self.close()
89-
9080

9181
class ParticleConnect(ParticleBase):
9282
def __init__(self, version):
@@ -134,7 +124,6 @@ def self_prepare(self):
134124
def publish(self):
135125
self.prepare()
136126
self.self_prepare()
137-
138127
self.flutter_get()
139128
self.flutter_publish()
140129
self.close()
@@ -151,32 +140,68 @@ def self_prepare(self):
151140
def publish(self):
152141
self.prepare()
153142
self.self_prepare()
154-
155143
self.flutter_get()
156144
self.flutter_publish()
157145
self.close()
158146

159147

148+
def is_package_published(package_name, version):
149+
"""
150+
Check if a package version is published on pub.dev.
151+
"""
152+
try:
153+
url = f"https://pub.dev/api/packages/{package_name}"
154+
response = requests.get(url)
155+
response.raise_for_status()
156+
157+
package_data = response.json()
158+
latest = package_data.get('latest', {})
159+
latest_version = latest.get('version')
160+
print('latest_version:',latest_version)
161+
if latest_version == version:
162+
print(f"✅ {package_name} version {version} is published!")
163+
return True
164+
else:
165+
print(f"❌ {package_name} version {version} is not published yet.")
166+
return False
167+
except requests.RequestException as e:
168+
print(f"Error checking package publication: {e}")
169+
return False
170+
171+
172+
def wait_until_published(package_name, version):
173+
"""
174+
Wait until the package version is published.
175+
"""
176+
while not is_package_published(package_name, version):
177+
print(f"Waiting for {package_name} version {version} to be published...")
178+
time.sleep(10) # Wait 10 seconds before checking again
179+
180+
160181
if __name__ == "__main__":
161-
version = '2.1.22'
162-
sleep_time = 60
182+
version = '2.1.23'
183+
163184
print("Base Start")
164185
ParticleAuth(version).publish()
186+
wait_until_published("particle_base", version)
165187
print("Base Finish")
166-
time.sleep(sleep_time)
188+
167189
print("AuthCore Start")
168190
ParticleAuthCore(version).publish()
191+
wait_until_published("particle_auth_core", version)
169192
print("AuthCore Finish")
170-
time.sleep(sleep_time)
193+
171194
print("Connect Start")
172195
ParticleConnect(version).publish()
196+
wait_until_published("particle_connect", version)
173197
print("Connect Finish")
174-
time.sleep(sleep_time)
175198

176199
print("ParticleAA Start")
177200
ParticleAA(version).publish()
201+
wait_until_published("particle_aa", version)
178202
print("ParticleAA Finish")
179-
time.sleep(sleep_time)
203+
180204
print("ParticleWallet Start")
181205
ParticleWallet(version).publish()
206+
wait_until_published("particle_wallet", version)
182207
print("ParticleWallet Finish")

0 commit comments

Comments
 (0)