Updates README copy and formatting (#78) #81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, test, deploy pip package of datalab cmd line client | |
on: | |
push: | |
branches: | |
- master | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install --upgrade setuptools wheel twine build | |
- name: Build pip package | |
run: | | |
rm -rf dist/ build/ datalab_client.egg-info/ astro_datalab.egg-info/ | |
python -m build | |
- name: Print release event details | |
if: github.event_name == 'release' | |
run: | | |
echo "Event: ${{ github.event_name }}" | |
echo "Action: ${{ github.event.action }}" | |
- name: Upload package to PyPI | |
# TODO: | |
# break this workflow in two jobs, make the first job to output the build directory to a | |
# place the next job can upload from. | |
# | |
# Only execute this step if it is a release and just do it for one python version | |
if: ${{ matrix.python-version == '3.11' }} && github.event_name == 'release' && github.event.action == 'published' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
# for testing purposes set the PYPI_REPO_URL to https://test.pypi.org/legacy/ | |
PYPI_REPO_URL: '' | |
run: | | |
if [ -z "${{ env.PYPI_REPO_URL }}" ]; then | |
twine upload --verbose dist/* | |
else | |
twine upload --verbose --repository-url "${{ env.PYPI_REPO_URL }}" dist/* | |
fi | |