Make org_name and org_slug optional in Discovery.Organizations.Create… #93
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: 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 |