This commit is contained in:
Deshraj Yadav
2024-07-17 23:40:12 -07:00
committed by GitHub
parent 7441f1462d
commit fb5a3bfd95
10 changed files with 146 additions and 20 deletions

View File

@@ -2,14 +2,13 @@ name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
on:
release:
types: [published] # This will trigger the workflow when you create a new release
types: [published]
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v2
@@ -25,16 +24,23 @@ jobs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install
run: |
cd embedchain
poetry install
- name: Build a binary wheel and a source tarball
run: poetry build
run: |
cd embedchain
poetry build
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository_url: https://test.pypi.org/legacy/
packages_dir: embedchain/dist/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: embedchain/dist/

View File

@@ -5,13 +5,13 @@ on:
branches: [main]
paths:
- 'embedchain/**'
- 'tests/**'
- 'examples/**'
- 'embedchain/tests/**'
- 'embedchain/examples/**'
pull_request:
paths:
- 'embedchain/**'
- 'tests/**'
- 'examples/**'
- 'embedchain/embedchain/**'
- 'embedchain/tests/**'
- 'embedchain/examples/**'
jobs:
build:
@@ -39,12 +39,12 @@ jobs:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: make install_all
run: cd embedchain && make install_all
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Lint with ruff
run: make lint
run: cd embedchain && make lint
- name: Run tests and generate coverage report
run: make coverage
run: cd embedchain && make coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with: