Skip to content

Commit

Permalink
Merge pull request #8 from quantumlib/NoureldinYosri-patch-1
Browse files Browse the repository at this point in the history
Create stable-release-workflow.yml
  • Loading branch information
NoureldinYosri authored Sep 11, 2024
2 parents 3ec8ff5 + 8896bbe commit be8aa44
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/stable-release-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release TypedUnits

on:
release:
types: [published]

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)" > version/version.txt
cat version/version.txt
- uses: actions/upload-artifact@master
with:
name: version-file
path: version

deploy:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
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
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/
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}

0 comments on commit be8aa44

Please sign in to comment.