Update publish_and_tag.yml #29
This file contains hidden or 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
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ master ] | |
env: | |
FOLDER_WITH_VERSION: warp | |
SCIPION_CANCEL_XMIPP_BINDING_WARNING: True | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade setuptools wheel twine build | |
- name: Build and publish | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
python -m build | |
twine upload dist/* -c "${{ secrets.PYPI_COMMENT }}" | |
- name: Get version and tag | |
run: | | |
export PACKAGE_VERSION=$(python -c "import $FOLDER_WITH_VERSION; print('v'+$FOLDER_WITH_VERSION.__version__);") | |
git tag $PACKAGE_VERSION | |
git push origin $PACKAGE_VERSION |