libs - Release Publish to pypi #17
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: libs/infinity_emb - Release Publish to pypi | |
on: | |
release: | |
types: [published] | |
env: | |
POETRY_VERSION: "1.6.1" | |
WORKDIR: "libs/infinity_emb" | |
jobs: | |
build: | |
defaults: | |
run: | |
working-directory: ${{ env.WORKDIR }} | |
runs-on: ubuntu-latest | |
environment: | |
name: publish | |
permissions: | |
# This permission is used for trusted publishing: | |
# https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/ | |
# | |
# Trusted publishing has to also be configured on PyPI for each package: | |
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/ | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python + Poetry ${{ env.POETRY_VERSION }} | |
uses: "./.github/actions/poetry_setup" | |
with: | |
python-version: "3.10" | |
poetry-version: ${{ env.POETRY_VERSION }} | |
working-directory: ${{ env.WORKDIR }} | |
cache-key: release | |
- name: Build project for distribution | |
run: poetry build | |
- name: Check Version | |
id: check-version | |
run: | | |
echo version=$(poetry version --short) >> $GITHUB_OUTPUT | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: ${{ env.WORKDIR }}/dist/ | |
verbose: true | |
print-hash: true | |
post-test-pypi-publish: | |
defaults: | |
run: | |
working-directory: ${{ env.WORKDIR }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
name: Python ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} | |
uses: "./.github/actions/poetry_setup" | |
with: | |
python-version: ${{ matrix.python-version }} | |
poetry-version: ${{ env.POETRY_VERSION }} | |
working-directory: ${{ inputs.working-directory }} | |
cache-key: core${{ matrix.python-version }} | |
- name: Install minimal dependencies and import | |
shell: bash | |
run: | | |
sleep 60 | |
poetry run pip install infinity-emb[server] | |
poetry run infinity-emb --help | |
poetry run python -c "import infinity_emb" |