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 +4 -4
- data/.github/workflows/ci.yml +8 -8
- data/.github/workflows/release.yml +55 -0
- data/.gitignore +1 -1
- data/Rakefile +36 -2
- data/lib/mini_phone/version.rb +1 -1
- data/mini_phone.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecd792546c1404a41c162138a718cd788795d891aac24c97ee87b3df382f431e
|
4
|
+
data.tar.gz: c77a185fce6abd249a5d0cabf92d718869ac3a99b0eb7c8596f64595582c00a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99a20b5158402162ee9f2d10732c1d4ec07e18b2395d823ee2e5573059dfbc04c7815102eded133e38958b4b8573290287e9acccba9436be763bc7eb9763dd8f
|
7
|
+
data.tar.gz: 54e2043235f832e46a48bd94a9fb01c9e4ac30fc1e34835d9889fb3702bef96282adf5db5f6cce5d62b40ca095d6d4553a8c550465c1a244d882bea9767ae63a
|
data/.github/workflows/ci.yml
CHANGED
@@ -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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
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
|
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
|
data/lib/mini_phone/version.rb
CHANGED
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
|
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.
|
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-
|
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.
|
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
|