-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: basic test, build and release setup
- Loading branch information
Showing
50 changed files
with
1,573 additions
and
872 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: CI/CD pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Docker image | ||
run: | | ||
docker build -t django2pydantic . | ||
- name: Run tests | ||
run: | | ||
docker run --volume $(pwd):/app --workdir /app --rm django2pydantic nox -s noop | ||
build: | ||
name: Build distribution 📦 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: dist/ | ||
name: python-package-distributions | ||
|
||
release: | ||
# If main branch is updated, we want to release the package. | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
needs: | ||
- tests | ||
- build | ||
concurrency: release | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
# Note: we need to checkout the repository at the workflow sha in case during the workflow | ||
# the branch was updated. To keep PSR working with the configured release branches, | ||
# we force a checkout of the desired release branch but at the workflow sha HEAD. | ||
- name: Setup | Checkout Repository at workflow sha | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.sha }} | ||
|
||
- name: Setup | Force correct release branch on workflow sha | ||
run: | | ||
git checkout -B ${{ github.ref_name }} ${{ github.sha }} | ||
- name: Action | Semantic Version Release | ||
id: release | ||
# Adjust tag with desired version if applicable. | ||
uses: python-semantic-release/python-semantic-release@v9.14.0 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
git_committer_name: "github-actions" | ||
git_committer_email: "actions@users.noreply.github.com" | ||
|
||
- name: Publish | Upload to GitHub Release Assets | ||
uses: python-semantic-release/publish-action@v9.14.0 | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ steps.release.outputs.tag }} | ||
|
||
|
||
publish-to-testpypi: | ||
name: Publish Python 🐍 distribution 📦 to TestPyPI | ||
needs: | ||
- release | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: testpypi | ||
url: https://test.pypi.org/p/django2pydantic | ||
|
||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Contribution guidelines | ||
|
||
Contributions are welcome! Here are some guidelines to help you get started. | ||
|
||
## Support the project | ||
|
||
If you like this project and want to support it, you can: | ||
|
||
- Give it a star on GitHub. | ||
- Share it with others. | ||
- Report issues or request new features. | ||
- Contribute code, documentation, or tests. | ||
- Sponsor the project on GitHub. | ||
|
||
|
||
## Reporting issues | ||
|
||
If you find a bug or have a feature request, please open an issue. Make sure to include a detailed description of the issue or feature request, and include any relevant information that can help us reproduce the issue. | ||
|
||
|
||
## Contributing code | ||
|
||
### Setup development environment | ||
|
||
If you are using Visual Studio Code, you can use the included devcontainer in order to quickly set up a proper development environment. | ||
|
||
### Discuss your changes | ||
|
||
If you are planning to make a significant change, it is a good idea to discuss it first with the project authors. You can open an issue to discuss your changes or discuss it with other contributors the project's discussion channels. | ||
|
||
### Implement your changes | ||
|
||
Make your changes in a new git branch. Make sure to add tests for your changes. | ||
|
||
### Run the tests and checks | ||
|
||
In order for your changes to be accepted, they must pass all the tests and checks. We are using `nox` to run the tests and checks. | ||
The tests and checks are defined in the [noxfile.py](noxfile.py) file. | ||
|
||
You can run `nox` locally to run the tests and checks: | ||
|
||
```shell | ||
nox | ||
``` | ||
|
||
### Add yourself to the contributors list | ||
|
||
If you want to get credit from your contribution, add yourself to the following files: | ||
|
||
- [pyproject.toml](pyproject.toml) | ||
- [CITATION.cff](CITATION.cff) | ||
|
||
### Create a pull request | ||
|
||
Once you are happy with your changes, create a pull request. Make sure to include a description of your changes and why they are needed. | ||
|
||
### Review process | ||
|
||
Your pull request will be reviewed by the project maintainers. They may ask for changes or suggest improvements. Once your pull request is approved, it will be merged into the main branch. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"""Super schema packages.""" | ||
|
||
from django2pydantic.schema import django2pydantic | ||
from django2pydantic.types import Infer, InferExcept, MetaFields, ModelFields | ||
|
||
__all__ = ["Infer", "InferExcept", "ModelFields", "MetaFields", "django2pydantic"] | ||
__version__ = "0.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.