Skip to content

Make org_name and org_slug optional in Discovery.Organizations.Create… #93

Make org_name and org_slug optional in Discovery.Organizations.Create…

Make org_name and org_slug optional in Discovery.Organizations.Create… #93

Workflow file for this run

name: Publish stytch PyPI package
on:
push:
branches: [main]
jobs:
build-and-publish:
runs-on: ubuntu-latest
name: Build and publish stytch package to PyPI
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Build source tarball
run: python setup.py sdist
- name: Get version
id: version
run: |
VERSION=$(python -c 'import stytch; print(stytch.__version__)')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "release_tag=v$VERSION" >> $GITHUB_OUTPUT
- name: Get changed files
id: files
uses: jitterbit/get-changed-files@v1
- name: Check for version.py diff
id: diff
run: |
FOUND=0
for changed_file in ${{ steps.files.outputs.all }}; do
if [[ $changed_file == "stytch/version.py" ]]; then
FOUND=1
fi
done
echo "diff=$FOUND" >> $GITHUB_OUTPUT
- name: Publish distribution to PyPI
env:
api_token: ${{ secrets.PYPI_API_TOKEN }}
if: steps.diff.outputs.diff != 0 && env.api_token != ''
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create release
if: steps.diff.outputs.diff != 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "${{ steps.version.outputs.release_tag }}" --generate-notes