Skip to content

Merge pull request #9 from 3dem/devel #10

Merge pull request #9 from 3dem/devel

Merge pull request #9 from 3dem/devel #10

# Workflow to send master to pypi and tag the branch:
# You need to edit FOLDER_WITH_VERSION with the folder that has the __version__ value.
name: Publish to pypi and tag version
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ main ]
# 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@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_JMRT_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Get version and tag
run: |
export PACKAGE_VERSION=$(python -c "import emtools; print(emtools.__version__)")
git tag $PACKAGE_VERSION
git push origin $PACKAGE_VERSION