mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-13 07:21:56 +08:00
Release django-stubs and django-stubs-ext
This commit is contained in:
77
.github/workflows/release-django-stubs-ext.yml
vendored
Normal file
77
.github/workflows/release-django-stubs-ext.yml
vendored
Normal file
@@ -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.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`,
|
||||||
|
})
|
||||||
@@ -1,18 +1,22 @@
|
|||||||
name: Release
|
# Please, keep it in sync with `release-django-stubs-ext.yml`
|
||||||
|
name: Release django-stubs
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- 'django-stubs@*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
environment:
|
||||||
|
name: django-stubs-pypi
|
||||||
|
url: https://pypi.org/project/django-stubs
|
||||||
|
|
||||||
if: github.repository == 'typeddjango/django-stubs'
|
if: github.repository == 'typeddjango/django-stubs'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
- uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.9'
|
||||||
@@ -21,7 +25,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python -m pip install -U pip
|
python -m pip install -U pip
|
||||||
python -m pip install -U setuptools twine wheel
|
python -m pip install -U setuptools twine wheel
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
run: |
|
run: |
|
||||||
python setup.py --version
|
python setup.py --version
|
||||||
@@ -31,8 +34,8 @@ jobs:
|
|||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
with:
|
with:
|
||||||
user: __token__
|
user: __token__
|
||||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
password: ${{ secrets.DJANGO_STUBS_PYPI_API_TOKEN }}
|
||||||
|
packages_dir: './dist'
|
||||||
print_hash: true
|
print_hash: true
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
@@ -44,7 +47,7 @@ jobs:
|
|||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
tag_name: tagName,
|
tag_name: tagName,
|
||||||
name: `Release ${tagName.replace(/^v/, '')}`,
|
name: `Release of ${tagName} failed`,
|
||||||
generate_release_notes: true,
|
generate_release_notes: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -4,7 +4,7 @@ default_language_version:
|
|||||||
python: python3.9
|
python: python3.9
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.0.1
|
rev: v4.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
@@ -13,12 +13,12 @@ repos:
|
|||||||
- id: check-merge-conflict
|
- id: check-merge-conflict
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v2.29.1
|
rev: v2.34.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: ["--py36-plus"]
|
args: ["--py36-plus"]
|
||||||
- repo: https://github.com/pre-commit/mirrors-isort
|
- repo: https://github.com/pre-commit/mirrors-isort
|
||||||
rev: v5.9.3
|
rev: v5.10.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
name: isort (python)
|
name: isort (python)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ dependencies = [
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="django-stubs-ext",
|
name="django-stubs-ext",
|
||||||
version="0.4.0",
|
version="0.5.0",
|
||||||
description="Monkey-patching and extensions for django-stubs",
|
description="Monkey-patching and extensions for django-stubs",
|
||||||
long_description=readme,
|
long_description=readme,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
@@ -39,6 +39,7 @@ setup(
|
|||||||
"Framework :: Django :: 3.0",
|
"Framework :: Django :: 3.0",
|
||||||
"Framework :: Django :: 3.1",
|
"Framework :: Django :: 3.1",
|
||||||
"Framework :: Django :: 3.2",
|
"Framework :: Django :: 3.2",
|
||||||
|
"Framework :: Django :: 4.0",
|
||||||
],
|
],
|
||||||
project_urls={
|
project_urls={
|
||||||
"Release notes": "https://github.com/typeddjango/django-stubs/releases",
|
"Release notes": "https://github.com/typeddjango/django-stubs/releases",
|
||||||
|
|||||||
5
setup.py
5
setup.py
@@ -36,7 +36,7 @@ extras_require = {
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="django-stubs",
|
name="django-stubs",
|
||||||
version="1.11.1",
|
version="1.12.0",
|
||||||
description="Mypy stubs for Django",
|
description="Mypy stubs for Django",
|
||||||
long_description=readme,
|
long_description=readme,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
@@ -44,6 +44,8 @@ setup(
|
|||||||
url="https://github.com/typeddjango/django-stubs",
|
url="https://github.com/typeddjango/django-stubs",
|
||||||
author="Maksim Kurnikov",
|
author="Maksim Kurnikov",
|
||||||
author_email="maxim.kurnikov@gmail.com",
|
author_email="maxim.kurnikov@gmail.com",
|
||||||
|
maintainer="Nikita Sobolev",
|
||||||
|
maintainer_email="mail@sobolevn.me",
|
||||||
py_modules=[],
|
py_modules=[],
|
||||||
python_requires=">=3.7",
|
python_requires=">=3.7",
|
||||||
install_requires=dependencies,
|
install_requires=dependencies,
|
||||||
@@ -65,6 +67,7 @@ setup(
|
|||||||
"Framework :: Django :: 3.0",
|
"Framework :: Django :: 3.0",
|
||||||
"Framework :: Django :: 3.1",
|
"Framework :: Django :: 3.1",
|
||||||
"Framework :: Django :: 3.2",
|
"Framework :: Django :: 3.2",
|
||||||
|
"Framework :: Django :: 4.0",
|
||||||
],
|
],
|
||||||
project_urls={
|
project_urls={
|
||||||
"Release notes": "https://github.com/typeddjango/django-stubs/releases",
|
"Release notes": "https://github.com/typeddjango/django-stubs/releases",
|
||||||
|
|||||||
Reference in New Issue
Block a user