Skip to content

Publish

Publish #8

Workflow file for this run

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__
run: |
if [[ "${{ github.event.release.name }}" == *"alpha"* || "${{ github.event.release.name }}" == *"beta"* ]]; then
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} twine upload --repository-url https://test.pypi.org/legacy/ dist/* --verbose
else
TWINE_PASSWORD: ${{ secrets.PYPI_APIKEY }} twine upload dist/* --verbose
fi
working-directory: xero-python