domain_name 0.6.20240107 → 0.6.20260902

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: 712047d02b4fa86805be0e9e3cf64e0725d8e7bc7396a8cc02eaee0fb47cc1c4
4
- data.tar.gz: 24661d27286d2533fd25b733c4e72364eb99e1fee2ef7643d811479f7b6c7345
3
+ metadata.gz: d5d11ea994a88b334145fb6b5fe345482f2b02de62d6b68563d1ec567a0a5790
4
+ data.tar.gz: 6d20356ebf416a4e69dd7a79e51fd423b1d77eff8e8a4af1147b542effeae5c7
5
5
  SHA512:
6
- metadata.gz: 1184c28247f223ff9e9faa143cf3063d17dcc16cae63df8b4d2436bec516c32d037d1e8fd90314297064f5bb650f2e355daafa91d388d7120b39016f024a4478
7
- data.tar.gz: 118da88bb79a0a7471e8d3d7edc42d29aa6f58af9791ea2894aef602d1d4bbc8c6d923576c47deb5ea6656928747ea5553c6d0544dd7371506f20eb53d96ff42
6
+ metadata.gz: ef143d11ca67f6c1953bded7e3227316f21b0d088f816030010e8ec7d08c55114ba87227ebff3ef6eb9fadcd91e18f3056892e90ece57c81025c8110a4b3c9b7
7
+ data.tar.gz: 5de667e7ff0aa5957014d1e7cb28e5ba22f7b135e9c29d9d22d7c0a410824e8b652f6260358f6afb39edfc52b336e0587d5617ae6bb9cd202648b99e576c2c52
@@ -0,0 +1,28 @@
1
+ queue_rules:
2
+ - name: dependency-updates
3
+ batch_size: 5
4
+ batch_max_wait_time: 10 min
5
+ checks_timeout: auto
6
+ merge_method: merge-batch
7
+ queue_conditions:
8
+ - base = master
9
+ - author ~= ^(dependabot|renovate)\[bot\]$
10
+ - label != dependencies:major
11
+ - -draft
12
+ - -conflict
13
+ - "#approved-reviews-by >= 1"
14
+ - check-success = Test
15
+ merge_conditions:
16
+ - "#approved-reviews-by >= 1"
17
+ - check-success = Test
18
+
19
+ merge_protections_settings:
20
+ auto_merge_conditions:
21
+ - base = master
22
+ - author ~= ^(dependabot|renovate)\[bot\]$
23
+ - label != dependencies:major
24
+ - -draft
25
+ - -conflict
26
+ - "#approved-reviews-by >= 1"
27
+ - check-success = Test
28
+ reporting_method: check-runs
@@ -0,0 +1,38 @@
1
+ {
2
+ $schema: "https://docs.renovatebot.com/renovate-schema.json",
3
+ extends: [
4
+ "config:recommended",
5
+ "helpers:pinGitHubActionDigests",
6
+ ":dependencyDashboard",
7
+ ":semanticCommitsDisabled",
8
+ ],
9
+ labels: ["dependencies"],
10
+ timezone: "Asia/Tokyo",
11
+ schedule: ["after 9am on friday", "before 6pm on friday"],
12
+ rebaseWhen: "behind-base-branch",
13
+ lockFileMaintenance: {
14
+ enabled: true,
15
+ labels: ["dependencies"],
16
+ schedule: ["after 9am on friday", "before 6pm on friday"],
17
+ },
18
+ vulnerabilityAlerts: {
19
+ enabled: true,
20
+ labels: ["dependencies", "security"],
21
+ },
22
+ packageRules: [
23
+ {
24
+ matchUpdateTypes: ["major"],
25
+ addLabels: ["dependencies:major"],
26
+ },
27
+ {
28
+ matchManagers: ["github-actions"],
29
+ groupName: "github actions",
30
+ minimumReleaseAge: "7 days",
31
+ },
32
+ {
33
+ matchDepTypes: ["devDependencies"],
34
+ groupName: "development dependencies",
35
+ minimumReleaseAge: "3 days",
36
+ },
37
+ ],
38
+ }
@@ -4,11 +4,17 @@ on:
4
4
  push:
5
5
  branches:
6
6
  - master
7
+ tags:
8
+ - "v*"
7
9
  pull_request:
10
+ workflow_dispatch:
11
+
12
+ permissions:
13
+ contents: read
8
14
 
9
15
  jobs:
10
16
  ruby-versions:
11
- uses: ruby/actions/.github/workflows/ruby_versions.yml@master
17
+ uses: ruby/actions/.github/workflows/ruby_versions.yml@674947565a7afd0edfc4d301c1f0ef65e30f18f5 # master
12
18
  with:
13
19
  engine: cruby
14
20
  min_version: 2.7
@@ -27,15 +33,39 @@ jobs:
27
33
  continue-on-error: ${{matrix.ruby == 'head' || matrix.ruby == 'jruby'}}
28
34
 
29
35
  steps:
36
+ - name: Harden Runner
37
+ uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
38
+ with:
39
+ egress-policy: audit
40
+
30
41
  - name: Check out
31
- uses: actions/checkout@v4
42
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
43
+ with:
44
+ persist-credentials: false
32
45
 
33
- - name: Set up ruby and bundle
34
- uses: ruby/setup-ruby@v1
46
+ - name: Set up Ruby
47
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
35
48
  with:
36
49
  ruby-version: ${{matrix.ruby}}
37
- bundler-cache: true
50
+
51
+ - name: Install dependencies
52
+ run: |
53
+ bundle install --jobs 4 --retry 3
38
54
 
39
55
  - name: Run rake
40
56
  run: |
41
57
  bundle exec rake
58
+
59
+ test-gate:
60
+ name: Test
61
+ if: always()
62
+ needs: test
63
+ runs-on: ubuntu-latest
64
+
65
+ steps:
66
+ - name: Check matrix results
67
+ env:
68
+ RESULT: ${{ needs.test.result }}
69
+ run: |
70
+ set -euo pipefail
71
+ test "$RESULT" = success
@@ -0,0 +1,75 @@
1
+ name: Publish gem to RubyGems.org
2
+
3
+ on:
4
+ workflow_run: # zizmor: ignore[dangerous-triggers]
5
+ workflows:
6
+ - CI
7
+ types:
8
+ - completed
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ publish:
15
+ if: >-
16
+ ${{
17
+ github.event.workflow_run.conclusion == 'success' &&
18
+ (github.event.workflow_run.event == 'push' ||
19
+ github.event.workflow_run.event == 'workflow_dispatch') &&
20
+ github.event.workflow_run.head_repository.full_name == github.repository &&
21
+ startsWith(github.event.workflow_run.head_branch, 'v') &&
22
+ github.repository == 'knu/ruby-domain_name'
23
+ }}
24
+ runs-on: ubuntu-latest
25
+
26
+ environment:
27
+ name: rubygems.org
28
+ url: https://rubygems.org/gems/domain_name
29
+
30
+ permissions:
31
+ contents: write
32
+ id-token: write
33
+
34
+ steps:
35
+ - name: Harden Runner
36
+ uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
37
+ with:
38
+ egress-policy: audit
39
+
40
+ - name: Check out release tag
41
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
42
+ with:
43
+ fetch-depth: 0
44
+ persist-credentials: false
45
+ ref: ${{ github.event.workflow_run.head_branch }}
46
+
47
+ - name: Set up Ruby
48
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
49
+ with:
50
+ ruby-version: ruby
51
+
52
+ - name: Install dependencies
53
+ run: |
54
+ bundle install --jobs 4 --retry 3
55
+
56
+ - name: Verify release tag
57
+ env:
58
+ EXPECTED_SHA: ${{ github.event.workflow_run.head_sha }}
59
+ TAG: ${{ github.event.workflow_run.head_branch }}
60
+ run: |
61
+ set -euo pipefail
62
+ test "$(git rev-parse "${TAG}^{commit}")" = "$EXPECTED_SHA"
63
+ version="$(ruby -Ilib -e 'require "domain_name/version"; print DomainName::VERSION')"
64
+ test "v${version}" = "$TAG"
65
+
66
+ - name: Publish to RubyGems
67
+ uses: rubygems/release-gem@7f9650160c1a4e7989fdc9855807bdbd421d8b6b # v1.4.1
68
+
69
+ - name: Create GitHub release
70
+ env:
71
+ GH_TOKEN: ${{ github.token }}
72
+ TAG: ${{ github.event.workflow_run.head_branch }}
73
+ run: |
74
+ set -euo pipefail
75
+ gh release create "$TAG" --verify-tag --generate-notes
@@ -0,0 +1,161 @@
1
+ name: Update Public Suffix List
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - master
7
+ types:
8
+ - closed
9
+ schedule:
10
+ - cron: "23 0 * * *"
11
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ concurrency:
17
+ group: update-public-suffix-list
18
+ cancel-in-progress: false
19
+
20
+ jobs:
21
+ update:
22
+ if: >-
23
+ ${{
24
+ github.repository == 'knu/ruby-domain_name' &&
25
+ github.event_name != 'pull_request'
26
+ }}
27
+ runs-on: ubuntu-latest
28
+
29
+ permissions:
30
+ actions: write
31
+ contents: write
32
+ pull-requests: write
33
+
34
+ steps:
35
+ - name: Harden Runner
36
+ uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
37
+ with:
38
+ egress-policy: audit
39
+
40
+ - name: Check out
41
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
42
+ with:
43
+ persist-credentials: false
44
+
45
+ - name: Set up Ruby
46
+ uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
47
+ with:
48
+ bundler-cache: true
49
+ ruby-version: ruby
50
+
51
+ - name: Update Public Suffix List
52
+ run: |
53
+ bundle exec rake etld_data etld_data:changelog
54
+
55
+ - name: Check for list changes
56
+ id: changes
57
+ run: |
58
+ if git diff --quiet -- data/public_suffix_list.dat; then
59
+ echo "changed=false" >> "$GITHUB_OUTPUT"
60
+ else
61
+ echo "changed=true" >> "$GITHUB_OUTPUT"
62
+ fi
63
+
64
+ - name: Run tests
65
+ if: steps.changes.outputs.changed == 'true'
66
+ run: |
67
+ bundle exec rake test
68
+
69
+ - name: Read update timestamp
70
+ if: steps.changes.outputs.changed == 'true'
71
+ id: update
72
+ run: |
73
+ timestamp="$(ruby -Ilib -e 'require "domain_name/etld_data"; print DomainName::ETLD_DATA_DATE')"
74
+ echo "timestamp=$timestamp" >> "$GITHUB_OUTPUT"
75
+
76
+ - name: Create pull request
77
+ if: steps.changes.outputs.changed == 'true'
78
+ id: pull-request
79
+ uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
80
+ with:
81
+ add-paths: |
82
+ CHANGELOG.md
83
+ data/public_suffix_list.dat
84
+ lib/domain_name/etld_data.rb
85
+ lib/domain_name/version.rb
86
+ branch: automation/public-suffix-list
87
+ commit-message: Update the eTLD database to ${{ steps.update.outputs.timestamp }}.
88
+ delete-branch: true
89
+ token: ${{ github.token }}
90
+ title: Update the eTLD database to ${{ steps.update.outputs.timestamp }}
91
+ body: |
92
+ Update the bundled Public Suffix List and regenerate the eTLD database.
93
+
94
+ - name: Run CI for update branch
95
+ if: >-
96
+ steps.pull-request.outputs.pull-request-operation == 'created' ||
97
+ steps.pull-request.outputs.pull-request-operation == 'updated'
98
+ env:
99
+ GH_TOKEN: ${{ github.token }}
100
+ run: |
101
+ gh workflow run ci.yml --ref automation/public-suffix-list
102
+
103
+ release:
104
+ if: >-
105
+ ${{
106
+ github.repository == 'knu/ruby-domain_name' &&
107
+ github.event.pull_request.merged == true &&
108
+ github.event.pull_request.head.ref == 'automation/public-suffix-list' &&
109
+ github.event.pull_request.head.repo.full_name == github.repository
110
+ }}
111
+ runs-on: ubuntu-latest
112
+
113
+ permissions:
114
+ actions: write
115
+ contents: write
116
+
117
+ steps:
118
+ - name: Harden Runner
119
+ uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
120
+ with:
121
+ egress-policy: audit
122
+
123
+ - name: Check out merged update
124
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
125
+ with:
126
+ fetch-depth: 0
127
+ persist-credentials: false
128
+ ref: ${{ github.event.pull_request.merge_commit_sha }}
129
+
130
+ - name: Read release version
131
+ id: release
132
+ env:
133
+ MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
134
+ run: |
135
+ set -euo pipefail
136
+ test "$(git rev-parse HEAD)" = "$MERGE_SHA"
137
+ version="$(ruby -Ilib -e 'require "domain_name/version"; print DomainName::VERSION')"
138
+ [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
139
+ echo "tag=v${version}" >> "$GITHUB_OUTPUT"
140
+
141
+ - name: Create release tag
142
+ env:
143
+ GH_TOKEN: ${{ github.token }}
144
+ MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
145
+ TAG: ${{ steps.release.outputs.tag }}
146
+ run: |
147
+ set -euo pipefail
148
+ if tag_sha="$(git rev-parse --verify "${TAG}^{commit}" 2>/dev/null)"; then
149
+ test "$tag_sha" = "$MERGE_SHA"
150
+ else
151
+ gh api --method POST "repos/${GITHUB_REPOSITORY}/git/refs" \
152
+ --raw-field "ref=refs/tags/${TAG}" \
153
+ --raw-field "sha=${MERGE_SHA}"
154
+ fi
155
+
156
+ - name: Run CI for release tag
157
+ env:
158
+ GH_TOKEN: ${{ github.token }}
159
+ TAG: ${{ steps.release.outputs.tag }}
160
+ run: |
161
+ gh workflow run ci.yml --ref "$TAG"
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.6.20260902](https://github.com/knu/ruby-domain_name/tree/v0.6.20260902) (2026-09-03)
4
+ [Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.6.20260829...v0.6.20260902)
5
+
6
+ - Update the eTLD database to 2026-09-02 06:04:05 UTC
7
+
8
+ ## [v0.6.20260829](https://github.com/knu/ruby-domain_name/tree/v0.6.20260829) (2026-08-30)
9
+ [Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.6.20240107...v0.6.20260829)
10
+
11
+ - Update the eTLD database to 2026-08-29 12:33:17 UTC
12
+
3
13
  ## [v0.6.20240107](https://github.com/knu/ruby-domain_name/tree/v0.6.20240107) (2024-01-09)
4
14
 
5
15
  [Full Changelog](https://github.com/knu/ruby-domain_name/compare/v0.6.20231109...v0.6.20240107)
data/README.md CHANGED
@@ -40,6 +40,23 @@ Installation
40
40
 
41
41
  gem install domain_name
42
42
 
43
+ Release
44
+ -------
45
+
46
+ Releases use `v`-prefixed version tags. Push the release commit to
47
+ `master`, wait for CI to pass, and then push the matching tag. A
48
+ successful tag CI run publishes the gem through RubyGems trusted
49
+ publishing and creates the GitHub release.
50
+
51
+ Public Suffix List update pull requests from the
52
+ `automation/public-suffix-list` branch are tagged automatically when
53
+ merged. The tag CI run then publishes the release as above.
54
+
55
+ Before the first automated release, register `knu/ruby-domain_name`,
56
+ workflow `publish-gem.yml`, and environment `rubygems.org` as a trusted
57
+ publisher at
58
+ https://rubygems.org/gems/domain_name/trusted_publishers/new.
59
+
43
60
  References
44
61
  ----------
45
62
 
data/Rakefile CHANGED
@@ -28,6 +28,10 @@ task :etld_data do
28
28
  rescue LoadError, NameError
29
29
  data = ETLD_DATA_URI.read
30
30
  end
31
+ if File.binread(ETLD_DATA_FILE) == data.b
32
+ puts 'eTLD database is up-to-date.'
33
+ next
34
+ end
31
35
  puts 'eTLD database is modified.'
32
36
  date = data.last_modified
33
37
  File.write(ETLD_DATA_FILE, data)
@@ -51,10 +55,10 @@ task :etld_data do
51
55
  end
52
56
 
53
57
  namespace :etld_data do
54
- task :commit do
58
+ task :changelog do
55
59
  if system('git', 'diff', '--exit-code', '--quiet', ETLD_DATA_FILE)
56
60
  warn "Nothing to commit."
57
- exit
61
+ next
58
62
  end
59
63
 
60
64
  prev = `ruby -e "$(git cat-file -p @:lib/domain_name/version.rb); puts DomainName::VERSION"`.chomp
@@ -73,7 +77,13 @@ namespace :etld_data do
73
77
  f.rewind
74
78
  f.puts lines
75
79
  end
80
+ end
76
81
 
82
+ task :commit => :changelog do
83
+ next if system('git', 'diff', '--exit-code', '--quiet', ETLD_DATA_FILE)
84
+
85
+ curr = `ruby -e "load 'lib/domain_name/version.rb'; puts DomainName::VERSION"`.chomp
86
+ timestamp = File.mtime(ETLD_DATA_FILE).utc
77
87
  sh 'git', 'commit',
78
88
  'CHANGELOG.md',
79
89
  ETLD_DATA_FILE,