diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 92a429b..72717a8 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -9,6 +9,23 @@ permissions: contents: read jobs: + create_version: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Create version + run: | + mkdir version + echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version/version.txt + cat version/version.txt + - uses: actions/upload-artifact@master + with: + name: version-file + path: version + deploy: runs-on: ubuntu-latest @@ -27,19 +44,26 @@ jobs: python -m pip install --upgrade pip pip install build auditwheel patchelf + - uses: actions/download-artifact@master + with: + name: version-file + path: version + - name: Build package - env: - TypedUnits_RELEASE_VERSION: ${{ "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" }} - run: python -m build + run: | + export TypedUnits_RELEASE_VERSION="$(cat version/version.txt)" + python -m build - name: Repair Wheel run: | auditwheel repair --plat manylinux2014_x86_64 dist/*.whl rm dist/*.whl mv wheelhouse/* dist/ + rm dist/*.tar.gz + - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: - repository-url: https://test.pypi.org/legacy/ + repository_url: https://test.pypi.org/legacy/ user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} \ No newline at end of file diff --git a/setup.py b/setup.py index c4265d2..e7291f3 100644 --- a/setup.py +++ b/setup.py @@ -49,4 +49,6 @@ install_requires=requirements, setup_requires=requirements, python_requires=">=3.10.0", + long_description=open("README.md", encoding="utf-8").read(), + long_description_content_type='text/markdown', )