Skip to content

Commit

Permalink
Merge pull request #101 from PerformanceEstimation/workflow/automatic…
Browse files Browse the repository at this point in the history
…_push_to_pypi

Setup workflow to automatically upload releases to PyPI
  • Loading branch information
AdrienTaylor authored Oct 1, 2024
2 parents 80958bc + 6e52303 commit 8d6d9f5
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/execute_notebook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
pip install lxml_html_clean
pip install -r requirements.txt
pip install mosek
- name: Update version in setup.py
run: >-
sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py
- name: Install PEPit
run: |
pip install -e .
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/pypi_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Python 🐍 distributions 📦 to PyPI

on:
push:
tags:
- '*'

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install pypa/setuptools
run: >-
python -m
pip install wheel
- name: Extract tag name
id: tag
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Update version in setup.py
run: >-
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py
- name: Build a binary wheel
run: >-
python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install coverage
- name: Update version in setup.py
run: >-
sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py
- name: Install PEPit
run: |
pip install -e .
Expand Down Expand Up @@ -75,6 +78,9 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install coverage
- name: Update version in setup.py
run: >-
sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py
- name: Install PEPit
run: |
pip install -e .
Expand Down Expand Up @@ -105,6 +111,9 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install coverage
- name: Update version in setup.py
run: >-
sed -i "s/{{VERSION_PLACEHOLDER}}/0.0.0/g" setup.py
- name: Install PEPit
run: |
pip install -e .
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

version = "0.3.3"
version = "{{VERSION_PLACEHOLDER}}"

setuptools.setup(
name="PEPit",
Expand Down

0 comments on commit 8d6d9f5

Please sign in to comment.