Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci workflows #7

Merged
merged 15 commits into from
Sep 11, 2024
32 changes: 28 additions & 4 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
)