1
0
mirror of https://github.com/myhdl/myhdl.git synced 2024-12-14 07:44:38 +08:00

Clean PyPi release flow 17/12/2022 (#399)

* Move conditional so the whole job doesn't run unless it is a tag

* Add dist to make and restructure release

* Add message

* Add message

* Add message

* Add message

* Add message

* Add message

* Add message

* Add message

* Add message

* Add README to release to appear on PyPi

* Added read definition
This commit is contained in:
Dave Keeshan 2022-12-18 19:30:27 +00:00 committed by GitHub
parent f8022d3dbd
commit 3775119f83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions

View File

@ -81,14 +81,14 @@ jobs:
make ${CI_TARGET}
pypy_release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [build_code]
steps:
- uses: actions/checkout@v3
- name: Make PyPi dist release
run: make release
run: make dist
- name: Publish Python distribution to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

View File

@ -1,4 +1,7 @@
PYTEST_OPTS ?=
TAG ?=`grep __version__ myhdl/__init__.py | grep -oe '\([0-9.]*\)'`
MSG ?= "Release "${TAG}
VERSION_FILE := myhdl/__init__.py
ANSI_RED=`tput setaf 1`
ANSI_GREEN=`tput setaf 2`
ANSI_CYAN=`tput setaf 6`
@ -16,11 +19,18 @@ docs:
livedocs:
tox -e docs livehtml
release:
dist:
rm -rf MANIFEST
rm -rf CHANGELOG.txt
#hg glog > CHANGELOG.txt
python setup.py sdist
python setup.py sdist
release:
@echo "Preparing ${TAG} - Message - ${MSG}"
@sed -i "s|__version__ = \"[0-9.]\+\"|__version__ = \"${TAG}\"|g" ${VERSION_FILE}
git commit --allow-empty -m ${MSG} ${VERSION_FILE}
git tag -a ${TAG} -m ${MSG}
git push && git push --tags
clean:
rm -rf *.vhd *.v *.o *.log *.hex work/ cosimulation/icarus/myhdl.vpi

View File

@ -33,11 +33,16 @@ for base, dir, files in os.walk('cosimulation'):
if good:
cosim_data[base].extend(os.path.join(base, f) for f in good)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="myhdl",
version=version,
description="Python as a Hardware Description Language",
long_description="See home page.",
long_description=read('README.md'),
long_description_content_type='text/markdown',
author="Jan Decaluwe",
author_email="jan@jandecaluwe.com",
url="http://www.myhdl.org",