├── .cargo └── deny.toml ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── pull_request_template.md └── workflows │ └── test.yml ├── .gitignore ├── .mergify.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Cargo.toml ├── Dockerfile ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── action.yml ├── entrypoint.sh ├── src └── main.rs ├── tag.sh └── test ├── Cargo.lock ├── Cargo.toml ├── deny.toml ├── lib.rs └── rt.toml /.cargo/deny.toml: -------------------------------------------------------------------------------- 1 | [licenses] 2 | allow = ["Unicode-3.0", "MIT", "Apache-2.0"] 3 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @Jake-Shadle 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Device:** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Checklist 2 | 3 | * [ ] I have read the [Contributor Guide](../../CONTRIBUTING.md) 4 | * [ ] I have read and agree to the [Code of Conduct](../../CODE_OF_CONDUCT.md) 5 | * [ ] I have added a description of my changes and why I'd like them included in the section below 6 | 7 | ### Description of Changes 8 | 9 | Describe your changes here 10 | 11 | ### Related Issues 12 | 13 | List related issues here 14 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: [push, pull_request] 3 | 4 | jobs: 5 | build: 6 | runs-on: ubuntu-latest 7 | steps: 8 | - uses: actions/checkout@v4 9 | 10 | - name: Build Docker image 11 | run: docker build -t test-cargo-deny . 12 | 13 | - name: Run list 14 | run: | 15 | docker run -v $PWD/test:/test test-cargo-deny \ 16 | "" \ 17 | "" \ 18 | "" \ 19 | "" \ 20 | "false" \ 21 | --log-level warn \ 22 | --manifest-path test/Cargo.toml \ 23 | "" \ 24 | list \ 25 | "" 26 | 27 | - name: Run check 28 | run: | 29 | docker run -v $PWD/test:/test test-cargo-deny \ 30 | 1.70.0 \ 31 | "" \ 32 | "" \ 33 | "" \ 34 | "false" \ 35 | --log-level warn \ 36 | --manifest-path test/Cargo.toml \ 37 | --all-features \ 38 | check \ 39 | "" 40 | 41 | - name: Run check w/rust-toolchain.toml 42 | run: | 43 | mv ./test/rt.toml ./rust-toolchain.toml 44 | docker run -v $PWD:/test test-cargo-deny \ 45 | "" \ 46 | "" \ 47 | "" \ 48 | "" \ 49 | "false" \ 50 | --log-level warn \ 51 | --manifest-path test/Cargo.toml \ 52 | check \ 53 | "" -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/target 2 | **/*.rs.bk 3 | Cargo.lock 4 | -------------------------------------------------------------------------------- /.mergify.yml: -------------------------------------------------------------------------------- 1 | pull_request_rules: 2 | - name: automatic merge when CI passes and 1 reviews 3 | conditions: 4 | - "#approved-reviews-by>=1" 5 | - "#review-requested=0" 6 | - "#changes-requested-reviews-by=0" 7 | - "#commented-reviews-by=0" 8 | - base=master 9 | - label!=work-in-progress 10 | actions: 11 | merge: 12 | method: squash 13 | - name: delete head branch after merge 14 | conditions: [] 15 | actions: 16 | delete_head_branch: {} 17 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at opensource@embark-studios.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Embark Contributor Guidelines 2 | 3 | Welcome! This project is created by the team at [Embark Studios](https://embark.games). We're glad you're interested in contributing! We welcome contributions from people of all backgrounds who are interested in making great software with us. 4 | 5 | At Embark, we aspire to empower everyone to create interactive experiences. To do this, we're exploring and pushing the boundaries of new technologies, and sharing our learnings with the open source community. 6 | 7 | If you have ideas for collaboration, email us at opensource@embark-studios.com. 8 | 9 | We're also hiring full-time engineers to work with us in Stockholm! Check out our current job postings [here](https://embark.games/careers). 10 | 11 | ## Issues 12 | 13 | ### Feature Requests 14 | 15 | If you have ideas or how to improve our projects, you can suggest features by opening a GitHub issue. Make sure to include details about the feature or change, and describe any uses cases it would enable. 16 | 17 | Feature requests will be tagged as `enhancement` and their status will be updated in the comments of the issue. 18 | 19 | ### Bugs 20 | 21 | When reporting a bug or unexpected behaviour in a project, make sure your issue descibes steps to reproduce the behaviour, including the platform you were using, what steps you took, and any error messages. 22 | 23 | Reproducible bugs will be tagged as `bug` and their status will be updated in the comments of the issue. 24 | 25 | ### Wontfix 26 | 27 | Issues will be closed and tagged as `wontfix` if we decide that we do not wish to implement it, usually due to being misaligned with the project vision or out of scope. We will comment on the issue with more detailed reasoning. 28 | 29 | ## Contribution Workflow 30 | 31 | ### Open Issues 32 | 33 | If you're ready to contribute, start by looking at our open issues tagged as [`help wanted`](../../issues?q=is%3Aopen+is%3Aissue+label%3A"help+wanted") or [`good first issue`](../../issues?q=is%3Aopen+is%3Aissue+label%3A"good+first+issue"). 34 | 35 | You can comment on the issue to let others know you're interested in working on it or to ask questions. 36 | 37 | ### Making Changes 38 | 39 | 1. Fork the repository. 40 | 41 | 2. Create a new feature branch. 42 | 43 | 3. Make your changes. Ensure that there are no build errors by running the project with your changes locally. 44 | 45 | 4. Open a pull request with a name and description of what you did. You can read more about working with pull requests on GitHub [here](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork). 46 | 47 | 5. A maintainer will review your pull request and may ask you to make changes. 48 | 49 | ## Code Guidelines 50 | 51 | ### Rust 52 | 53 | You can read about our standards and recommendations for working with Rust [here](https://github.com/EmbarkStudios/rust-ecosystem/blob/master/guidelines.md). 54 | 55 | ### Python 56 | 57 | We recommend following [PEP8 conventions](https://www.python.org/dev/peps/pep-0008/) when working with Python modules. 58 | 59 | ### JavaScript 60 | 61 | We follow the [AirBnB JavaScript style guide](https://github.com/airbnb/javascript). You can find the ESLint configuration in relevant repositories. 62 | 63 | ## Licensing 64 | 65 | Unless otherwise specified, all Embark open source projects are licensed under a dual MIT OR Apache-2.0 license, allowing licensees to chose either at their option. You can read more in each project's respective README. 66 | 67 | ## Code of Conduct 68 | 69 | Please note that our projects are released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md) to ensure that they are welcoming places for everyone to contribute. By participating in any Embark open source project, you agree to abide by these terms. 70 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "root" 3 | version = "0.1.0" 4 | edition = "2024" 5 | 6 | [dependencies] 7 | openssl = "0.10" 8 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rust:1.85.0-alpine3.20@sha256:f0cef6c65992995b1c7816cb667de95799852e3fbed9d06f95855cbc512a0fd0 2 | 3 | ENV deny_version="0.18.2" 4 | 5 | RUN set -eux; \ 6 | apk update; \ 7 | apk add bash curl git tar openssh; \ 8 | curl --silent -L https://github.com/EmbarkStudios/cargo-deny/releases/download/$deny_version/cargo-deny-$deny_version-x86_64-unknown-linux-musl.tar.gz | tar -xzv -C /usr/bin --strip-components=1; 9 | 10 | COPY entrypoint.sh /entrypoint.sh 11 | 12 | ENTRYPOINT ["/entrypoint.sh"] 13 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Embark Studios 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | # ❌ cargo-deny GitHub Action 4 | 5 | **GitHub Action for running [`cargo-deny`](https://github.com/EmbarkStudios/cargo-deny) to help manage Cargo crate dependencies and validate licenses.** 6 | 7 | [![Build Status](https://github.com/EmbarkStudios/cargo-deny-action/workflows/Test/badge.svg)](https://github.com/EmbarkStudios/cargo-deny-action/actions?workflow=Test) 8 | [![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md) 9 | [![Embark](https://img.shields.io/badge/embark-open%20source-blueviolet.svg)](https://embark.dev) 10 | 11 |
12 | 13 | ## Usage 14 | 15 | Create a `deny.toml` file in the root of the repo to use as rules for the action ([example](https://github.com/EmbarkStudios/cargo-deny/blob/master/deny.toml)). 16 | See [`cargo-deny`](https://github.com/EmbarkStudios/cargo-deny) for instructions and details of the format and capabilities. 17 | 18 | This action will run `cargo-deny check` and report failure if any banned crates or disallowed open source licenses are found used in the crate or its dependencies. 19 | 20 | The action has three optional inputs 21 | 22 | * `rust-version`: The rust/cargo version to use, updated before cargo-deny is run. Defaults to the version in the image, which is currently **1.71.0**. 23 | * `log-level`: The log level to use for `cargo-deny`, default is `warn` 24 | * `command`: The command to use for `cargo-deny`, default is `check` 25 | * `arguments`: The argument to pass to `cargo-deny`, default is `--all-features`. See [Common Options](https://embarkstudios.github.io/cargo-deny/cli/common.html) for a list of the available options. 26 | * `manifest-path`: The path to a Cargo.toml file to use as the root. Defaults to `./Cargo.toml`. Note this argument is always passed, so you can't have it in `arguments` as well, just set it it to the value you had in `arguments` if you were using it there. 27 | * `command-arguments` The argument to pass to the command, default is emtpy. See options for [each command](https://embarkstudios.github.io/cargo-deny/cli/index.html). 28 | * `credentials` This argument stores the credentials in the file `$HOME/git-credentials`, and configures git to use it. The credential must match the format `https://user:pass@github.com` 29 | 30 | ### Example pipeline 31 | 32 | ```yaml 33 | name: CI 34 | on: [push, pull_request] 35 | jobs: 36 | cargo-deny: 37 | runs-on: ubuntu-22.04 38 | steps: 39 | - uses: actions/checkout@v4 40 | - uses: EmbarkStudios/cargo-deny-action@v2 41 | ``` 42 | 43 | ### Example pipeline with custom options using default values 44 | 45 | ```yaml 46 | name: CI 47 | on: [push, pull_request] 48 | jobs: 49 | cargo-deny: 50 | runs-on: ubuntu-22.04 51 | steps: 52 | - uses: actions/checkout@v4 53 | - uses: EmbarkStudios/cargo-deny-action@v2 54 | with: 55 | log-level: warn 56 | manifest-path: ./Cargo.toml 57 | command: check 58 | arguments: --all-features 59 | command-arguments: "" 60 | credentials: https://${{ secrets.GITHUB_USER }}:${{ secrets.GITHUB_PAT }}@github.com 61 | ``` 62 | 63 | ### Use specific Rust version 64 | 65 | ```yaml 66 | name: CI 67 | on: [push, pull_request] 68 | jobs: 69 | cargo-deny: 70 | runs-on: ubuntu-22.04 71 | steps: 72 | - uses: actions/checkout@v4 73 | - uses: EmbarkStudios/cargo-deny-action@v2 74 | with: 75 | rust-version: "1.60.0" 76 | log-level: warn 77 | command: check 78 | arguments: --all-features 79 | ``` 80 | 81 | ### Recommended pipeline if not using advisories, to only run on dependency changes 82 | 83 | If you use this pipeline, you should have `Cargo.lock` files checked into your 84 | repository. 85 | 86 | ```yaml 87 | name: CI 88 | on: 89 | pull_request: 90 | paths: 91 | - '**/Cargo.lock' 92 | - '**/Cargo.toml' 93 | - '**/deny.toml' 94 | jobs: 95 | cargo-deny: 96 | runs-on: ubuntu-22.04 97 | steps: 98 | - uses: actions/checkout@v4 99 | - uses: EmbarkStudios/cargo-deny-action@v2 100 | with: 101 | command: check bans licenses sources 102 | ``` 103 | 104 | ### Recommended pipeline if using advisories, to avoid sudden breakages 105 | 106 | ```yaml 107 | name: CI 108 | on: [push, pull_request] 109 | jobs: 110 | cargo-deny: 111 | runs-on: ubuntu-22.04 112 | strategy: 113 | matrix: 114 | checks: 115 | - advisories 116 | - bans licenses sources 117 | 118 | # Prevent sudden announcement of a new advisory from failing ci: 119 | continue-on-error: ${{ matrix.checks == 'advisories' }} 120 | 121 | steps: 122 | - uses: actions/checkout@v4 123 | - uses: EmbarkStudios/cargo-deny-action@v2 124 | with: 125 | command: check ${{ matrix.checks }} 126 | ``` 127 | 128 | ## Users 129 | 130 | Repositories using this action (PR to add your repo): 131 | 132 | * [ash-molten](https://github.com/EmbarkStudios/ash-molten) 133 | * [asn1rs](https://github.com/kellerkindt/asn1rs) 134 | * [cargo-about](https://github.com/EmbarkStudios/cargo-about) 135 | * [cargo-fetcher](https://github.com/EmbarkStudios/cargo-fetcher) 136 | * [Defguard](https://github.com/DefGuard/defguard) 137 | * [gitoxide](https://github.com/Byron/gitoxide) 138 | * [glam-rs](https://github.com/bitshifter/glam-rs) 139 | * [linkerd2-proxy](https://github.com/linkerd/linkerd2-proxy) 140 | * [OctaSine](https://github.com/greatest-ape/OctaSine) 141 | * [PackSquash](https://github.com/ComunidadAylas/PackSquash) 142 | * [physx-rs](https://github.com/EmbarkStudios/physx-rs) 143 | * [smush](https://github.com/gwihlidal/smush-rs) 144 | * [tame-gcs](https://github.com/EmbarkStudios/tame-gcs) 145 | * [tame-oauth](https://github.com/EmbarkStudios/tame-oauth) 146 | * [texture-synthesis](https://github.com/EmbarkStudios/texture-synthesis) 147 | * [tonic](https://github.com/hyperium/tonic) 148 | * ⚡️[dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) 149 | * [wasm-oidc-plugin](https://github.com/antonengelhardt/wasm-oidc-plugin) 150 | * [rama](https://github.com/plabayo/rama) 151 | 152 | ## Contributing 153 | 154 | We welcome community contributions to this project. 155 | 156 | Please read our [Contributor Guide](CONTRIBUTING.md) for more information on how to get started. 157 | 158 | ## License 159 | 160 | Licensed under either of 161 | 162 | * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ) 163 | * MIT license ([LICENSE-MIT](LICENSE-MIT) or ) 164 | 165 | at your option. 166 | 167 | ### Contribution 168 | 169 | Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. 170 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "cargo-deny" 2 | description: "Help manage Cargo crate dependencies and validate licenses" 3 | author: "Embark Studios" 4 | 5 | branding: 6 | icon: "slash" 7 | color: "red" 8 | 9 | inputs: 10 | command: 11 | description: "The command to run with cargo-deny" 12 | required: false 13 | default: "check" 14 | arguments: 15 | description: "The arguments to pass to cargo-deny" 16 | required: false 17 | default: "--all-features" 18 | command-arguments: 19 | description: "The arguments to pass to the command" 20 | required: false 21 | default: "" 22 | manifest-path: 23 | description: "Repo root relative path to the Cargo manifest to check" 24 | required: false 25 | default: "./Cargo.toml" 26 | log-level: 27 | description: "The log level for cargo-deny" 28 | required: false 29 | default: "warn" 30 | rust-version: 31 | description: "The Rust version that is updated to before running cargo deny" 32 | required: false 33 | default: "" 34 | credentials: 35 | description: "The git credentials for credential.helper store using github username and github's private access token (PAT)" 36 | required: false 37 | default: "" 38 | ssh-key: 39 | description: "Set the used ssh key" 40 | required: false 41 | default: "" 42 | ssh-known-hosts: 43 | description: "Set ssh known hosts" 44 | required: false 45 | default: "" 46 | use-git-cli: 47 | description: "Set CARGO_NET_GIT_FETCH_WITH_CLI" 48 | required: false 49 | default: "false" 50 | 51 | runs: 52 | using: "docker" 53 | image: "Dockerfile" 54 | args: 55 | - ${{ inputs.rust-version }} 56 | - ${{ inputs.credentials }} 57 | - ${{ inputs.ssh-key }} 58 | - ${{ inputs.ssh-known-hosts }} 59 | - ${{ inputs.use-git-cli }} 60 | - --log-level 61 | - ${{ inputs.log-level }} 62 | - --manifest-path 63 | - ${{ inputs.manifest-path }} 64 | - ${{ inputs.arguments }} 65 | - ${{ inputs.command }} 66 | - ${{ inputs.command-arguments }} 67 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | PATH=$PATH:/usr/local/cargo/bin 5 | 6 | if [ -n "$1" ]; then 7 | rustup set profile minimal 8 | rustup default "$1" 9 | fi 10 | 11 | if [ -n "$2" ]; then 12 | git config --global credential.helper store 13 | git config --global --replace-all url.https://github.com/.insteadOf ssh://git@github.com/ 14 | git config --global --add url.https://github.com/.insteadOf git@github.com: 15 | 16 | echo "$2" > "$HOME/.git-credentials" 17 | chmod 600 "$HOME/.git-credentials" 18 | fi 19 | 20 | if [ -n "$3" ]; then 21 | mkdir -p "/root/.ssh" 22 | chmod 0700 "/root/.ssh" 23 | echo "${3}" > "/root/.ssh/id_rsa" 24 | chmod 0600 "/root/.ssh/id_rsa" 25 | fi 26 | 27 | if [ -n "$4" ]; then 28 | mkdir -p "/root/.ssh" 29 | chmod 0700 "/root/.ssh" 30 | echo "${4}" > "/root/.ssh/known_hosts" 31 | chmod 0600 "/root/.ssh/known_hosts" 32 | fi 33 | 34 | if [ -n "$5" ]; then 35 | export CARGO_NET_GIT_FETCH_WITH_CLI="$5" 36 | fi 37 | 38 | shift 5 39 | 40 | # Due to how github actions run containers we need to explicitly force colors 41 | # as TTY detection fails inside them 42 | export CARGO_TERM_COLOR="always" 43 | 44 | # Workaround for rustup 1.28 completely breaking rust-toolchain.toml 45 | (cd "$(dirname "$4")"; rustup show || rustup toolchain install) 46 | 47 | cargo-deny $* 48 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() {} 2 | -------------------------------------------------------------------------------- /tag.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eu 3 | 4 | version=$1 5 | deny_version=$2 6 | 7 | awk -i inplace -v dvers="$deny_version" '{sub(/ENV\sdeny_version=[^\n]+/,"ENV deny_version=\"" dvers "\"")}1' Dockerfile 8 | 9 | git add Dockerfile 10 | git diff-index --quiet HEAD || git commit -m "Bump to $deny_version" 11 | 12 | # Add the new tag 13 | git tag -a "v$version" -m "Release $version - cargo-deny $deny_version" 14 | 15 | # Move the v2 tag to the new commit 16 | git tag -fa "v2" -m "Release $version - cargo-deny $deny_version" 17 | 18 | git push --tags --force 19 | git push 20 | -------------------------------------------------------------------------------- /test/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "lazy_static" 7 | version = "1.4.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 10 | 11 | [[package]] 12 | name = "test-crate" 13 | version = "0.1.0" 14 | dependencies = [ 15 | "lazy_static", 16 | ] 17 | -------------------------------------------------------------------------------- /test/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "test-crate" 3 | version = "0.1.0" 4 | authors = ["Embark "] 5 | license = "MIT OR Apache-2.0" 6 | edition = "2018" 7 | publish = false 8 | 9 | [lib] 10 | path = "lib.rs" 11 | 12 | [dependencies] 13 | lazy_static = "1.0" -------------------------------------------------------------------------------- /test/deny.toml: -------------------------------------------------------------------------------- 1 | [bans] 2 | multiple-versions = "deny" 3 | deny = [ 4 | { name = "openssl" }, 5 | 6 | # deprecated/abandoned 7 | { name = "term" }, # term is not fully maintained, and termcolor is replacing it 8 | { name = "quickersort" }, # explicitly deprecated 9 | { name = "build-helper" }, # abandoned, and doesn't add much value 10 | { name = "app_dirs" }, # abandoned, use app_dirs2 instead 11 | { name = "colored" }, # not actively maintained? slow to merge update fixes in and has lots of old dependencies 12 | { name = "floating-duration"}, # not needed with Rust 1.38, and very few users and commits 13 | { name = "mopa"}, # abandoned, have not been updated for 4 years 14 | ] 15 | skip = [ 16 | ] 17 | skip-tree = [ 18 | ] 19 | 20 | [licenses] 21 | # We want really high confidence when inferring licenses from text 22 | confidence-threshold = 0.92 23 | allow = [ 24 | "LicenseRef-Embark-Proprietary", 25 | "Apache-2.0", 26 | "Apache-2.0 WITH LLVM-exception", 27 | "BSD-2-Clause", 28 | "BSD-3-Clause", 29 | "ISC", 30 | "MIT", 31 | "MPL-2.0", 32 | "Zlib", 33 | ] 34 | -------------------------------------------------------------------------------- /test/lib.rs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbarkStudios/cargo-deny-action/6e6dcaa32fbf6bd330c20bc0068f950de9d85f73/test/lib.rs -------------------------------------------------------------------------------- /test/rt.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | channel = "nightly-2025-01-03" 3 | components = ["rustfmt", "clippy"] 4 | --------------------------------------------------------------------------------