Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit d63bcd5

Browse files
authored
ci: update manual publish to pypi workflow (#570)
1 parent 4e3879b commit d63bcd5

File tree

2 files changed

+87
-15
lines changed

2 files changed

+87
-15
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Set up Poetry
3131
uses: abatilo/actions-poetry@v3
3232
with:
33-
poetry-version: 1.3.2
33+
poetry-version: 1.8.3
3434
- name: Run Tests
3535
run: make run_tests
3636
- name: Upload Coverage
Lines changed: 86 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,102 @@
11
name: Manual PyPi Publish
22
on:
33
workflow_dispatch:
4-
inputs:
5-
username:
6-
description: PyPi Username
7-
required: true
8-
default: __token__
9-
password:
10-
description: PyPi Password
11-
required: true
4+
125
jobs:
6+
test:
7+
name: Test / OS ${{ matrix.os }} / Python ${{ matrix.python-version }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest]
11+
python-version: ["3.9", "3.10", "3.11", "3.12"]
12+
runs-on: ${{ matrix.os }}
13+
steps:
14+
- name: Clone Repository
15+
uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Set up Poetry
21+
uses: abatilo/actions-poetry@v3
22+
with:
23+
poetry-version: 1.8.3
24+
- name: Run Tests
25+
run: make run_tests
26+
- name: Upload Coverage
27+
uses: codecov/codecov-action@v4
28+
- name: Run Tests with pydantic v1
29+
run: |
30+
pip install pydantic==1.10.12
31+
make tests_only
1332
publish:
14-
name: Manual PyPi Publish
33+
name: "supabase_auth: Manual PyPi Publish"
34+
runs-on: ubuntu-latest
35+
environment:
36+
name: pypi
37+
url: https://pypi.org/p/supabase_auth
38+
permissions:
39+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
40+
steps:
41+
- name: Clone Repository
42+
uses: actions/checkout@v4
43+
- name: Set up Python '3.11'
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: "3.11"
47+
- name: Set up Poetry
48+
uses: abatilo/actions-poetry@v3
49+
with:
50+
poetry-version: 1.8.3
51+
52+
- name: Install dependencies
53+
run: poetry install
54+
55+
- name: Build package distribution directory
56+
id: build_dist
57+
run: make build_package
58+
59+
- name: Publish package distributions to PyPI
60+
uses: pypa/gh-action-pypi-publish@release/v1
61+
publish_legacy:
62+
name: "gotrue: Manual PyPi Publish"
1563
runs-on: ubuntu-latest
64+
environment:
65+
name: pypi
66+
url: https://pypi.org/p/gotrue
67+
permissions:
68+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1669
steps:
1770
- name: Clone Repository
1871
uses: actions/checkout@v4
19-
- name: Set up Python '3.10'
72+
- name: Set up Python '3.11'
2073
uses: actions/setup-python@v5
2174
with:
22-
python-version: "3.10"
75+
python-version: "3.11"
76+
77+
- name: Rename Project
78+
id: rename_project
79+
run: make rename_project
80+
2381
- name: Set up Poetry
2482
uses: abatilo/actions-poetry@v3
2583
with:
26-
poetry-version: 1.7.1
84+
poetry-version: 1.8.3
85+
- name: Setup a local virtual environment (if no poetry.toml file)
86+
run: |
87+
poetry config virtualenvs.create true --local
88+
poetry config virtualenvs.in-project true --local
89+
- uses: actions/cache@v4
90+
name: Define a cache for the virtual environment based on the dependencies lock file
91+
with:
92+
path: ./.venv
93+
key: venv-${{ hashFiles('poetry.lock') }}
2794
- name: Install dependencies
2895
run: poetry install
29-
- name: Publish to PyPi
30-
run: poetry publish --build -u ${{ github.event.inputs.username }} -p ${{ github.event.inputs.password }}
96+
97+
- name: Build package distribution directory
98+
id: build_dist
99+
run: make build_package
100+
101+
- name: Publish package distributions to PyPI
102+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)