remove ver verification #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to PyPI | |
on: | |
push: | |
# paths: | |
# - src/mrpro/VERSION # Only trigger if the VERSION file changes | |
jobs: | |
build-testpypi-package: | |
name: Modify version and build package for TestPyPI | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Set environment variable for version suffix | |
run: echo "MRPROVERSIONSUFFIX=.pre$(date +%s)" >> $GITHUB_ENV | |
- name: Build package with version suffix | |
run: | | |
python -m pip install --upgrade build | |
python -m build | |
- name: Store TestPyPi distribution | |
uses: actions/upload-artifact@v4 | |
with: | |
name: testpypi-package-distribution | |
path: dist/ | |
testpypi-deployment: | |
name: Deploy to TestPyPI | |
needs: | |
- build-testpypi-package | |
runs-on: ubuntu-latest | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/mrpro | |
permissions: | |
id-token: write | |
steps: | |
- name: Download TestPyPi distribution | |
uses: actions/download-artifact@v4 | |
with: | |
name: testpypi-package-distribution | |
path: dist/ | |
- name: Publish to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
verbose: true | |
test-install-from-testpypi: | |
name: Test installation from TestPyPI | |
needs: | |
- testpypi-deployment | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install MRpro from TestPyPI | |
run: | | |
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ mrpro | |
build-pypi-package: | |
name: Build package for PyPI | |
runs-on: ubuntu-latest | |
needs: | |
- test-install-from-testpypi | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Build package | |
run: | | |
python -m pip install --upgrade build | |
python -m build | |
- name: Store PyPi distribution | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pypi-package-distribution | |
path: dist/ | |
pypi-deployment: | |
name: Deploy to PyPI | |
needs: | |
- test-install-from-testpypi | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/project/mrpro | |
permissions: | |
id-token: write | |
steps: | |
- name: Download PyPi distribution | |
uses: actions/download-artifact@v4 | |
with: | |
name: pypi-package-distribution | |
path: dist/ | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: github.ref == 'refs/heads/main' | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
verbose: true | |
- name: Success message | |
run: echo "reached end of the script" |