Skip to content

👷 Update publish workflow #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 11 additions & 28 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
@@ -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/*
- uses: actions/checkout@v5

- name: Build and publish to pypi
uses: JRubics/poetry-publish@v2.0
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -30,7 +30,7 @@ sequenceDiagram
## Installation

```
pip install fastapi-cloud-tasks
pip install fastapi-gcp-tasks
```

## Key features
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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,
),
),
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/full/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down