This repository has been archived by the owner on May 10, 2024. It is now read-only.
Entities.Subscription first pass #18
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: Upload paddle-billing-python-sdk Package to PyPi | |
on: | |
# release: | |
# types: [created] | |
push: | |
branches: [ main ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
id: setup_python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
id: install_deps | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -e . | |
python -m pip install build | |
- name: Build | |
id: build | |
run: | | |
python -m build | |
- name: Check if version has changed | |
id: check_version | |
run: | | |
LOCAL_VERSION=$(python setup.py --version) | |
PYPI_VERSION=$(curl -s https://pypi.org/pypi/paddle-billing-python-sdk/json | jq -r '.info.version') | |
if [ "$LOCAL_VERSION" != "$PYPI_VERSION" ]; then | |
echo "Version has changed. Current version: $LOCAL_VERSION" | |
echo "should_publish=true" >> $GITHUB_ENV | |
else | |
echo "Version has not changed. Skipping publish." | |
echo "should_publish=false" >> $GITHUB_ENV | |
fi | |
- name: Publish to PyPi | |
id: publish | |
if: env.should_publish == 'true' | |
uses: pypa/gh-action-pypi-publish@release/v1 |