Skip to content

Commit

Permalink
updated podspec and deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
ypopovych committed Aug 11, 2023
1 parent e3e9a2f commit af241cf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 34 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ jobs:
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_14.0.app
- name: Publish Pod
run: pod trunk push --allow-warnings
run: |
sed -i '' "s|[[:blank:]]*s\.version[[:blank:]].*|s.version = '${VERSION}'|g" ScaleCodec.podspec
pod trunk push --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
VERSION: ${{ github.event.release.tag_name }}

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription

let package = Package(
name: "ScaleCodec",
platforms: [.macOS(.v10_12), .iOS(.v10), .tvOS(.v10), .watchOS(.v6)],
platforms: [.macOS(.v10_13), .iOS(.v11), .tvOS(.v11), .watchOS(.v6)],
products: [
.library(
name: "ScaleCodec",
Expand Down
19 changes: 0 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,6 @@ assert(compact == UInt64(1 << 32))
// let compact = try decode(Compact<UInt64>.self, from: data).value
```

#### Int[128-1024] and UInt[128-1024]

`Int[128-1024]` and `UInt[128-1024]` types implemented with `DoubleWidth` Swift type from Apple. It works fine for 128-256 bits but slow for 512-1024 bits.

```Swift
import ScaleCodec

let data = Data([
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
])

let encoded = try encode(UInt128(UInt256(2)^128 - 1))
assert(encoded == data))

let compact = try decode(UInt128.self, from: data)
assert(compact == UInt128(UInt256(2)^128 - 1))
```

#### Data fixed encoding

`Data` type can be encoded with fixed encoding. In this mode data length will not be stored so length should be provided manually.
Expand Down
23 changes: 10 additions & 13 deletions ScaleCodec.podspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Pod::Spec.new do |s|
s.name = 'ScaleCodec'
s.version = '0.3.0'
s.version = '999.99.9'
s.summary = 'SCALE codec implementation for Swift language'

s.description = <<-DESC
SCALE codec implementation for Swift language. Supports all SCALE standard types.
SCALE codec implementation for Swift language. Supports all SCALE standard types.
DESC

s.homepage = 'https://github.com/tesseract-one/ScaleCodec.swift'
Expand All @@ -13,21 +13,18 @@ SCALE codec implementation for Swift language. Supports all SCALE standard types
s.author = { 'Tesseract Systems, Inc.' => '[email protected]' }
s.source = { :git => 'https://github.com/tesseract-one/ScaleCodec.swift.git', :tag => s.version.to_s }

s.ios.deployment_target = '10.0'
s.osx.deployment_target = '10.12'
s.tvos.deployment_target = '10.0'
s.watchos.deployment_target = '6.0'
s.swift_version = '5.4'
s.module_name = 'ScaleCodec'

s.swift_version = '5.4'
base_platforms = { :ios => '11.0', :osx => '10.13', :tvos => '11.0' }
s.platforms = base_platforms.merge({ :watchos => '6.0' })

s.module_name = 'ScaleCodec'
s.source_files = 'Sources/ScaleCodec/**/*.swift'

s.dependency 'Tuples', '~> 0.1.0'

s.source_files = 'Sources/ScaleCodec/**/*.swift', 'Sources/DoubleWidth/*.swift'

s.test_spec 'Tests' do |test_spec|
test_spec.platforms = {:ios => '10.0', :osx => '10.12', :tvos => '10.0'}
test_spec.source_files = 'Tests/ScaleCodecTests/**/*.swift', 'Tests/DoubleWidthTests/DoubleWidthTests.swift'
s.test_spec 'Tests' do |ts|
ts.platforms = base_platforms
ts.source_files = 'Tests/ScaleCodecTests/**/*.swift'
end
end

0 comments on commit af241cf

Please sign in to comment.