-
Notifications
You must be signed in to change notification settings - Fork 25
69 lines (67 loc) · 2.17 KB
/
deploy_packages.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Upload Python Package
on:
push:
tags:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
name: "Test and Deploy version on Pypip"
steps:
- name: Check out
uses: actions/checkout@v2
with:
fetch-depth: 0
token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}'
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.9'
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3 -m pip install -U pip
python3 -m pip install --upgrade pip
pip3 install -e '.[fulldev]'
- name: Run tests and linters
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
pip install --upgrade click==8.0.4
python3 -m black naas
python3 -m flake8 naas
pytest --cov=./naas --cov-report=xml
# - name: Upload coverage to Codecov
# if: runner.os == 'Linux'
# uses: codecov/[email protected]
# with:
# token: ${{secrets.CODECOV_TOKEN}}
# file: ./coverage.xml
# fail_ci_if_error: true
# verbose: true
- name: Build package
run: python3 setup.py sdist
- name: Deploy Pypi
uses: remorses/pypi@v3
with:
username: ${{ secrets.PYPIP_USERNAME }}
password: ${{ secrets.PYPIP_PASSWORD }}
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: ${{ github.repository }}
event-type: pypip-deployed
client-payload: '{"ref": "${{ github.ref }}"}'
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
repository: jupyter-naas/kernels
event-type: pypip-deployed
client-payload: '{"ref": "${{ github.ref }}"}'