-
Notifications
You must be signed in to change notification settings - Fork 4
53 lines (50 loc) · 1.57 KB
/
cornflow-client-publish-to-pypi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Publish cornflow-client Python 🐍 distributions 📦 to PyPI
on:
push:
tags:
- "client*"
jobs:
build-n-publish:
name: Build and publish cornflow-client Python 🐍 distributions 📦 to PyPI
defaults:
run:
working-directory: ./libs/client
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.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
packages_dir: libs/client/dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
packages_dir: libs/client/dist/
- name: Get version number
uses: winterjung/split@v2
id: split
with:
msg : ${{ github.ref_name}}
separator: "t"
- name: Notify slack channel
uses: slackapi/[email protected]
with:
slack-message: "A new version of cornflow client (v${{ steps.split.outputs._1 }}) has been deployed"
channel-id: ${{ secrets.SLACK_CHANNEL }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}