-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update manual publish to pypi workflow (#570)
- Loading branch information
1 parent
4e3879b
commit d63bcd5
Showing
2 changed files
with
87 additions
and
15 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,102 @@ | ||
name: Manual PyPi Publish | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
username: | ||
description: PyPi Username | ||
required: true | ||
default: __token__ | ||
password: | ||
description: PyPi Password | ||
required: true | ||
|
||
jobs: | ||
test: | ||
name: Test / OS ${{ matrix.os }} / Python ${{ matrix.python-version }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Clone Repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Set up Poetry | ||
uses: abatilo/actions-poetry@v3 | ||
with: | ||
poetry-version: 1.8.3 | ||
- name: Run Tests | ||
run: make run_tests | ||
- name: Upload Coverage | ||
uses: codecov/codecov-action@v4 | ||
- name: Run Tests with pydantic v1 | ||
run: | | ||
pip install pydantic==1.10.12 | ||
make tests_only | ||
publish: | ||
name: Manual PyPi Publish | ||
name: "supabase_auth: Manual PyPi Publish" | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/supabase_auth | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- name: Clone Repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Python '3.11' | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- name: Set up Poetry | ||
uses: abatilo/actions-poetry@v3 | ||
with: | ||
poetry-version: 1.8.3 | ||
|
||
- name: Install dependencies | ||
run: poetry install | ||
|
||
- name: Build package distribution directory | ||
id: build_dist | ||
run: make build_package | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
publish_legacy: | ||
name: "gotrue: Manual PyPi Publish" | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/gotrue | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- name: Clone Repository | ||
uses: actions/checkout@v4 | ||
- name: Set up Python '3.10' | ||
- name: Set up Python '3.11' | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
python-version: "3.11" | ||
|
||
- name: Rename Project | ||
id: rename_project | ||
run: make rename_project | ||
|
||
- name: Set up Poetry | ||
uses: abatilo/actions-poetry@v3 | ||
with: | ||
poetry-version: 1.7.1 | ||
poetry-version: 1.8.3 | ||
- name: Setup a local virtual environment (if no poetry.toml file) | ||
run: | | ||
poetry config virtualenvs.create true --local | ||
poetry config virtualenvs.in-project true --local | ||
- uses: actions/cache@v4 | ||
name: Define a cache for the virtual environment based on the dependencies lock file | ||
with: | ||
path: ./.venv | ||
key: venv-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Publish to PyPi | ||
run: poetry publish --build -u ${{ github.event.inputs.username }} -p ${{ github.event.inputs.password }} | ||
|
||
- name: Build package distribution directory | ||
id: build_dist | ||
run: make build_package | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |