Skip to content

CD

CD #40

Workflow file for this run

name: CD
on:
workflow_dispatch:
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set Version
run: echo "VERSION=$(awk -F' = ' '/^\[tool.poetry\]$/{f=1} f&&/^version = /{gsub(/"/, "", $2); print $2; exit}' pyproject.toml)" >> $GITHUB_ENV
- name: Create tag
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/V${{ env.VERSION }}',
sha: context.sha
})
- name: Create a Release
uses: elgohr/Github-Release-Action@v5
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
title: Release ${{ env.VERSION }}
- name: Check python versions
run: |
python --version
python3 --version
which python3.10
python3.10 --version
- name: Build and publish to pypi
run: |
curl -sSL https://install.python-poetry.org | python3.10 -
poetry publish -u pinecone -p ${{ secrets.PYPI_PASSWORD }} --build