Skip to content

Bump version of cornflow-client (#472) #38

Bump version of cornflow-client (#472)

Bump version of cornflow-client (#472) #38

name: Publish cornflow Python 🐍 distributions 📦 to PyPI
on:
push:
tags:
- "cornflow*"
jobs:
build-n-publish:
name: Build and publish cornflow Python 🐍 distributions 📦 to PyPI
defaults:
run:
working-directory: ./cornflow-server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install wheel
run: >-
python -m
pip install
wheel
--user
- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.CORNFLOW_TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
packages_dir: cornflow-server/dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.CORNFLOW_PYPI_TOKEN }}
packages_dir: cornflow-server/dist/
- name: Get version number
uses: jungwinter/split@v2
id: split
with:
msg : ${{ github.ref_name }}
separator: "w"
- name: Notify slack channel
uses: slackapi/[email protected]
with:
slack-message: "A new version of cornflow (v${{ steps.split.outputs._1 }}) has been deployed"
channel-id: ${{ secrets.SLACK_CHANNEL }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
- name: Tag published version for docker hub trigger
run: |
sleep 30s
git config --local user.email "[email protected]"
git config --local user.name "cornflow"
git tag -a v${{ steps.split.outputs._1 }} -m "Published cornflow version v${{ steps.split.outputs._1 }}"
git push origin v${{ steps.split.outputs._1 }}
git push --delete origin ${{ github.ref_name }}