Skip to content

Commit

Permalink
ci: update manual publish to pypi workflow (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
silentworks authored Aug 12, 2024
1 parent 4e3879b commit d63bcd5
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.3.2
poetry-version: 1.8.3
- name: Run Tests
run: make run_tests
- name: Upload Coverage
Expand Down
100 changes: 86 additions & 14 deletions .github/workflows/manual_pypi_publish.yml
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

0 comments on commit d63bcd5

Please sign in to comment.