version to v0.1.2 (#38) #3
Workflow file for this run
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
name: Upload PyPI And Release | |
on: | |
push: | |
tags: | |
- "v*" | |
workflow_dispatch: | |
env: | |
POETRY_VERSION: "1.8.3" | |
PYTHON_VERSION: "3.10.9" | |
jobs: | |
build-n-publish: | |
name: Build and publish to PyPI | |
if: github.repository == 'LazyAGI/LazyLLM' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- name: Set up python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
- name: Install deps | |
shell: bash | |
run: pip install -e . | |
- name: Test import | |
working-directory: ${{ vars.RUNNER_TEMP }} | |
shell: bash | |
run: python -c "import lazyllm" && cp LazyLLM-Env/poetry.lock . | |
- name: Build and publish to pypi | |
uses: JRubics/poetry-publish@v1.17 | |
with: | |
pypi_token: ${{ secrets.LazyLLM_INDEX_PYPI_TOKEN }} | |
ignore_dev_requirements: "yes" | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Get Asset name | |
run: | | |
export PKG=$(ls dist/ | grep tar) | |
set -- $PKG | |
echo "name=$1" >> $GITHUB_ENV | |
- name: Upload Release Asset (sdist) to GitHub | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: dist/${{ env.name }} | |
asset_name: ${{ env.name }} | |
asset_content_type: application/zip |