@@ -18,46 +18,55 @@ jobs:
18
18
strategy :
19
19
matrix :
20
20
python-version : [ '2.7', '3.5', '3.6', '3.7', '3.8', '3.9' ]
21
+ env :
22
+ DOCKER_LOGIN : ${{ secrets.DOCKER_USERNAME && secrets.DOCKER_AUTH_TOKEN }}
21
23
steps :
22
24
- name : Checkout sendgrid-python
23
25
uses : actions/checkout@v2
24
26
27
+ - name : Login to Docker Hub
28
+ if : env.DOCKER_LOGIN
29
+ uses : docker/login-action@v1
30
+ with :
31
+ username : ${{ secrets.DOCKER_USERNAME }}
32
+ password : ${{ secrets.DOCKER_AUTH_TOKEN }}
33
+
25
34
- name : Build & Test
26
35
run : make test-docker version=${{ matrix.python-version }}
27
36
28
37
deploy :
29
- name : Deploy
30
- if : success() && github.ref_type == 'tag'
31
- needs : [ test ]
32
- runs-on : ubuntu-latest
33
- steps :
34
- - name : Checkout sendgrid-python
35
- uses : actions/checkout@v2
38
+ name : Deploy
39
+ if : success() && github.ref_type == 'tag'
40
+ needs : [ test ]
41
+ runs-on : ubuntu-latest
42
+ steps :
43
+ - name : Checkout sendgrid-python
44
+ uses : actions/checkout@v2
36
45
37
- - name : Set up Python
38
- uses : actions/setup-python@v2
39
- with :
40
- python-version : ' 3.6'
46
+ - name : Set up Python
47
+ uses : actions/setup-python@v2
48
+ with :
49
+ python-version : ' 3.6'
41
50
42
- - name : Install dependencies
43
- run : |
44
- python -m pip install --upgrade pip
45
- pip install build
46
- pip install wheel
47
- python setup.py sdist bdist_wheel
51
+ - name : Install dependencies
52
+ run : |
53
+ python -m pip install --upgrade pip
54
+ pip install build
55
+ pip install wheel
56
+ python setup.py sdist bdist_wheel
48
57
49
- - name : Create GitHub Release
50
- uses : sendgrid/dx-automator/actions/release@main
51
- with :
52
- footer : ' **[pypi](https://pypi.org/project/sendgrid/${version})**'
53
- env :
54
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
58
+ - name : Create GitHub Release
59
+ uses : sendgrid/dx-automator/actions/release@main
60
+ with :
61
+ footer : ' **[pypi](https://pypi.org/project/sendgrid/${version})**'
62
+ env :
63
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55
64
56
- - name : Publish package to PyPI
57
- uses : pypa/gh-action-pypi-publish@release/v1
58
- with :
59
- user : __token__
60
- password : ${{ secrets.PYPI_TOKEN }}
65
+ - name : Publish package to PyPI
66
+ uses : pypa/gh-action-pypi-publish@release/v1
67
+ with :
68
+ user : __token__
69
+ password : ${{ secrets.PYPI_TOKEN }}
61
70
62
71
notify-on-failure :
63
72
name : Slack notify on failure
0 commit comments