Skip to content

Commit

Permalink
Merge pull request #39 from pinecone-io/fix_cd
Browse files Browse the repository at this point in the history
Fix release CI
  • Loading branch information
igiloh-pinecone committed Jan 16, 2024
2 parents 1d1e7eb + f005fec commit 9cd2821
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
56 changes: 31 additions & 25 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,43 @@ on:
jobs:

release:
permissions:
contents: write

name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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@v4
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
title: Release ${{ env.VERSION }}
version: 1.3.2

- name: Set Version
run: echo "VERSION=$(poetry version -s)" >> $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: 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
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --build
- name: Create GH release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.VERSION }}
name: ${{ env.VERSION }}
artifacts: "dist/*"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pinecone-datasets"
version = "0.6.3"
version = "0.7.0"
description = "Pinecone Datasets lets you easily load datasets into your Pinecone index."
authors = ["Pinecone Relevance Team <relevance@pinecone.io>"]
maintainers = [
Expand Down

0 comments on commit 9cd2821

Please sign in to comment.