Skip to content

Commit db2412c

Browse files
author
Vignesh Kennadi
committed
adds a separate deploy step
1 parent 553c0ab commit db2412c

File tree

2 files changed

+45
-44
lines changed

2 files changed

+45
-44
lines changed

.github/workflows/build-test-lint.yml

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: Python Build, Lint
22

33
on:
44
push:
5-
release:
6-
types: [published]
75

86
jobs:
97
build-test-lint:
@@ -46,45 +44,3 @@ jobs:
4644
# pip install -r requirements/test.txt
4745
# pytest -v
4846
# working-directory: xero-python
49-
deploy:
50-
runs-on: ubuntu-latest
51-
needs: build-test-lint
52-
if: github.event_name == 'release' && github.event.action == 'published'
53-
54-
steps:
55-
- name: Checkout xero-python repo
56-
uses: actions/checkout@v4
57-
with:
58-
repository: XeroAPI/xero-python
59-
path: xero-python
60-
61-
- name: Set up Python environment
62-
uses: actions/setup-python@v5
63-
with:
64-
python-version: '3.8'
65-
cache: 'pip'
66-
67-
- name: Install dependencies
68-
run: |
69-
python -m venv venv
70-
source venv/bin/activate
71-
pip install --upgrade pip
72-
pip install black
73-
sudo pip install flake8
74-
pip install -r requirements.txt -r requirements/dev.txt
75-
working-directory: xero-python
76-
77-
- name: Build new package version
78-
run: python setup.py sdist
79-
working-directory: xero-python
80-
81-
- name: Verify new package version
82-
run: ls -al dist
83-
working-directory: xero-python
84-
85-
- name: Deploy to test PyPi
86-
env:
87-
TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }}
88-
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
89-
run: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
90-
working-directory: xero-python

.github/workflows/deploy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout xero-python repo
11+
uses: actions/checkout@v4
12+
with:
13+
repository: XeroAPI/xero-python
14+
path: xero-python
15+
16+
- name: Set up Python environment
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.8'
20+
cache: 'pip'
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m venv venv
25+
source venv/bin/activate
26+
pip install --upgrade pip
27+
pip install black
28+
sudo pip install flake8
29+
pip install -r requirements.txt -r requirements/dev.txt
30+
working-directory: xero-python
31+
32+
- name: Build new package version
33+
run: python setup.py sdist
34+
working-directory: xero-python
35+
36+
- name: Verify new package version
37+
run: ls -al dist
38+
working-directory: xero-python
39+
40+
- name: Deploy to test PyPi
41+
env:
42+
TWINE_USERNAME: __token__
43+
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }}
44+
run: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
45+
working-directory: xero-python

0 commit comments

Comments
 (0)