Skip to content

Commit 49e5f12

Browse files
authored
Merge pull request #157 from XeroAPI/PETOSS-534-Publish-Python-SDK-after-manual-release-from-GitHub
Petoss 534 publish python sdk after manual release from GitHub
2 parents 64e438b + e718f32 commit 49e5f12

File tree

2 files changed

+43
-4
lines changed

2 files changed

+43
-4
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
- name: Set up Python environment
1818
uses: actions/setup-python@v5
19-
with:
19+
with:
2020
python-version: '3.8'
2121
cache: 'pip'
2222

@@ -29,11 +29,11 @@ jobs:
2929
sudo pip install flake8
3030
pip install -r requirements.txt -r requirements/dev.txt
3131
working-directory: xero-python
32-
32+
3333
- name: Run Flake8
3434
run: flake8 xero_python
3535
working-directory: xero-python
36-
36+
3737
- name: Build package
3838
run: python setup.py sdist
3939
working-directory: xero-python
@@ -43,4 +43,4 @@ jobs:
4343
# source venv/bin/activate
4444
# pip install -r requirements/test.txt
4545
# pytest -v
46-
# working-directory: xero-python
46+
# working-directory: xero-python

.github/workflows/publish.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
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+
sudo pip install twine
28+
working-directory: xero-python
29+
30+
- name: Build Package
31+
run: python setup.py sdist
32+
working-directory: xero-python
33+
34+
- name: Publish to PyPi
35+
env:
36+
TWINE_USERNAME: __token__
37+
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }}
38+
run: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
39+
working-directory: xero-python

0 commit comments

Comments
 (0)