Skip to content

Commit a028335

Browse files
authored
Merge pull request #1460 from WalletConnect/develop
BOM_1.33.1
2 parents ed01485 + cb6e6a1 commit a028335

18 files changed

Lines changed: 173 additions & 85 deletions

File tree

.github/release-drafter.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
commitish: master
12
template: |
23
## What's Changed
34

.github/workflows/ci_github_release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Create Release
1+
name: Create GitHub Release
22

33
on:
44
push:
@@ -19,15 +19,16 @@ jobs:
1919
with:
2020
config-name: release-drafter.yml
2121
env:
22-
GITHUB_TOKEN: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2323

2424
- name: Create GitHub Release
2525
uses: actions/create-release@v1
2626
env:
27-
GITHUB_TOKEN: ${{ secrets.ASSIGN_TO_PROJECT_GITHUB_TOKEN }}
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828
with:
2929
tag_name: ${{ github.ref }}
3030
release_name: ${{ github.ref }}
3131
body: ${{ steps.drafter.outputs.changelog }}
3232
draft: false
33-
prerelease: false
33+
prerelease: false
34+
target_commitish: master

.github/workflows/ci_release_articacts.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,9 @@ jobs:
8383
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
8484
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
8585
run: |
86-
./gradlew closeAndReleaseMultipleRepositories
86+
./gradlew closeAndReleaseMultipleRepositories
87+
- name: Push Tag
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
run: |
91+
./gradlew pushTagToMain

.github/workflows/slack_release_notifications_workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
name: 'Slack Release Notifications'
66
on:
77
release:
8-
types: [ published, edited ]
8+
types: [ published ]
99
jobs:
1010
push-notifications:
1111
runs-on: 'ubuntu-latest'

ReadMe.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies {
2323

2424
| BOM | [Core SDK](core/android) | [Sign SDK](protocol/sign) | [Auth SDK](protocol/auth) | [Chat SDK](protocol/chat) | [Notify SDK](protocol/notify) | [web3wallet](product/web3wallet) | [web3modal](product/web3modal) | [WalletConnectModal](product/walletconnectmodal) |
2525
|-----------------------------------------------------------------------------------------|--------------------------|---------------------------|---------------------------|---------------------------|:------------------------------|----------------------------------|--------------------------------|--------------------------------------------------|
26+
| 1.33.1 | 1.33.1 | 2.33.1 | 1.28.5 | 1.0.0.beta32 | 1.3.6 | 1.33.1 | 1.6.1 | 1.5.6 |
2627
| 1.33.0 | 1.33.0 | 2.33.0 | 1.28.4 | 1.0.0.beta31 | 1.3.5 | 1.33.0 | 1.6.0 | 1.5.5 |
2728
| 1.32.1 | 1.32.0 | 2.32.0 | 1.28.3 | 1.0.0.beta30 | 1.3.4 | 1.32.1 | 1.5.4 | 1.5.4 |
2829
| 1.31.3 | 1.31.2 | 2.31.2 | 1.28.2 | 1.0.0.beta30 | 1.3.2 | 1.31.2 | 1.5.2 | 1.5.2 |

build.gradle.kts

Lines changed: 88 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import com.android.build.gradle.BaseExtension
32
import org.apache.http.client.methods.HttpGet
43
import org.apache.http.client.methods.HttpPost
@@ -131,20 +130,21 @@ tasks.register("closeAndReleaseMultipleRepositories") {
131130
description = "Release all Sonatype staging repositories"
132131

133132
doLast {
134-
val repos = fetchRepositoryIds()
133+
val repos = fetchOpenRepositoryIds()
135134
if (repos.isEmpty()) {
136135
println("No open repositories found")
137136
return@doLast
138137
}
139138
closeRepositories(repos)
140-
waitForAllRepositoriesToClose(repos)
139+
waitForAllRepositoriesToDesireState(repos, "closed")
141140
releaseRepositories(repos)
141+
waitForAllRepositoriesToDesireState(repos, "released")
142+
dropRepositories(repos)
142143
waitForArtifactsToBeAvailable()
143-
//todo task for pushing a tag
144144
}
145145
}
146146

147-
fun fetchRepositoryIds(): List<String> {
147+
fun fetchOpenRepositoryIds(): List<String> {
148148
val client = HttpClients.createDefault()
149149
val httpGet = HttpGet("$nexusUrl/profile_repositories").apply {
150150
setHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString("$nexusUsername:$nexusPassword".toByteArray()))
@@ -189,9 +189,36 @@ fun closeRepositories(repoIds: List<String>) {
189189
}
190190
""".trimIndent()
191191
executePostRequest(closeUrl, json)
192+
println("Closed repositories: ${repoIds.joinToString(", ")}")
192193
}
193194

194-
fun waitForAllRepositoriesToClose(repoIds: List<String>) {
195+
fun releaseRepositories(repoIds: List<String>) {
196+
val releaseUrl = "$nexusUrl/bulk/promote"
197+
val json = """
198+
{
199+
"data": {
200+
"stagedRepositoryIds": ${repoIds.joinToString(prefix = "[\"", separator = "\",\"", postfix = "\"]")}
201+
}
202+
}
203+
""".trimIndent()
204+
println("Released repositories: ${repoIds.joinToString(", ")}")
205+
executePostRequest(releaseUrl, json)
206+
}
207+
208+
fun dropRepositories(repoIds: List<String>) {
209+
val dropUrl = "$nexusUrl/bulk/drop"
210+
val json = """
211+
{
212+
"data": {
213+
"stagedRepositoryIds": ${repoIds.joinToString(prefix = "[\"", separator = "\",\"", postfix = "\"]")}
214+
}
215+
}
216+
""".trimIndent()
217+
executePostRequest(dropUrl, json)
218+
println("Dropped repositories: ${repoIds.joinToString(", ")}")
219+
}
220+
221+
fun waitForAllRepositoriesToDesireState(repoIds: List<String>, desireState: String) {
195222
val client = HttpClients.createDefault()
196223
val statusUrl = "$nexusUrl/repository/"
197224
val closedRepos = mutableSetOf<String>()
@@ -207,11 +234,11 @@ fun waitForAllRepositoriesToClose(repoIds: List<String>) {
207234
val responseBody = EntityUtils.toString(response.entity)
208235

209236
val state = parseRepositoryState(responseBody, repoId)
210-
if (state == "closed") {
237+
if (state == desireState) {
211238
println("Repository $repoId is now in state: $state")
212239
closedRepos.add(repoId)
213240
} else {
214-
println("Waiting for repository $repoId to be closed, current state: $state")
241+
println("Waiting for repository $repoId to be $desireState, current state: $state")
215242
}
216243
}
217244
}
@@ -221,37 +248,50 @@ fun waitForAllRepositoriesToClose(repoIds: List<String>) {
221248
}
222249
}
223250

224-
fun releaseRepositories(repoIds: List<String>) {
225-
val releaseUrl = "$nexusUrl/bulk/promote"
226-
val json = """
227-
{
228-
"data": {
229-
"stagedRepositoryIds": ${repoIds.joinToString(prefix = "[\"", separator = "\",\"", postfix = "\"]")}
230-
}
231-
}
232-
""".trimIndent()
233-
executePostRequest(releaseUrl, json)
234-
}
235-
236251
fun waitForArtifactsToBeAvailable() {
252+
val repoIds: List<String> = repoIdWithVersion.map { it.first }
237253
val client = HttpClients.createDefault()
238-
var artifactsAvailable = false
239-
240-
while (!artifactsAvailable) {
241-
artifactsAvailable = repoIdWithVersion.all { (repoId, version) ->
242-
val artifactUrl = "https://repo1.maven.org/maven2/com/walletconnect/$repoId/$version/"
243-
val httpGet = HttpGet(artifactUrl)
244-
val response = client.execute(httpGet)
245-
response.statusLine.statusCode == 200
254+
val artifactUrls = repoIdWithVersion.map { (repoId, version) ->
255+
println("Checking: https://repo1.maven.org/maven2/com/walletconnect/$repoId/$version/")
256+
"https://repo1.maven.org/maven2/com/walletconnect/$repoId/$version/"
257+
}
258+
val maxRetries = 20
259+
var attempt = 0
260+
val availableRepos = mutableSetOf<String>()
261+
262+
while (availableRepos.size < repoIds.size && attempt < maxRetries) {
263+
artifactUrls.forEachIndexed { index, artifactUrl ->
264+
if (!availableRepos.contains(repoIds[index])) {
265+
val httpGet = HttpGet(artifactUrl)
266+
try {
267+
val response = client.execute(httpGet)
268+
val statusCode = response.statusLine.statusCode
269+
EntityUtils.consume(response.entity) // Ensure the response is fully consumed
270+
if (statusCode == 200 || statusCode == 201) {
271+
println("Artifact for repository ${repoIds[index]} is now available.")
272+
availableRepos.add(repoIds[index])
273+
} else {
274+
println("Artifact for repository ${repoIds[index]} not yet available. Status code: $statusCode")
275+
}
276+
} catch (e: Exception) {
277+
println("Error checking artifact for repository ${repoIds[index]}: ${e.message}")
278+
} finally {
279+
httpGet.releaseConnection() // Ensure the connection is released
280+
}
281+
}
246282
}
247-
248-
if (!artifactsAvailable) {
249-
println("Artifacts not yet available. Waiting...")
250-
Thread.sleep(30000) // Wait for 30 seconds before retrying
251-
} else {
252-
println("All artifacts are now available.")
283+
if (availableRepos.size < repoIds.size) {
284+
println("Waiting for artifacts to be available... Attempt: ${attempt + 1}")
285+
attempt++
286+
Thread.sleep(10000) // Wait for 10 seconds before retrying
253287
}
254288
}
289+
290+
if (availableRepos.size < repoIds.size) {
291+
throw RuntimeException("Artifacts were not available after ${maxRetries * 10} seconds.")
292+
} else {
293+
println("All artifacts are now available.")
294+
}
255295
}
256296

257297
fun executePostRequest(url: String, json: String) {
@@ -287,6 +327,20 @@ fun parseRepositoryState(xmlResponse: String, repositoryId: String): String? {
287327
return null
288328
}
289329

330+
tasks.register<Exec>("createTag") {
331+
val tagName = "BOM_$BOM_VERSION"
332+
commandLine("git", "tag", tagName)
333+
}
334+
335+
tasks.register<Exec>("pushTagToMain") {
336+
val tagName = "BOM_$BOM_VERSION"
337+
val repoUrl = "https://github.com/WalletConnect/WalletConnectKotlinV2.git"
338+
val token = System.getenv("GITHUB_TOKEN") ?: throw GradleException("GITHUB_TOKEN environment variable is not set")
339+
dependsOn("createTag")
340+
val authenticatedRepoUrl = repoUrl.replace("https://", "https://$token:@")
341+
commandLine("git", "push", authenticatedRepoUrl, tagName, "refs/heads/main")
342+
}
343+
290344
private val repoIdWithVersion = listOf(
291345
Pair(ANDROID_BOM, BOM_VERSION),
292346
Pair(FOUNDATION, FOUNDATION_VERSION),

buildSrc/src/main/kotlin/Versions.kt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ const val KEY_PUBLISH_ARTIFACT_ID = "PUBLISH_ARTIFACT_ID"
55
const val KEY_SDK_NAME = "SDK_NAME"
66

77
//Latest versions
8-
const val BOM_VERSION = "1.33.0"
9-
const val FOUNDATION_VERSION = "1.17.3"
10-
const val CORE_VERSION = "1.33.0"
11-
const val SIGN_VERSION = "2.33.0"
12-
const val AUTH_VERSION = "1.28.4"
13-
const val CHAT_VERSION = "1.0.0-beta31"
14-
const val NOTIFY_VERSION = "1.3.5"
15-
const val WEB_3_WALLET_VERSION = "1.33.0"
16-
const val WEB_3_MODAL_VERSION = "1.6.0"
17-
const val WC_MODAL_VERSION = "1.5.5"
18-
const val MODAL_CORE_VERSION = "1.6.0"
8+
const val BOM_VERSION = "1.33.1"
9+
const val FOUNDATION_VERSION = "1.17.4"
10+
const val CORE_VERSION = "1.33.1"
11+
const val SIGN_VERSION = "2.33.1"
12+
const val AUTH_VERSION = "1.28.5"
13+
const val CHAT_VERSION = "1.0.0-beta32"
14+
const val NOTIFY_VERSION = "1.3.6"
15+
const val WEB_3_WALLET_VERSION = "1.33.1"
16+
const val WEB_3_MODAL_VERSION = "1.6.1"
17+
const val WC_MODAL_VERSION = "1.5.6"
18+
const val MODAL_CORE_VERSION = "1.6.1"
1919

2020
//Artifact ids
2121
const val ANDROID_BOM = "android-bom"

core/android/src/main/kotlin/com/walletconnect/android/internal/common/di/AndroidCommonDITags.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.walletconnect.android.internal.common.di
33
enum class AndroidCommonDITags {
44
MOSHI,
55
SHARED_INTERCEPTOR,
6-
FAIL_OVER_INTERCEPTOR,
76
LOGGING_INTERCEPTOR,
87
AUTHENTICATOR,
98
OK_HTTP,

core/android/src/main/kotlin/com/walletconnect/android/internal/common/di/BaseStorageModule.kt

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,6 @@ import org.koin.dsl.module
2929
import com.walletconnect.android.internal.common.scope as wcScope
3030

3131
fun baseStorageModule(storagePrefix: String = String.Empty, bundleId: String) = module {
32-
33-
fun Scope.createCoreDB(): AndroidCoreDatabase = AndroidCoreDatabase(
34-
driver = get(named(AndroidBuildVariantDITags.ANDROID_CORE_DATABASE_DRIVER)),
35-
MetaDataAdapter = MetaData.Adapter(
36-
iconsAdapter = get(named(AndroidCommonDITags.COLUMN_ADAPTER_LIST)),
37-
typeAdapter = get(named(AndroidCommonDITags.COLUMN_ADAPTER_APPMETADATATYPE))
38-
),
39-
VerifyContextAdapter = VerifyContext.Adapter(
40-
validationAdapter = get(named(AndroidCommonDITags.COLUMN_ADAPTER_VALIDATION))
41-
),
42-
EventDaoAdapter = EventDao.Adapter(
43-
traceAdapter = get(named(AndroidCommonDITags.COLUMN_ADAPTER_LIST))
44-
),
45-
JsonRpcHistoryDaoAdapter = JsonRpcHistoryDao.Adapter(
46-
transport_typeAdapter = get(named(AndroidCommonDITags.COLUMN_ADAPTER_TRANSPORT_TYPE))
47-
)
48-
)
49-
5032
single<ColumnAdapter<List<String>, String>>(named(AndroidCommonDITags.COLUMN_ADAPTER_LIST)) {
5133
object : ColumnAdapter<List<String>, String> {
5234
override fun decode(databaseValue: String): List<String> =
@@ -82,6 +64,23 @@ fun baseStorageModule(storagePrefix: String = String.Empty, bundleId: String) =
8264

8365
single<ColumnAdapter<Validation, String>>(named(AndroidCommonDITags.COLUMN_ADAPTER_VALIDATION)) { EnumColumnAdapter() }
8466

67+
fun Scope.createCoreDB(): AndroidCoreDatabase = AndroidCoreDatabase(
68+
driver = get(named(AndroidBuildVariantDITags.ANDROID_CORE_DATABASE_DRIVER)),
69+
MetaDataAdapter = MetaData.Adapter(
70+
iconsAdapter = get(named(AndroidCommonDITags.COLUMN_ADAPTER_LIST)),
71+
typeAdapter = get(named(AndroidCommonDITags.COLUMN_ADAPTER_APPMETADATATYPE))
72+
),
73+
VerifyContextAdapter = VerifyContext.Adapter(
74+
validationAdapter = get(named(AndroidCommonDITags.COLUMN_ADAPTER_VALIDATION))
75+
),
76+
EventDaoAdapter = EventDao.Adapter(
77+
traceAdapter = get(named(AndroidCommonDITags.COLUMN_ADAPTER_LIST))
78+
),
79+
JsonRpcHistoryDaoAdapter = JsonRpcHistoryDao.Adapter(
80+
transport_typeAdapter = get(named(AndroidCommonDITags.COLUMN_ADAPTER_TRANSPORT_TYPE))
81+
)
82+
)
83+
8584
single<AndroidCoreDatabase>(named(AndroidBuildVariantDITags.ANDROID_CORE_DATABASE)) {
8685
try {
8786
createCoreDB().also { database ->

foundation/src/test/kotlin/com/walletconnect/foundation/RelayTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ sealed class TestState {
4242
@ExperimentalCoroutinesApi
4343
class RelayTest {
4444
private val testProjectId: String = requireNotNull(System.getProperty("TEST_PROJECT_ID"))
45-
private val testRelayUrl: String = "https://staging.relay.walletconnect.org"
45+
private val testRelayUrl: String = requireNotNull(System.getProperty("TEST_RELAY_URL"))
4646
private val serverUrl = "$testRelayUrl?projectId=$testProjectId"
4747
private val sdkVersion: String = System.getProperty("SDK_VERSION") + "-relayTest"
4848
private val testJob: CompletableJob = SupervisorJob()
@@ -97,7 +97,7 @@ class RelayTest {
9797
runBlocking {
9898
val start = System.currentTimeMillis()
9999
// Await test finish or check if timeout occurred
100-
while (testState.value is TestState.Idle && !didTimeout(start, 20000L)) {
100+
while (testState.value is TestState.Idle && !didTimeout(start, 60000L)) {
101101
delay(10)
102102
}
103103

@@ -138,7 +138,7 @@ class RelayTest {
138138
runBlocking {
139139
val start = System.currentTimeMillis()
140140
// Await test finish or check if timeout occurred
141-
while (testState.value is TestState.Idle && !didTimeout(start, 10000L)) {
141+
while (testState.value is TestState.Idle && !didTimeout(start, 60000L)) {
142142
delay(10)
143143
}
144144

0 commit comments

Comments
 (0)