Skip to content

Commit

Permalink
Merge pull request #157 from XeroAPI/PETOSS-534-Publish-Python-SDK-af…
Browse files Browse the repository at this point in the history
…ter-manual-release-from-GitHub

Petoss 534 publish python sdk after manual release from GitHub
  • Loading branch information
vigneshk-tw authored Sep 26, 2024
2 parents 64e438b + e718f32 commit 49e5f12
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

- name: Set up Python environment
uses: actions/setup-python@v5
with:
with:
python-version: '3.8'
cache: 'pip'

Expand All @@ -29,11 +29,11 @@ jobs:
sudo pip install flake8
pip install -r requirements.txt -r requirements/dev.txt
working-directory: xero-python

- name: Run Flake8
run: flake8 xero_python
working-directory: xero-python

- name: Build package
run: python setup.py sdist
working-directory: xero-python
Expand All @@ -43,4 +43,4 @@ jobs:
# source venv/bin/activate
# pip install -r requirements/test.txt
# pytest -v
# working-directory: xero-python
# working-directory: xero-python
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish
on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout xero-python repo
uses: actions/checkout@v4
with:
repository: XeroAPI/xero-python
path: xero-python

- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: '3.8'
cache: 'pip'

- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip
sudo pip install twine
working-directory: xero-python

- name: Build Package
run: python setup.py sdist
working-directory: xero-python

- name: Publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }}
run: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
working-directory: xero-python

0 comments on commit 49e5f12

Please sign in to comment.