-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Prepare move to Django Commons #9782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
browniebroke
wants to merge
5
commits into
encode:main
Choose a base branch
from
browniebroke:chore/django-commons
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a9cc1cc
Add Django commons release workflow
browniebroke 2a8ec13
Split test release workflow from actual
browniebroke 08e821b
Adopt Django Commons Code of Conduct
browniebroke 3320e0d
Replace encode org by django-commons org
browniebroke febdc70
Merge branch 'main' into chore/django-commons
browniebroke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| blank_issues_enabled: false | ||
| contact_links: | ||
| - name: Discussions | ||
| url: https://github.com/encode/django-rest-framework/discussions | ||
| url: https://github.com/django-commons/django-rest-framework/discussions | ||
| about: > | ||
| The "Discussions" forum is where you want to start. 💖 | ||
| Please note that at this point in its lifespan, we consider Django REST framework to be feature-complete. |
This file contains hidden or 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,101 @@ | ||
| name: Publish Python 🐍 distribution 📦 to PyPI | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| # Order matters, the last rule that applies to a tag | ||
| # is the one that takes effect: | ||
| # https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-including-and-excluding-branches-and-tags | ||
| - '*' | ||
| # There should be no dev tags created, but to be safe, | ||
| # let's not publish them. | ||
| - '!*.dev*' | ||
|
|
||
| env: | ||
| PYPI_URL: https://pypi.org/p/djangorestframework | ||
|
|
||
| jobs: | ||
|
|
||
| build: | ||
| name: Build distribution 📦 | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| 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: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
|
|
||
| publish-to-pypi: | ||
| name: >- | ||
| Publish Python 🐍 distribution 📦 to PyPI | ||
| needs: | ||
| - build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: ${{ env.PYPI_URL }} | ||
| permissions: | ||
| id-token: write # IMPORTANT: mandatory for trusted publishing | ||
| steps: | ||
| - name: Download all the dists | ||
| uses: actions/download-artifact@v5 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
| - name: Publish distribution 📦 to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1.13 | ||
|
|
||
| github-release: | ||
| name: >- | ||
| Sign the Python 🐍 distribution 📦 with Sigstore | ||
| and upload them to GitHub Release | ||
| needs: | ||
| - publish-to-pypi | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: write # IMPORTANT: mandatory for making GitHub Releases | ||
| id-token: write # IMPORTANT: mandatory for sigstore | ||
|
|
||
| steps: | ||
| - name: Download all the dists | ||
| uses: actions/download-artifact@v5 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
| - name: Sign the dists with Sigstore | ||
| uses: sigstore/gh-action-sigstore-python@v3.0.1 | ||
| with: | ||
| inputs: >- | ||
| ./dist/*.tar.gz | ||
| ./dist/*.whl | ||
| - name: Create GitHub Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| run: >- | ||
| gh release create | ||
| '${{ github.ref_name }}' | ||
| --repo '${{ github.repository }}' | ||
| --notes "" | ||
| - name: Upload artifact signatures to GitHub Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| # Upload to GitHub Release using the `gh` CLI. | ||
| # `dist/` contains the built packages, and the | ||
| # sigstore-produced signatures and certificates. | ||
| run: >- | ||
| gh release upload | ||
| '${{ github.ref_name }}' dist/** | ||
| --repo '${{ github.repository }}' |
This file contains hidden or 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,103 @@ | ||
| name: Test Python 🐍 distribution 📦 to TestPyPI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| iteration: | ||
| description: 'A unique iteration for the run. The tag will be suffixed with .devyyyymmdd<iteration>' | ||
| type: string | ||
| required: true | ||
| default: "0" | ||
| schedule: | ||
| # Run the second day of every month. | ||
| - cron: "12 3 2 * *" | ||
| push: | ||
| tags: | ||
| - '*' | ||
|
|
||
| env: | ||
| PYPI_TEST_URL: https://test.pypi.org/p/djangorestframework | ||
| # The environment key that overrides the version number | ||
| DEV_VERSION_ENV_KEY: BEST_PRACTICES_VERSION_DEV | ||
|
|
||
| jobs: | ||
| create-dev-version: | ||
| # Generate the dev version suffix based on the current date. | ||
| # Tag name: | ||
| # <version>.dev<yyyymmdd><iteration> | ||
| name: Create dev version string | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| dev_version: ${{ steps.output-dev-version.outputs.dev_version }} | ||
| steps: | ||
| - name: Set date suffix | ||
| id: set-date | ||
| run: echo "suffix=dev$(date +%Y%m%d)" >> $GITHUB_ENV | ||
| - name: Determine Iteration Value | ||
| id: set-iteration | ||
| # If the action is running on a schedule, default iteration to 0 | ||
| run: | | ||
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | ||
| echo "iteration=${{ github.event.inputs.iteration }}" >> $GITHUB_ENV | ||
| else | ||
| echo "iteration=0" >> $GITHUB_ENV | ||
| fi | ||
| - name: Output dev version | ||
| id: output-dev-version | ||
| # Don't output a dev version if the push was for a tag. | ||
| run: | | ||
| if [[ "${{ startsWith(github.ref, 'refs/tags') }}" == "true" ]]; then | ||
| echo "dev_version=" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "dev_version=${{ env.suffix }}${{ env.iteration }}" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| build: | ||
| name: Build distribution 📦 | ||
| needs: | ||
| - create-dev-version | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| 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 | ||
| env: | ||
| DEV_VERSION: ${{needs.create-dev-version.outputs.dev_version}} | ||
| run: ${{ env.DEV_VERSION_ENV_KEY }}="${{ env.DEV_VERSION }}" python3 -m build | ||
| - name: Store the distribution packages | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
|
|
||
| publish-to-testpypi: | ||
| name: Publish Python 🐍 distribution 📦 to TestPyPI | ||
| needs: | ||
| - build | ||
| runs-on: ubuntu-latest | ||
|
|
||
| environment: | ||
| name: testpypi | ||
| url: ${{ env.PYPI_TEST_URL }} | ||
|
|
||
| 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.12 | ||
| with: | ||
| repository-url: https://test.pypi.org/legacy/ | ||
| skip-existing: true | ||
This file contains hidden or 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,3 @@ | ||
| # Code of Conduct | ||
|
|
||
| Django REST Framework utilizes the [Django Commons Code of Conduct](https://github.com/django-commons/membership/blob/main/CODE_OF_CONDUCT.md). |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need cron?