diff --git a/.github/workflows/cla.yaml b/.github/workflows/cla.yaml new file mode 100644 index 00000000..7048181b --- /dev/null +++ b/.github/workflows/cla.yaml @@ -0,0 +1,30 @@ +name: CLA + +# Every contributor signs CLA.md once, by commenting on a pull request; the signatures are kept on the cla-signatures +# branch (CLA Assistant Lite). +on: + issue_comment: + types: [created] + pull_request_target: + types: [opened, closed, synchronize] + +permissions: + actions: write + contents: write + pull-requests: write + statuses: write + +jobs: + cla: + name: Check CLA signature + runs-on: ubuntu-latest + steps: + - if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' + uses: contributor-assistant/github-action@v2.6.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + path-to-document: https://github.com/kdroidFilter/SeforimLibrary/blob/master/CLA.md + path-to-signatures: signatures/version1/cla.json + branch: cla-signatures + allowlist: kdroidFilter,dependabot[bot],github-actions[bot] diff --git a/.github/workflows/dco.yaml b/.github/workflows/dco.yaml new file mode 100644 index 00000000..7436cf52 --- /dev/null +++ b/.github/workflows/dco.yaml @@ -0,0 +1,42 @@ +name: DCO + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + dco-check: + name: Check DCO sign-off + runs-on: ubuntu-latest + steps: + - name: Verify Signed-off-by on all PR commits + uses: actions/github-script@v7 + with: + script: | + const { owner, repo } = context.repo; + const prNumber = context.payload.pull_request.number; + + const commits = await github.paginate( + github.rest.pulls.listCommits, + { owner, repo, pull_number: prNumber, per_page: 100 } + ); + + const signOffRegex = /^Signed-off-by: .+ <.+@.+>$/m; + const failures = []; + + for (const c of commits) { + const message = c.commit.message || ""; + if (!signOffRegex.test(message)) { + failures.push(`${c.sha.substring(0, 7)} — ${message.split("\n")[0]}`); + } + } + + if (failures.length > 0) { + core.setFailed( + "The following commits are missing a 'Signed-off-by' line " + + "(see CONTRIBUTING.md, use `git commit -s`):\n\n" + + failures.map((f) => ` - ${f}`).join("\n") + ); + } else { + core.info(`All ${commits.length} commit(s) are signed off.`); + } diff --git a/.gitmodules b/.gitmodules index 8c0ce309..84583e30 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "HebMorph"] - path = HebMorph - url = https://github.com/kdroidFilter/HebMorph.git [submodule "SeforimMagicIndexer"] path = SeforimMagicIndexer url = https://github.com/kdroidFilter/SeforimMagicIndexer diff --git a/CLA.md b/CLA.md new file mode 100644 index 00000000..2173de05 --- /dev/null +++ b/CLA.md @@ -0,0 +1,60 @@ +# Zayit Individual Contributor License Agreement + +Version 1.0 + +Thank you for contributing to Zayit (the "Project"), maintained by Elie Gambache (the "Maintainer"). The Project +includes this repository, SeforimLibrary, and the other repositories of Zayit. This Contributor +License Agreement ("Agreement") states the terms under which you ("You") contribute to the Project. It does not +transfer your copyright: You keep it, and You may use your Contributions for any other purpose. + +Sign it once by commenting on your first pull request as the CLA bot asks; it then covers all your Contributions. + +## 1. Definitions + +- **"Contribution"**: any original work of authorship, including code, documentation, translations and data, and any + modification of the Project, that You submit to the Project in any form (pull request, patch, issue, email...). +- **"Submit"**: any form of electronic, verbal or written communication sent to the Project or the Maintainer for + inclusion in the Project. + +## 2. Copyright license + +You grant the Maintainer, and any recipient of software distributed by the Maintainer, a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable license to reproduce, prepare derivative works of, publicly +display, publicly perform, sublicense and distribute your Contributions and such derivative works, **under any license +terms, including proprietary terms**, in addition to the GNU AGPL v3 (with its §7(b) attribution term) under which the +Project is published. + +This lets the Maintainer distribute the Project's official builds together with proprietary modules (see "Open core" +in [Zayit's README](https://github.com/kdroidFilter/Zayit#open-core)) and change the Project's license in the future. + +## 3. Patent license + +You grant the Maintainer, and any recipient of software distributed by the Maintainer, a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable patent license to make, have made, use, offer to sell, sell, +import and otherwise transfer your Contributions, where such license applies only to the patent claims licensable by +You that are necessarily infringed by your Contribution alone or by its combination with the Project. + +## 4. Your representations + +You represent that: + +- each Contribution is your original creation, or You have the right to Submit it under this Agreement (and You + identify in it any third-party work and its license); +- if your employer has rights to intellectual property You create, You have received permission to make the + Contribution on its behalf, or your employer has waived such rights; +- to your knowledge, your Contribution does not infringe any third party's rights. + +## 5. The Project's commitment + +The Maintainer will keep publishing the Project's core under an open source license. Your Contribution may be part of +the official builds, which can include proprietary modules. + +## 6. No warranty + +Unless required by applicable law or agreed in writing, You provide your Contributions "AS IS", without warranties or +conditions of any kind. You are not expected to provide support for your Contributions. + +## 7. Notice + +You agree to notify the Maintainer of any facts or circumstances of which You become aware that would make these +representations inaccurate in any respect. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..7537a7dd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,111 @@ +# Contributing to SeforimLibrary + +Thanks for your interest in contributing! SeforimLibrary is part of +[Zayit](https://github.com/kdroidFilter/Zayit) and follows the same rules, which +keep the project clean and legally clear. + +## License of your contributions (inbound = outbound) + +SeforimLibrary, like Zayit, is licensed under the **GNU AGPL v3** together with the **additional +attribution term** under Section 7(b) of that license (the "Powered by the +technologies that drive Zayit — https://zayitapp.com/" requirement). See +[`LICENSE`](LICENSE) for the full text. + +By submitting a contribution (pull request, patch, or any other form), you agree +that your contribution is licensed under the same terms as the project, namely +the GNU AGPL v3 **and** the additional attribution term under Section 7(b), and +under the Contributor License Agreement below. + +## Contributor License Agreement (CLA) + +Zayit is **open core** (see "Open core" in +[Zayit's README](https://github.com/kdroidFilter/Zayit#open-core)): its core, +SeforimLibrary included, is free under the AGPL v3, and its official builds also +include proprietary modules, such as the smart siddur. So that your contribution can be part of those builds, +you sign the [Zayit Contributor License Agreement](CLA.md) once: + +- You **keep the copyright** on your contribution — there is no copyright + assignment. +- You grant the maintainer a broad license on it, which allows distributing it + under other terms too (including with proprietary modules), and a patent + license. + +On your first pull request, the CLA bot asks you to sign by commenting: + +``` +I have read the CLA Document and I hereby sign the CLA +``` + +Your signature covers all your later pull requests. A CI check blocks a pull +request until all its authors have signed. + +## Developer Certificate of Origin (DCO) + +Every commit must also be signed off under the +[Developer Certificate of Origin 1.1](https://developercertificate.org/). By +signing off, you certify that you wrote the code or otherwise have the right to +submit it under the project's license. + +Add a sign-off line to each commit: + +``` +Signed-off-by: Your Name +``` + +The easy way is to use the `-s` flag: + +```bash +git commit -s -m "Your message" +``` + +To sign off the last commit you forgot to sign: + +```bash +git commit --amend -s --no-edit +``` + +A CI check enforces that every commit in a pull request is signed off. + +
+Full text of the Developer Certificate of Origin 1.1 + +``` +Developer Certificate of Origin +Version 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. +``` + +
+ +## Code style + +- Comments in code must be written in English. +- Kotlin code must follow Kotlin conventions and idiomatic style. +- Run the tests before opening a PR: + +```bash +./gradlew test +``` diff --git a/README.MD b/README.MD index 0b6a84ed..0c648a32 100644 --- a/README.MD +++ b/README.MD @@ -155,3 +155,17 @@ Outputs (by default): `build/seforim.db` + `build/catalog.pb` - **sefariasqlite**: Sefaria direct importer - `SefariaDirectImporter` / `GenerateSefariaSqlite`: Sefaria export → SQLite + +## Contributing + +Please read [`CONTRIBUTING.md`](CONTRIBUTING.md) first. In short: contributions are licensed under the same terms as the project (AGPL v3 + the §7b attribution term), you keep your copyright, you sign the [CLA](CLA.md) once (the bot asks on your first pull request), and every commit must be signed off (`git commit -s`, DCO). + +## License + +SeforimLibrary is part of [Zayit](https://github.com/kdroidFilter/Zayit) and is published under the **[AGPL v3](LICENSE)**, with an additional attribution term (AGPL v3, §7b): any use, reproduction, modification, or distribution of this software, or of any work derived from it, must conspicuously display: + +> Powered by the technologies that drive Zayit — https://zayitapp.com/ + +See the top of [`LICENSE`](LICENSE) for the full text. + +Like Zayit, it is **open core**: the [CLA](CLA.md) also lets the maintainer distribute contributions under other terms, including in Zayit's official builds with their proprietary modules (see "Open core" in [Zayit's README](https://github.com/kdroidFilter/Zayit#open-core)).