Merge pull request #5 from azazellochg/devel #4
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
# Workflow to send master to pypi and tag the branch | |
name: master to pypi with comments and tag | |
on: | |
push: | |
branches: [ master ] | |
env: | |
FOLDER_WITH_VERSION: perfectem | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools twine build wheel | |
pip install numpy scipy matplotlib mrcfile | |
- name: Build and publish | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
python -m build --no-isolation | |
twine upload dist/* | |
- name: Get version and tag | |
run: | | |
export PACKAGE_VERSION=$(python -c "import $FOLDER_WITH_VERSION; print('VERSION', 'v'+$FOLDER_WITH_VERSION.__version__)" | grep VERSION | sed "s/VERSION //g") | |
git tag $PACKAGE_VERSION | |
git push origin $PACKAGE_VERSION |