-
Notifications
You must be signed in to change notification settings - Fork 82
81 lines (78 loc) · 2.21 KB
/
ci.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
70
71
72
73
74
75
76
77
78
79
80
81
name: CI
on:
push:
branches:
- master
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
python -m build
python -m pip install --upgrade twine
python -m twine check dist/*
- name: 'Upload Artifact'
uses: actions/upload-artifact@v2
with:
name: dist
path: dist/
test:
name: Test Coverage
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install responses
pip install coverage
python ${{ github.workspace }}/setup.py install
- name: Run Tests
run: |
python -m coverage run -m unittest
python -m coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
publish:
if: startsWith(github.ref, 'refs/tags/v')
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download all workflow run artifacts
uses: actions/[email protected]
with:
name: dist
path: dist
- name: Set up Python 3
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Publish packages to PyPi
run: |
python -m pip install --upgrade twine
set -ex
export VERSION=$(python3 setup.py --version)
python -m twine upload --verbose dist/razorpay-$VERSION-py3-none-any.whl dist/razorpay-$VERSION.tar.gz
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}