From d3bdaf5f451f4ea4d9163e5e06bceab6a6e32c77 Mon Sep 17 00:00:00 2001 From: eareimu Date: Wed, 17 Jun 2026 07:41:24 +0800 Subject: [PATCH 1/2] release: complete crate metadata --- Cargo.toml | 7 ++ LICENSE | 201 ++++++++++++++++++++++++++++++++++ README.md | 40 +++++++ genmeta-access/Cargo.toml | 8 +- genmeta-curl/Cargo.toml | 8 +- genmeta-discover/Cargo.toml | 8 +- genmeta-doctor/Cargo.toml | 8 +- genmeta-identity/Cargo.toml | 8 +- genmeta-nat/Cargo.toml | 8 +- genmeta-nslookup/Cargo.toml | 8 +- genmeta-proxy/Cargo.toml | 8 +- genmeta-ssh/Cargo.toml | 8 +- genmeta/Cargo.toml | 10 +- xtask/Cargo.toml | 6 +- xtask/src/publish/s3/brew.rs | 2 +- xtask/src/publish/s3/scoop.rs | 2 +- xtask/src/rpm.rs | 2 +- 17 files changed, 326 insertions(+), 16 deletions(-) create mode 100644 README.md diff --git a/Cargo.toml b/Cargo.toml index c553922..1bce35c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,13 @@ members = [ "xtask", ] +[workspace.package] +edition = "2024" +license = "Apache-2.0" +repository = "https://github.com/genmeta/gmutils" +homepage = "https://www.dhttp.net" +readme = "README.md" + [workspace.dependencies] # async futures = "0.3" diff --git a/LICENSE b/LICENSE index e69de29..f49a4e1 100644 --- a/LICENSE +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..fe440c6 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# gmutils + +gmutils is the Genmeta command-line tool family for DHTTP/3 networking, +identity management, discovery, diagnostics, access-control management, proxying, +and DShell sessions. + +The workspace publishes the following crates: + +| Crate | Purpose | +| ----- | ------- | +| `genmeta` | Unified launcher for the Genmeta CLI family. | +| `genmeta-access` | Access-control rule management. | +| `genmeta-curl` | Curl-like DHTTP/3 client. | +| `genmeta-discover` | LAN service discovery. | +| `genmeta-doctor` | Environment and network diagnostics. | +| `genmeta-identity` | DHTTP identity and certificate-chain management. | +| `genmeta-nat` | NAT and STUN diagnostics. | +| `genmeta-nslookup` | DNS and DHTTP resolver lookup tool. | +| `genmeta-proxy` | Forward proxy for DHTTP requests. | +| `genmeta-ssh` | DShell client compatibility command. | + +## Install + +After the initial public release is available on crates.io, install the launcher +with Cargo: + +```bash +cargo install genmeta +``` + +Individual tool crates can also be installed directly, for example: + +```bash +cargo install genmeta-ssh +cargo install genmeta-nat +``` + +## License + +gmutils is licensed under the Apache License, Version 2.0. diff --git a/genmeta-access/Cargo.toml b/genmeta-access/Cargo.toml index 3225c27..e96c530 100644 --- a/genmeta-access/Cargo.toml +++ b/genmeta-access/Cargo.toml @@ -2,7 +2,13 @@ name = "genmeta-access" description = "access control rule management" version = "0.2.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +readme.workspace = true +keywords = ["genmeta", "dhttp", "access", "cli"] +categories = ["command-line-utilities", "config"] [dependencies] clap = { workspace = true } diff --git a/genmeta-curl/Cargo.toml b/genmeta-curl/Cargo.toml index 9441856..a334542 100644 --- a/genmeta-curl/Cargo.toml +++ b/genmeta-curl/Cargo.toml @@ -2,7 +2,13 @@ name = "genmeta-curl" description = "curl-like DHTTP/3 client" version = "0.5.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +readme.workspace = true +keywords = ["genmeta", "dhttp", "http3", "client", "cli"] +categories = ["command-line-utilities", "network-programming"] [dependencies] async-compression = { workspace = true } diff --git a/genmeta-discover/Cargo.toml b/genmeta-discover/Cargo.toml index ff3c391..5c748cb 100644 --- a/genmeta-discover/Cargo.toml +++ b/genmeta-discover/Cargo.toml @@ -2,7 +2,13 @@ name = "genmeta-discover" description = "mdns discover services" version = "0.3.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +readme.workspace = true +keywords = ["genmeta", "dhttp", "mdns", "discovery", "cli"] +categories = ["command-line-utilities", "network-programming"] [dependencies] clap = { workspace = true } diff --git a/genmeta-doctor/Cargo.toml b/genmeta-doctor/Cargo.toml index 455fdf5..e0b0a17 100644 --- a/genmeta-doctor/Cargo.toml +++ b/genmeta-doctor/Cargo.toml @@ -2,7 +2,13 @@ name = "genmeta-doctor" description = "diagnosing and fixing environment issues" version = "0.3.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +readme.workspace = true +keywords = ["genmeta", "dhttp", "diagnostics", "cli"] +categories = ["command-line-utilities"] [dependencies] clap = { workspace = true } diff --git a/genmeta-identity/Cargo.toml b/genmeta-identity/Cargo.toml index 8ff6a44..665897c 100644 --- a/genmeta-identity/Cargo.toml +++ b/genmeta-identity/Cargo.toml @@ -2,7 +2,13 @@ name = "genmeta-identity" description = "managing identities for genmeta network" version = "0.2.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +readme.workspace = true +keywords = ["genmeta", "dhttp", "identity", "certificate", "cli"] +categories = ["command-line-utilities", "cryptography"] [dependencies] clap = { workspace = true, optional = true } diff --git a/genmeta-nat/Cargo.toml b/genmeta-nat/Cargo.toml index b4c4ff8..2b4ae4f 100644 --- a/genmeta-nat/Cargo.toml +++ b/genmeta-nat/Cargo.toml @@ -2,7 +2,13 @@ name = "genmeta-nat" description = "Diagnose network and environment issues" version = "0.3.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +readme.workspace = true +keywords = ["genmeta", "dhttp", "nat", "stun", "cli"] +categories = ["command-line-utilities", "network-programming"] [dependencies] clap = { workspace = true } diff --git a/genmeta-nslookup/Cargo.toml b/genmeta-nslookup/Cargo.toml index c852dab..ab597ec 100644 --- a/genmeta-nslookup/Cargo.toml +++ b/genmeta-nslookup/Cargo.toml @@ -2,7 +2,13 @@ name = "genmeta-nslookup" description = "resolve domain names" version = "0.3.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +readme.workspace = true +keywords = ["genmeta", "dhttp", "dns", "resolver", "cli"] +categories = ["command-line-utilities", "network-programming"] [dependencies] clap = { workspace = true } diff --git a/genmeta-proxy/Cargo.toml b/genmeta-proxy/Cargo.toml index ad3b70b..6ca3d94 100644 --- a/genmeta-proxy/Cargo.toml +++ b/genmeta-proxy/Cargo.toml @@ -2,7 +2,13 @@ name = "genmeta-proxy" description = "forward proxy routing .dhttp.net requests over DHTTP/3" version = "0.2.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +readme.workspace = true +keywords = ["genmeta", "dhttp", "proxy", "http3", "cli"] +categories = ["command-line-utilities", "network-programming"] [dependencies] clap = { workspace = true } diff --git a/genmeta-ssh/Cargo.toml b/genmeta-ssh/Cargo.toml index 5c1a97b..d494891 100644 --- a/genmeta-ssh/Cargo.toml +++ b/genmeta-ssh/Cargo.toml @@ -2,7 +2,13 @@ name = "genmeta-ssh" description = "DShell client" version = "0.6.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +readme.workspace = true +keywords = ["genmeta", "dhttp", "dshell", "ssh", "cli"] +categories = ["command-line-utilities", "network-programming"] [dependencies] clap = { workspace = true } diff --git a/genmeta/Cargo.toml b/genmeta/Cargo.toml index ca91a3a..f77659c 100644 --- a/genmeta/Cargo.toml +++ b/genmeta/Cargo.toml @@ -1,10 +1,14 @@ [package] name = "genmeta" -homepage = "https://www.dhttp.net" description = "Genmeta Binary Utilities" -license = "Shareware" version = "0.6.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true +readme.workspace = true +keywords = ["genmeta", "dhttp", "cli", "launcher"] +categories = ["command-line-utilities"] [dependencies] clap = { workspace = true } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 438c2df..fd78721 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "xtask" +description = "release packaging tasks for gmutils" version = "0.0.0" -edition = "2024" +edition.workspace = true +license.workspace = true +repository.workspace = true +homepage.workspace = true publish = false [dependencies] diff --git a/xtask/src/publish/s3/brew.rs b/xtask/src/publish/s3/brew.rs index 708a4a9..eacb9dd 100644 --- a/xtask/src/publish/s3/brew.rs +++ b/xtask/src/publish/s3/brew.rs @@ -13,7 +13,7 @@ const PACKAGE_NAME: &str = "gmutils"; const FORMULA_NAME: &str = "gmutils.rb"; const DESCRIPTION: &str = "Genmeta Binary Utilities"; const HOMEPAGE: &str = "https://www.dhttp.net"; -const LICENSE: &str = "Shareware"; +const LICENSE: &str = "Apache-2.0"; const INSTALL_CONTENT: &str = r##" def install bin.install "genmeta" bin.install "genmeta-ssh.sh" diff --git a/xtask/src/publish/s3/scoop.rs b/xtask/src/publish/s3/scoop.rs index de2f031..7167fa2 100644 --- a/xtask/src/publish/s3/scoop.rs +++ b/xtask/src/publish/s3/scoop.rs @@ -14,7 +14,7 @@ const MANIFEST_NAME: &str = "gmutils.json"; const CARGO_NAME: &str = "genmeta"; const DESCRIPTION: &str = "Genmeta Binary Utilities"; const HOMEPAGE: &str = "https://www.dhttp.net"; -const LICENSE: &str = "Shareware"; +const LICENSE: &str = "Apache-2.0"; #[derive(Debug, Serialize)] struct ScoopManifest { diff --git a/xtask/src/rpm.rs b/xtask/src/rpm.rs index 3c9087d..7ebfc1d 100644 --- a/xtask/src/rpm.rs +++ b/xtask/src/rpm.rs @@ -50,7 +50,7 @@ const IMAGE_TAG_PREFIX: &str = "gmutils-rpm-v1"; /// Package metadata baked into the generated spec. Kept here (not in Cargo.toml) /// so spec generation stays a single source of truth owned by xtask. const RPM_SUMMARY: &str = "Genmeta binary utilities"; -const RPM_LICENSE: &str = "Proprietary"; +const RPM_LICENSE: &str = "Apache-2.0"; const RPM_URL: &str = "https://www.dhttp.net"; const RPM_VENDOR: &str = "Genmeta Tech Limited"; const RPM_DESCRIPTION: &str = From a1cbc6536dce30542491ca00c1dfbbe7d7fbbb64 Mon Sep 17 00:00:00 2001 From: eareimu Date: Wed, 17 Jun 2026 07:58:02 +0800 Subject: [PATCH 2/2] fix(release): repair gmutils publish metadata --- .github/workflows/release.yml | 24 +++++++------- xtask/deb/copyright | 11 +++++++ xtask/src/main.rs | 59 +++++++++++++++++++++++++++++++++++ xtask/src/publish/s3/brew.rs | 1 + xtask/src/publish/s3/scoop.rs | 1 + xtask/src/rpm.rs | 11 ++++++- 6 files changed, 94 insertions(+), 13 deletions(-) create mode 100644 xtask/deb/copyright diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c994248..67a7884 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -141,11 +141,11 @@ jobs: if [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF_NAME}" == v* ]]; then mode=publish fi - publish_args=() + publish_cmd=(cargo xtask publish s3) if [[ "$mode" == "dry-run" ]]; then - publish_args+=(--dry-run) + publish_cmd+=(--dry-run) fi - cargo xtask publish s3 "${publish_args[@]}" \ + "${publish_cmd[@]}" \ --endpoint-url "$XTASK_RELEASE_S3_ENDPOINT_URL" \ --bucket "$RELEASE_BUCKET" \ deb --prefix "$APT_PREFIX" --suite "$APT_SUITE" --fingerprint "$APT_SIGNING_FINGERPRINT" @@ -251,11 +251,11 @@ jobs: if [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF_NAME}" == v* ]]; then mode=publish fi - publish_args=() + publish_cmd=(cargo xtask publish s3) if [[ "$mode" == "dry-run" ]]; then - publish_args+=(--dry-run) + publish_cmd+=(--dry-run) fi - cargo xtask publish s3 "${publish_args[@]}" \ + "${publish_cmd[@]}" \ --endpoint-url "$XTASK_RELEASE_S3_ENDPOINT_URL" \ --bucket "$RELEASE_BUCKET" \ rpm --prefix "$RPM_PREFIX" @@ -361,11 +361,11 @@ jobs: if [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF_NAME}" == v* ]]; then mode=publish fi - publish_args=() + publish_cmd=(cargo xtask publish s3) if [[ "$mode" == "dry-run" ]]; then - publish_args+=(--dry-run) + publish_cmd+=(--dry-run) fi - cargo xtask publish s3 "${publish_args[@]}" \ + "${publish_cmd[@]}" \ --endpoint-url "$XTASK_RELEASE_S3_ENDPOINT_URL" \ --bucket "$RELEASE_BUCKET" \ scoop --prefix "$SCOOP_PREFIX" --public-base-url "$SCOOP_PUBLIC_BASE_URL" @@ -470,11 +470,11 @@ jobs: if [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF_NAME}" == v* ]]; then mode=publish fi - publish_args=() + publish_cmd=(cargo xtask publish s3) if [[ "$mode" == "dry-run" ]]; then - publish_args+=(--dry-run) + publish_cmd+=(--dry-run) fi - cargo xtask publish s3 "${publish_args[@]}" \ + "${publish_cmd[@]}" \ --endpoint-url "$XTASK_RELEASE_S3_ENDPOINT_URL" \ --bucket "$RELEASE_BUCKET" \ brew --prefix "$BREW_PREFIX" --public-base-url "$BREW_PUBLIC_BASE_URL" diff --git a/xtask/deb/copyright b/xtask/deb/copyright new file mode 100644 index 0000000..cdff85b --- /dev/null +++ b/xtask/deb/copyright @@ -0,0 +1,11 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: gmutils +Source: https://github.com/genmeta/gmutils + +Files: * +Copyright: 2026 Genmeta Tech Limited +License: Apache-2.0 + Licensed under the Apache License, Version 2.0. + . + On Debian systems, the complete text of the Apache License, Version 2.0 + can be found in /usr/share/common-licenses/Apache-2.0. diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 8bc4e6f..03f6bfe 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -267,6 +267,11 @@ mod tests { use super::{BuildProfile, Cli, Command, publish}; + const RELEASE_WORKFLOW: &str = include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/../.github/workflows/release.yml" + )); + fn subcommand_names(command: &clap::Command) -> Vec<&str> { command .get_subcommands() @@ -386,6 +391,60 @@ mod tests { assert_eq!(error.kind(), ErrorKind::InvalidSubcommand); } } + + #[test] + fn release_workflow_publish_commands_are_tag_mode_safe() { + assert!(!RELEASE_WORKFLOW.contains("publish_args=()")); + assert!(!RELEASE_WORKFLOW.contains("\"${publish_args[@]}\"")); + assert_eq!( + RELEASE_WORKFLOW + .matches("publish_cmd=(cargo xtask publish s3)") + .count(), + 4 + ); + } + + #[test] + fn public_package_manifests_declare_apache_2_license() { + let workspace_dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .parent() + .expect("xtask manifest should be under workspace"); + let root_manifest_path = workspace_dir.join("Cargo.toml"); + let root_manifest = std::fs::read_to_string(&root_manifest_path) + .unwrap_or_else(|err| panic!("failed to read {}: {err}", root_manifest_path.display())); + assert!(root_manifest.contains("license = \"Apache-2.0\"")); + + for manifest in [ + "genmeta/Cargo.toml", + "genmeta-access/Cargo.toml", + "genmeta-curl/Cargo.toml", + "genmeta-discover/Cargo.toml", + "genmeta-doctor/Cargo.toml", + "genmeta-identity/Cargo.toml", + "genmeta-nat/Cargo.toml", + "genmeta-nslookup/Cargo.toml", + "genmeta-proxy/Cargo.toml", + "genmeta-ssh/Cargo.toml", + ] { + let manifest_path = workspace_dir.join(manifest); + let contents = std::fs::read_to_string(&manifest_path) + .unwrap_or_else(|err| panic!("failed to read {}: {err}", manifest_path.display())); + assert!( + contents.contains("license.workspace = true"), + "{manifest} should inherit workspace Apache-2.0 license" + ); + } + } + + #[test] + fn debian_package_metadata_declares_apache_2_license() { + let copyright_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .join("deb") + .join("copyright"); + let contents = std::fs::read_to_string(©right_path) + .unwrap_or_else(|err| panic!("failed to read {}: {err}", copyright_path.display())); + assert!(contents.contains("License: Apache-2.0")); + } } /// Run an external command quietly, suppressing stdout/stderr. diff --git a/xtask/src/publish/s3/brew.rs b/xtask/src/publish/s3/brew.rs index eacb9dd..fa9bb13 100644 --- a/xtask/src/publish/s3/brew.rs +++ b/xtask/src/publish/s3/brew.rs @@ -239,6 +239,7 @@ mod tests { let formula = render_formula(&manifest, "https://download.example/brew/gmutils") .expect("formula should render"); + assert!(formula.contains("license \"Apache-2.0\"")); assert!(formula.contains("url \"https://download.example/brew/gmutils/gmutils-0.5.2-aarch64-apple-darwin.tar.gz\"")); assert!(formula.contains("sha256 \"arm-sha\"")); } diff --git a/xtask/src/publish/s3/scoop.rs b/xtask/src/publish/s3/scoop.rs index 7167fa2..7785a7c 100644 --- a/xtask/src/publish/s3/scoop.rs +++ b/xtask/src/publish/s3/scoop.rs @@ -254,6 +254,7 @@ mod tests { let value: serde_json::Value = serde_json::from_str(&json).expect("json should parse"); assert_eq!(value["version"], "0.5.2"); + assert_eq!(value["license"], "Apache-2.0"); assert_eq!( value["architecture"]["64bit"]["url"], "https://download.example/scoop/gmutils/gmutils-0.5.2-x86_64-pc-windows-msvc.zip" diff --git a/xtask/src/rpm.rs b/xtask/src/rpm.rs index 7ebfc1d..d5a77db 100644 --- a/xtask/src/rpm.rs +++ b/xtask/src/rpm.rs @@ -525,7 +525,9 @@ install -D -m 0755 %{{SOURCE1}} %{{buildroot}}/usr/bin/genmeta-ssh.sh #[cfg(test)] mod tests { - use super::{AARCH64_ZIGBUILD_RUSTFLAGS_WORKAROUND, aarch64_zigbuild_workaround_script}; + use super::{ + AARCH64_ZIGBUILD_RUSTFLAGS_WORKAROUND, aarch64_zigbuild_workaround_script, render_spec, + }; #[test] fn aarch64_linker_workaround_enables_unstable_flavor_option() { @@ -541,4 +543,11 @@ mod tests { assert!(script.contains("-Wl,--fix-cortex-a53-843419|--fix-cortex-a53-843419")); assert!(script.contains("/usr/local/zig/zig")); } + + #[test] + fn rpm_spec_declares_apache_2_license() { + let spec = render_spec("0.6.0", "x86_64"); + + assert!(spec.contains("License: Apache-2.0\n")); + } }