|
1 | 1 | name: Manual PyPi Publish |
2 | 2 | on: |
3 | 3 | 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 | + |
12 | 5 | 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 |
13 | 32 | 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" |
15 | 63 | 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 |
16 | 69 | steps: |
17 | 70 | - name: Clone Repository |
18 | 71 | uses: actions/checkout@v4 |
19 | | - - name: Set up Python '3.10' |
| 72 | + - name: Set up Python '3.11' |
20 | 73 | uses: actions/setup-python@v5 |
21 | 74 | 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 | + |
23 | 81 | - name: Set up Poetry |
24 | 82 | uses: abatilo/actions-poetry@v3 |
25 | 83 | 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') }} |
27 | 94 | - name: Install dependencies |
28 | 95 | 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