generated from samuelint/python-poetry-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
123 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
workflow_call: | ||
secrets: | ||
OPENAI_API_KEY: | ||
required: true | ||
ANTHROPIC_API_KEY: | ||
required: true | ||
|
||
jobs: | ||
build: | ||
name: Build & Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry install | ||
# Models should be stored using LFS or downloaded in the pipeline for tests to be run | ||
# - name: Run tests | ||
# run: | | ||
# poetry run pytest | ||
|
||
- name: Build | ||
run: | | ||
pip install poetry | ||
poetry build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./dist |
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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Publish to PyPI | ||
|
||
env: | ||
PYPI_PACKAGE_NAME: langchain_llamacpp_chat_model | ||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
publish: | ||
name: Publish to PyPI | ||
runs-on: ubuntu-latest | ||
environment: release | ||
permissions: | ||
id-token: write | ||
contents: write | ||
steps: | ||
- name: Extract version from tag | ||
id: extract_version | ||
run: | | ||
TAG_NAME=${{ github.event.release.tag_name }} | ||
if [[ $TAG_NAME =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then | ||
VERSION=${BASH_REMATCH[1]} | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
else | ||
echo "The tag $TAG_NAME is not in the expected format 'v<MAJOR>.<MINOR>.<PATCH>'" | ||
exit 1 | ||
fi | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
poetry install | ||
- name: Update version in pyproject.toml | ||
run: | | ||
poetry version ${{ env.VERSION }} | ||
# Models should be stored using LFS or downloaded in the pipeline for tests to be run | ||
# - name: Run tests | ||
# run: | | ||
# poetry run pytest | ||
|
||
- name: Build | ||
run: | | ||
poetry build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./dist | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: Bump version to ${{ env.VERSION }} | ||
branch: main | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: ./dist |
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 |
---|---|---|
|
@@ -11,3 +11,6 @@ __pycache__/ | |
*.pyi | ||
*.pyw | ||
*.pytest_cache | ||
|
||
*.tar.gz | ||
*.whl |
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