Skip to content

Commit

Permalink
Merge pull request #7 from quantumlib/ci_workflows
Browse files Browse the repository at this point in the history
ci workflows
  • Loading branch information
NoureldinYosri authored Sep 11, 2024
2 parents 2c42ac0 + dd2b2d9 commit 3ec8ff5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
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',
)

0 comments on commit 3ec8ff5

Please sign in to comment.