mini_phone 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f62c6d5370c3066ee7a24d8fbb4b6297f3382708f2492ffde4a4637239134064
4
- data.tar.gz: ed947cb56dc592a7aa2be638ca1d59f608ff2ac5b3fab52e573c0ad3bde99306
3
+ metadata.gz: ecd792546c1404a41c162138a718cd788795d891aac24c97ee87b3df382f431e
4
+ data.tar.gz: c77a185fce6abd249a5d0cabf92d718869ac3a99b0eb7c8596f64595582c00a6
5
5
  SHA512:
6
- metadata.gz: d32d5ee76afd3d7ccd526f5854725ab718f45c5c9c0cb03be318e895b87c0fd33af8fefe2f6797320e15bd09e8134c900a783e0354e716e94e3b0d8228bab561
7
- data.tar.gz: e8612f26f40ab9ad5fbbf50d36201f1b2d2411728ef31bf005608029af1cbc4ee427802c68e6a583b0f089ca5fc3306115c5ebae28776ddbc630c35069b7b8dc
6
+ metadata.gz: 99a20b5158402162ee9f2d10732c1d4ec07e18b2395d823ee2e5573059dfbc04c7815102eded133e38958b4b8573290287e9acccba9436be763bc7eb9763dd8f
7
+ data.tar.gz: 54e2043235f832e46a48bd94a9fb01c9e4ac30fc1e34835d9889fb3702bef96282adf5db5f6cce5d62b40ca095d6d4553a8c550465c1a244d882bea9767ae63a
@@ -5,21 +5,21 @@ on: push
5
5
 
6
6
  jobs:
7
7
  build:
8
- runs-on: ubuntu-16.04
9
8
  strategy:
10
9
  fail-fast: false
11
10
  matrix:
12
11
  ruby: ["2.5", "2.6", "2.7"]
13
12
  os: [ubuntu-latest, macos-latest]
14
13
  experimental: [false]
15
- include:
16
- - ruby: "truffleruby"
17
- os: ubuntu-latest
18
- experimental: true
19
- - ruby: "truffleruby"
20
- os: macos-latest
21
- experimental: true
14
+ # include:
15
+ # - ruby: "truffleruby"
16
+ # os: ubuntu-latest
17
+ # experimental: true
18
+ # - ruby: "truffleruby"
19
+ # os: macos-latest
20
+ # experimental: true
22
21
  name: ${{ matrix.ruby }} on ${{ matrix.os }}
22
+ runs-on: ${{ matrix.os }}
23
23
  continue-on-error: ${{ matrix.experimental }}
24
24
  env:
25
25
  CI_EXPERIMENTAL: ${{ matrix.experimental }}
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: Release
3
+
4
+ on:
5
+ push:
6
+ tags:
7
+ - "v*"
8
+
9
+ jobs:
10
+ build:
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ ruby: ["2.7"]
15
+ os: [ubuntu-latest, macos-latest]
16
+ name: ${{ matrix.os }}
17
+ runs-on: ${{ matrix.os }}
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+
21
+ - uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby }}
24
+
25
+ - name: Install dependencies (system)
26
+ if: ${{ matrix.os == 'ubuntu-latest' }}
27
+ run: sudo apt-get -yqq install libphonenumber-dev
28
+
29
+ - name: Install dependencies (system)
30
+ if: ${{ matrix.os == 'macos-latest' }}
31
+ run: brew install --build-from-source libphonenumber && brew link libphonenumber
32
+
33
+ - name: Install dependencies (ruby)
34
+ run: gem install bundler && bundle install --jobs 4 --retry 3
35
+
36
+ - name: Login
37
+ run: |
38
+ mkdir -p ~/.gem
39
+
40
+ cat << EOF > ~/.gem/credentials
41
+ ---
42
+ :github: ${GITHUB_AUTH_TOKEN}
43
+ :rubygems_api_key: ${RUBYGEMS_AUTH_TOKEN}
44
+ EOF
45
+
46
+ chmod 0600 ~/.gem/credentials
47
+ env:
48
+ GITHUB_AUTH_TOKEN: "Bearer ${{secrets.GITHUB_TOKEN}}"
49
+ RUBYGEMS_AUTH_TOKEN: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
50
+ OWNER: ${{ github.repository_owner }}
51
+
52
+ - name: 🛳 Ship it
53
+ run: |
54
+ bundle exec rake publish:native
55
+ bundle exec rake publish:non_native || true
data/.gitignore CHANGED
@@ -15,5 +15,5 @@ mkmf.log
15
15
  # rspec failure tracking
16
16
  .rspec_status
17
17
  Gemfile.lock
18
- vendor/
18
+ vendor/cache/
19
19
  *.gem
data/Rakefile CHANGED
@@ -5,16 +5,17 @@ require 'rspec/core/rake_task'
5
5
  require 'rubygems/package_task'
6
6
  require 'rake/extensiontask'
7
7
 
8
-
9
8
  RSpec::Core::RakeTask.new(:spec)
10
9
 
11
10
  task build: :compile
12
11
 
13
12
  task default: %i[clobber compile spec]
14
13
 
15
- spec = Gem::Specification::load(File.expand_path('../mini_phone.gemspec', __FILE__))
14
+ spec = Gem::Specification.load(File.expand_path('mini_phone.gemspec', __dir__))
16
15
 
17
16
  Gem::PackageTask.new(spec) do |pkg|
17
+ pkg.need_zip = true
18
+ pkg.need_tar = true
18
19
  end
19
20
 
20
21
  Rake::ExtensionTask.new('mini_phone', spec) do |ext|
@@ -26,3 +27,36 @@ task bench: %i[clobber compile] do
26
27
  require_relative f
27
28
  end
28
29
  end
30
+
31
+ task :deploy do
32
+ sh 'code -w ./lib/mini_phone/version.rb'
33
+ version = `ruby -r ./lib/mini_phone/version.rb -e 'print MiniPhone::VERSION'`.strip
34
+ sh "git commit -am 'Bump to v#{version} :confetti_ball:'"
35
+ sh 'bundle exec rake release'
36
+ end
37
+
38
+ namespace :publish do
39
+ def push_to_github_registry(gem)
40
+ puts "Pushing #{gem} to GitHub Package Registry"
41
+ sh "gem push #{gem} --host https://rubygems.pkg.github.com/ianks --key github"
42
+ end
43
+
44
+ def push_to_rubygems(gem)
45
+ puts "Pushing #{gem} to Rubygems"
46
+ sh "gem push #{gem}"
47
+ end
48
+
49
+ task native: %i[native gem] do
50
+ g = "./pkg/mini_phone-#{MiniPhone::VERSION}-#{Gem::Platform.new(RUBY_PLATFORM)}.gem"
51
+
52
+ push_to_github_registry(g)
53
+ push_to_rubygems(g)
54
+ end
55
+
56
+ task non_native: [:gem] do
57
+ g = "./pkg/mini_phone-#{MiniPhone::VERSION}.gem"
58
+
59
+ push_to_github_registry(g)
60
+ push_to_rubygems(g)
61
+ end
62
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MiniPhone
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.3'
5
5
  end
data/mini_phone.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.license = 'MIT'
17
17
  spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
18
18
 
19
- spec.platform = Gem::Platform::RUBY
19
+ spec.platform = Gem::Platform::RUBY
20
20
 
21
21
  # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
22
22
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_phone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ker-Seymer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-04 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Plugs directly in the the Google's native C++ [libphonenumber](https://github.com/google/libphonenumber)
14
14
  for extemely _fast_ and _robust_ phone number parsing, validation, and formatting.
@@ -22,6 +22,7 @@ extra_rdoc_files: []
22
22
  files:
23
23
  - ".clang-format"
24
24
  - ".github/workflows/ci.yml"
25
+ - ".github/workflows/release.yml"
25
26
  - ".gitignore"
26
27
  - ".rspec"
27
28
  - ".rubocop.yml"
@@ -61,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
62
  - !ruby/object:Gem::Version
62
63
  version: '0'
63
64
  requirements: []
64
- rubygems_version: 3.0.3
65
+ rubygems_version: 3.1.2
65
66
  signing_key:
66
67
  specification_version: 4
67
68
  summary: Uses the Google libphonenumber C lib to parse, validate, and format phone