Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Cocoapods release #756

Merged
merged 6 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
# it takes pull request name
# and automatically commit it as a package version
# pull request name should always be a version of a new release
#
# After version bump publishing Cocoapods release

name: set-user-agent
name: cd

on:
pull_request:
Expand All @@ -18,6 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}

- name: Set User Agent
Expand All @@ -27,4 +30,12 @@ jobs:
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Set User Agent
tagging_message: ${{ github.event.pull_request.title }}
skip_checkout: true

- name: Publish to CocoaPod register
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
pod trunk push WalletConnectSwiftV2.podspec --verbose --allow-warnings

1 change: 1 addition & 0 deletions Sources/WalletConnectIdentity/IdentityImports.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if !CocoaPods
@_exported import WalletConnectNetworking
@_exported import WalletConnectJWT
#endif
2 changes: 1 addition & 1 deletion Sources/WalletConnectIdentity/IdentityKeyAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ enum IdentityKeyAPI: HTTPService {
}
}

var method: WalletConnectNetworking.HTTPMethod {
var method: HTTPMethod {
switch self {
case .registerIdentity, .registerInvite:
return .post
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

struct AuthPayload: JWTClaimsCodable {
struct RelayAuthPayload: JWTClaimsCodable {

struct Wrapper: JWTWrapper {
let jwtString: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct SocketAuthenticator: SocketAuthenticating {

func createAuthToken() throws -> String {
let keyPair = try clientIdStorage.getOrCreateKeyPair()
let payload = AuthPayload(subject: getSubject(), audience: getAudience())
let payload = RelayAuthPayload(subject: getSubject(), audience: getAudience())
return try payload.signAndCreateWrapper(keyPair: keyPair).jwtString
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/WalletConnectRelay/PackageConfig.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version": "1.5.1"}
{"version": "1.5.3"}
2 changes: 0 additions & 2 deletions Sources/WalletConnectRelay/RPC/Methods/Subscription.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

import Foundation
import WalletConnectUtils

struct Subscription: RelayRPC {

Expand Down
2 changes: 1 addition & 1 deletion Tests/RelayerTests/AuthTests/EdDSASignerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class EdDSASignerTests: XCTestCase {
let signingKey = try! SigningPrivateKey(rawRepresentation: keyRaw)
sut = EdDSASigner(signingKey)
let header = try! JWTHeader(alg: "EdDSA").encode()
let claims = try! AuthPayload.Claims.stub().encode()
let claims = try! RelayAuthPayload.Claims.stub().encode()
let signature = try! sut.sign(header: header, claims: claims)
XCTAssertNotNil(signature)
}
Expand Down
8 changes: 4 additions & 4 deletions Tests/RelayerTests/AuthTests/JWTTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ final class JWTTests: XCTestCase {
let expectedJWT = "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NTY5MTAwOTcsImV4cCI6MTY1Njk5NjQ5NywiaXNzIjoiZGlkOmtleTp6Nk1rb2RIWnduZVZSU2h0YUxmOEpLWWt4cERHcDF2R1pucEdtZEJwWDhNMmV4eEgiLCJzdWIiOiJjNDc5ZmU1ZGM0NjRlNzcxZTc4YjE5M2QyMzlhNjViNThkMjc4Y2FkMWMzNGJmYjBiNTcxNmU1YmI1MTQ5MjhlIiwiYXVkIjoid3NzOi8vcmVsYXkud2FsbGV0Y29ubmVjdC5jb20ifQ.0JkxOM-FV21U7Hk-xycargj_qNRaYV2H5HYtE4GzAeVQYiKWj7YySY5AdSqtCgGzX4Gt98XWXn2kSr9rE1qvCA"

func testJWTEncoding() {
var jwt = JWT(claims: AuthPayload.Claims.stub())
var jwt = JWT(claims: RelayAuthPayload.Claims.stub())
let signer = EdDSASignerMock()
signer.signature = "0JkxOM-FV21U7Hk-xycargj_qNRaYV2H5HYtE4GzAeVQYiKWj7YySY5AdSqtCgGzX4Gt98XWXn2kSr9rE1qvCA"
try! jwt.sign(using: signer)
Expand All @@ -16,8 +16,8 @@ final class JWTTests: XCTestCase {
}
}

extension AuthPayload.Claims {
static func stub() -> AuthPayload.Claims {
extension RelayAuthPayload.Claims {
static func stub() -> RelayAuthPayload.Claims {
let iss = "did:key:z6MkodHZwneVRShtaLf8JKYkxpDGp1vGZnpGmdBpX8M2exxH"
let sub = "c479fe5dc464e771e78b193d239a65b58d278cad1c34bfb0b5716e5bb514928e"
let iatDate = Date(timeIntervalSince1970: 1656910097)
Expand All @@ -27,6 +27,6 @@ extension AuthPayload.Claims {
let aud = "wss://relay.walletconnect.com"
let expDate = Calendar.current.date(byAdding: components, to: iatDate)!
let exp = UInt64(expDate.timeIntervalSince1970)
return AuthPayload.Claims(iss: iss, sub: sub, aud: aud, iat: iat, exp: exp)
return RelayAuthPayload.Claims(iss: iss, sub: sub, aud: aud, iat: iat, exp: exp)
}
}
20 changes: 19 additions & 1 deletion WalletConnectSwiftV2.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Pod::Spec.new do |spec|
spec.subspec 'WalletConnectAuth' do |ss|
ss.source_files = 'Sources/Auth/**/*.{h,m,swift}'
ss.dependency 'WalletConnectSwiftV2/WalletConnectPairing'
ss.dependency 'WalletConnectSwiftV2/WalletConnectSigner'
end

spec.subspec 'Web3Wallet' do |ss|
Expand All @@ -92,7 +93,24 @@ Pod::Spec.new do |spec|

spec.subspec 'WalletConnectChat' do |ss|
ss.source_files = 'Sources/Chat/**/*.{h,m,swift}'
ss.dependency 'WalletConnectSwiftV2/WalletConnectSigner'
ss.dependency 'WalletConnectSwiftV2/WalletConnectIdentity'
end

spec.subspec 'WalletConnectSigner' do |ss|
ss.source_files = 'Sources/WalletConnectSigner/**/*.{h,m,swift}'
ss.dependency 'WalletConnectSwiftV2/WalletConnectNetworking'
end

spec.subspec 'WalletConnectIdentity' do |ss|
ss.source_files = 'Sources/WalletConnectIdentity/**/*.{h,m,swift}'
ss.dependency 'WalletConnectSwiftV2/WalletConnectNetworking'
ss.dependency 'WalletConnectSwiftV2/WalletConnectJWT'
end

spec.subspec 'WalletConnectJWT' do |ss|
ss.source_files = 'Sources/WalletConnectJWT/**/*.{h,m,swift}'
ss.dependency 'WalletConnectSwiftV2/WalletConnectKMS'
end

spec.subspec 'WalletConnectNetworking' do |ss|
Expand All @@ -117,7 +135,7 @@ Pod::Spec.new do |spec|

spec.subspec 'WalletConnectRelay' do |ss|
ss.source_files = 'Sources/WalletConnectRelay/**/*.{h,m,swift}'
ss.dependency 'WalletConnectSwiftV2/WalletConnectKMS'
ss.dependency 'WalletConnectSwiftV2/WalletConnectJWT'
ss.resource_bundles = {
'WalletConnect_WalletConnectRelay' => [
'Sources/WalletConnectRelay/PackageConfig.json'
Expand Down