diff --git a/.github/workflows/pypi-publish.yaml b/.github/workflows/pypi-publish.yaml index 0ad09a4..5c75688 100644 --- a/.github/workflows/pypi-publish.yaml +++ b/.github/workflows/pypi-publish.yaml @@ -1,32 +1,15 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: Upload Python Package - +name: Publish python package on: - release: - types: [created] - + push: + tags: + - "v*.*.*" jobs: - deploy: - + publish: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - run: | - echo ${{github.event.release.tag_name}} > version.txt - python setup.py sdist bdist_wheel - twine upload dist/* \ No newline at end of file + - uses: actions/checkout@v5 + + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v2.0 + with: + pypi_token: ${{ secrets.PYPI_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index 6499887..fe7a2a5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # FastAPI Cloud Tasks -Strongly typed background tasks with FastAPI and Google CloudTasks. +Strongly typed background tasks with FastAPI and Google CloudTasks. This is a fork of [fastapi-gcp-tasks](https://github.com/adori/fastapi-gcp-tasks), updated with new features and bug fixes. ```mermaid sequenceDiagram @@ -30,7 +30,7 @@ sequenceDiagram ## Installation ``` -pip install fastapi-cloud-tasks +pip install fastapi-gcp-tasks ``` ## Key features @@ -138,7 +138,7 @@ FastAPI Cloud Tasks works by putting the three together: ### Local Pre-requisites: -- `pip install fastapi-cloud-tasks` +- `pip install fastapi-gcp-tasks` - Install [cloud-tasks-emulator](https://github.com/aertje/cloud-tasks-emulator) - Alternatively install ngrok and forward the server's port @@ -237,7 +237,7 @@ DelayedRoute = DelayedRouteBuilder( pre_create_hook=oidc_task_hook( token=tasks_v2.OidcToken( # Service account that you created - service_account_email="fastapi-cloud-tasks@gcp-project-id.iam.gserviceaccount.com", + service_account_email="fastapi-gcp-tasks@gcp-project-id.iam.gserviceaccount.com", audience=base_url, ), ), @@ -369,13 +369,13 @@ Check the file [fastapi_cloud_tasks/dependencies.py](fastapi_gcp_tasks/dependenc ## Contributing -- Run `pre-commit install` on your local to get pre-commit hook. -- Make changes and raise a PR! +- Run the `format.sh` and `lint.sh` scripts before raising a PR. +- Add examples and/or tests for new features. - If the change is massive, open an issue to discuss it before writing code. ## License -This project is licensed under the terms of the MIT license. This project was forked from [fastapi-cloud-tasks](https://github.com/Adori/fastapi-cloud-tasks) under the MIT license. All changes made to the original project are also licensed under the MIT license. +This project is licensed under the terms of the MIT license. This project was forked from [fastapi-gcp-tasks](https://github.com/Adori/fastapi-gcp-tasks) under the MIT license. All changes made to the original project are also licensed under the MIT license. ## Disclaimer diff --git a/examples/full/settings.py b/examples/full/settings.py index 70ab417..01957be 100644 --- a/examples/full/settings.py +++ b/examples/full/settings.py @@ -23,7 +23,7 @@ TASK_SERVICE_ACCOUNT = os.getenv( "TASK_SERVICE_ACCOUNT", - default=f"fastapi-cloud-tasks@{TASK_PROJECT_ID}.iam.gserviceaccount.com", + default=f"fastapi-gcp-tasks@{TASK_PROJECT_ID}.iam.gserviceaccount.com", ) TASK_QUEUE_PATH = queue_path(