Skip to content

Commit

Permalink
Merge pull request #1124 from django-helpdesk/fix_release_script
Browse files Browse the repository at this point in the history
Fix PyPi release script. Support ReadTheDocs automated release.
  • Loading branch information
uhurusurfa committed Oct 18, 2023
2 parents ca94472 + 1c419b8 commit 0d91fcc
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 33 deletions.
32 changes: 4 additions & 28 deletions .github/workflows/release_to_pypi.yml
@@ -1,4 +1,4 @@
name: Publish ${package_name} to PyPI / GitHub
name: Publish ${package_name} to PyPI and ReadTheDocs

on:
push:
Expand All @@ -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
Expand All @@ -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 changes: 32 additions & 0 deletions .readthedocs.yaml
@@ -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
10 changes: 5 additions & 5 deletions docs/conf.py
Expand Up @@ -43,16 +43,16 @@

# 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.
Expand Down Expand Up @@ -181,7 +181,7 @@
# (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
Expand Down Expand Up @@ -214,5 +214,5 @@
# (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)
]

0 comments on commit 0d91fcc

Please sign in to comment.