Merge pull request #1124 from django-helpdesk/fix_release_script

Fix PyPi release script. Support ReadTheDocs automated release.
This commit is contained in:
Christopher Broderick 2023-10-18 10:02:22 +01:00 committed by GitHub
commit 0d91fcca0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 33 deletions

View File

@ -1,4 +1,4 @@
name: Publish ${package_name} to PyPI / GitHub
name: Publish ${package_name} to PyPI and ReadTheDocs
on:
push:
@ -11,7 +11,9 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Set up Python
uses: actions/setup-python@v2
@ -29,29 +31,3 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Get Asset name
run: |
export PKG=$(ls dist/ | grep tar)
set -- $PKG
echo "name=$1" >> $GITHUB_ENV
- name: Upload Release Asset (sdist) to GitHub
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/${{ env.name }}
asset_name: ${{ env.name }}
asset_content_type: application/zip

32
.readthedocs.yaml Normal file
View File

@ -0,0 +1,32 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true
# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt

View File

@ -43,16 +43,16 @@ master_doc = 'index'
# General information about the project.
project = u'django-helpdesk'
copyright = u'2011-2019, Ross Poulton + django-helpdesk Contributors'
copyright = u'2011-2023, Django-helpdesk Contributors'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.3'
version = '1.x'
# The full version, including alpha/beta/rc tags.
release = '0.3.0.dev2'
release = '1.x'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@ -181,7 +181,7 @@ htmlhelp_basename = 'django-helpdeskdoc'
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'django-helpdesk.tex', u'django-helpdesk Documentation',
u'Ross Poulton + django-helpdesk Contributors', 'manual'),
u'django-helpdesk Contributors', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@ -214,5 +214,5 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'django-helpdesk', u'django-helpdesk Documentation',
[u'Ross Poulton + django-helpdesk Contributors'], 1)
[u'django-helpdesk Contributors'], 1)
]