inet 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fd1407cb6b63aedfbf3e934ab952f7a89e74b19660aabb97d13eaa2ca63365d9
4
+ data.tar.gz: 8a47da2e0262b952cc8b085b1551c057585a1ff8f2e48039dd16e71fccc038b4
5
+ SHA512:
6
+ metadata.gz: 22881dab447cf39c8468b8ef3053fb5276b373f35034c0a95dcb115c72f47d777448793e55007f9bc572979196e1a7aa1531e784c969aa8fb401a87dd766df79
7
+ data.tar.gz: 1de282eccadcf51c4ebd15929f3eee88e90f0aec16617df644e900894461eb0157ce4de807b4de0a87251cbb6720c8699d36de91bab9f4a8bf7fee21650480de
data/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # 更新记录
2
+
3
+ ## 0.1.0
4
+
5
+ 1. **基础骨架**:提供可安装的 `inet` gem、`Inet` 命名空间和版本信息,要求 Ruby 3.4 及以上版本。
6
+ 2. **自动发布**:更新版本号并推送 `main` 后,检查通过即可发布到 RubyGems 和 GitHub Releases。
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 inet contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # inet
2
+
3
+ [![Release](https://github.com/gatework/inet/actions/workflows/release.yml/badge.svg)](https://github.com/gatework/inet/actions/workflows/release.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/inet.svg)](https://rubygems.org/gems/inet)
5
+
6
+ `inet` 的 Ruby gem 基础骨架。当前仅提供 `Inet` 命名空间和版本信息,尚未实现网络功能。
7
+
8
+ 要求 Ruby 3.4 或更高版本,无运行时依赖,采用 MIT 许可证。
9
+
10
+ ## 安装与使用
11
+
12
+ ```sh
13
+ gem install inet
14
+ ```
15
+
16
+ 也可以在 Gemfile 中添加:
17
+
18
+ ```ruby
19
+ gem "inet", "~> 0.1"
20
+ ```
21
+
22
+ ```ruby
23
+ require "inet"
24
+
25
+ puts Inet::VERSION # => "0.1.0"
26
+ ```
27
+
28
+ ## 开发
29
+
30
+ ```sh
31
+ bundle install
32
+ bundle exec rake ci
33
+ ```
34
+
35
+ `rake ci` 依次运行 Minitest、RuboCop、gem 构建与隔离安装验证;产物写入 `pkg/`。
36
+ 也可以单独运行 `rake test`、`rake lint`、`rake package`。
37
+
38
+ GitHub Actions 在 Linux 和 macOS 上测试 Ruby 3.4、4.0。PR 和开发分支运行 CI;
39
+ `main` 通过同一组检查后进入发布流程。
40
+
41
+ ## 自动发布
42
+
43
+ 首次连接 RubyGems 的步骤见 [发布配置](docs/releasing.md)。完成后:
44
+
45
+ 1. 更新 `lib/inet/version.rb`,在 `CHANGELOG.md` 中添加对应版本的说明。
46
+ 2. 运行 `bundle install` 同步锁文件,再运行 `bundle exec rake ci`。
47
+ 3. 提交并执行 `git push origin main`。
48
+
49
+ Actions 会发布经过 CI 验证的 gem,创建 `vX.Y.Z` 标签和 GitHub Release,并附上 gem 与 SHA256 校验文件。
50
+ 版本号未变化的后续提交只运行检查,不重复发布。也可以在 `main` 上手动运行 Release 工作流。
data/docs/releasing.md ADDED
@@ -0,0 +1,52 @@
1
+ # 发布配置
2
+
3
+ ## 首次设置
4
+
5
+ 本项目通过 [RubyGems Trusted Publishing](https://guides.rubygems.org/trusted-publishing/)
6
+ 使用 GitHub Actions 的短期 OIDC 凭据发布,不需要保存 RubyGems API key。
7
+
8
+ 首次发布前,登录 RubyGems,打开 [Pending trusted publishers](https://rubygems.org/profile/oidc/pending_trusted_publishers),
9
+ 新建以下配置:
10
+
11
+ | 字段 | 值 |
12
+ | --- | --- |
13
+ | Gem name | `inet` |
14
+ | Repository owner | `gatework` |
15
+ | Repository name | `inet` |
16
+ | Workflow filename | `release.yml` |
17
+ | Environment | `release` |
18
+
19
+ 工作流仓库的可选字段留空,因为发布作业就在当前仓库。
20
+ 首次成功发布后,RubyGems 会自动把 pending publisher 转为该 gem 的 trusted publisher。
21
+ 若 gem 已存在,应从 gem 页面进入 Trusted publishers 配置。
22
+
23
+ 在 GitHub 仓库中创建名为 `release` 的 Environment,将 Deployment branches and tags
24
+ 设置为 Selected branches and tags,仅允许名为 `main` 的分支,不添加标签规则。
25
+ 自动发布使用这个环境;如需人工审批,可以自行添加 required reviewers。
26
+
27
+ ## 日常发布
28
+
29
+ 更新 `Inet::VERSION` 为新的 `X.Y.Z` 版本,并添加 `CHANGELOG.md` 同名标题。
30
+ 运行 `bundle install` 更新 Gemfile.lock 中的本地 gem 版本,然后执行 `bundle exec rake ci`。
31
+ 提交并推送 `main` 后,Release 工作流会:
32
+
33
+ 1. 在 Linux/macOS、Ruby 3.4/4.0 上运行测试、静态检查、打包和隔离安装。
34
+ 2. 下载本次 Linux/Ruby 4.0 作业的构件,校验 SHA256、包元数据和源码内容。
35
+ 3. 确认版本和标签没有冲突,取得仅用于 `inet` 的短期发布凭据。
36
+ 4. 上传该 gem,回读 RubyGems 版本信息和下载内容,确认 SHA256 一致。
37
+ 5. 创建对应标签和 GitHub Release,上传同一份 gem 与 `SHA256SUMS`,下载比对后公开发布。
38
+
39
+ 首次推送 `main` 会发布 `0.1.0`。同版本的后续提交会跳过发布;后续更改需要提升版本号。
40
+ 发布只在 `main` 上运行,标签由工作流自动创建。
41
+
42
+ ## 失败恢复
43
+
44
+ 测试或包校验失败时修复后重新推送。OIDC 失败时核对上表,完成配置后重跑失败作业。
45
+
46
+ RubyGems 上传结果不明时,先查看版本页面和 SHA256,等待索引更新;不要立即重新上传或本地重建。
47
+ 确认 RubyGems 已有相同 SHA256 后,使用 Actions 的 **Re-run failed jobs**,保留同一运行中的原始构件。
48
+ 工作流会识别已发布的相同构件,继续完成 GitHub Release。
49
+ 同版本存在不同 SHA256 时停止发布,需要检查冲突并使用新版本。
50
+
51
+ `script/release.rb` 是 Actions 内部入口,要求 `gatework/inet` 的 `main`、干净工作区和对应的触发提交。
52
+ 本地可以运行 `bundle exec ruby script/verify_package.rb pkg/inet-0.1.0.gem` 验证已有构件。
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Inet
4
+ VERSION = "0.1.0"
5
+ end
data/lib/inet.rb ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "inet/version"
4
+
5
+ # inet 的公共命名空间;首版只提供加载入口与版本信息。
6
+ module Inet
7
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: inet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - inet contributors
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: The initial inet package provides a loadable namespace and version information.
13
+ executables: []
14
+ extensions: []
15
+ extra_rdoc_files: []
16
+ files:
17
+ - CHANGELOG.md
18
+ - LICENSE
19
+ - README.md
20
+ - docs/releasing.md
21
+ - lib/inet.rb
22
+ - lib/inet/version.rb
23
+ homepage: https://github.com/gatework/inet
24
+ licenses:
25
+ - MIT
26
+ metadata:
27
+ allowed_push_host: https://rubygems.org
28
+ rubygems_mfa_required: 'true'
29
+ source_code_uri: https://github.com/gatework/inet
30
+ changelog_uri: https://github.com/gatework/inet/blob/main/CHANGELOG.md
31
+ bug_tracker_uri: https://github.com/gatework/inet/issues
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '3.4'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubygems_version: 4.0.12
47
+ specification_version: 4
48
+ summary: Foundation for the inet Ruby library
49
+ test_files: []