diff --git a/.github/workflows/alpha-release.yaml b/.github/workflows/alpha-release.yaml index 399a0c43..3dbdf705 100644 --- a/.github/workflows/alpha-release.yaml +++ b/.github/workflows/alpha-release.yaml @@ -1,4 +1,4 @@ -name: PyPI Prerelease +name: 'PyPI Release: Pre-Release (pinecone-client)' on: workflow_dispatch: diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index 6a9d0fe2..7799b053 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -2,6 +2,8 @@ name: 'PyPI Release: Nightly (pinecone-client-nightly)' on: workflow_dispatch: + schedule: + - cron: '0 0 * * *' jobs: run-tests: @@ -13,5 +15,47 @@ jobs: name: pypi-nightly runs-on: ubuntu-latest steps: - - name: greeting - run: echo "Hello World" \ No newline at end of file + - name: Checkout + uses: actions/checkout@v3 + + - name: Get recent changes + id: list-commits + run: | + recentCommits=$(git log --since=yesterday --oneline) + echo "commits=$recentCommits" >> "$GITHUB_OUTPUT" + + - name: Abort if no recent changes + if: steps.list-commits.outputs.commits == '' + uses: andymckay/cancel-action@0.3 + + - name: Set dev version + id: version + run: | + versionFile="pinecone/__version__" + currentDate=$(date +%Y%m%d%H%M%S) + versionNumber=$(cat $versionFile) + devVersion="${versionNumber}.dev${currentDate}" + echo "$devVersion" > $versionFile + + - name: Adjust module name + run: | + sed -i 's/pinecone-client/pinecone-client-nightly/g' setup.py + + - name: Update README + run: | + echo "This is a nightly developer build of the Pinecone Python client. It is not intended for production use." > README.md + + - uses: actions/setup-python@v4 + with: + python-version: 3.x + + - name: Build Python client + run: make package + + - name: Upload Python client to PyPI + id: pypi_upload + env: + TWINE_REPOSITORY: pypi + PYPI_USERNAME: ${{ secrets.PROD_PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.PROD_PYPI_PASSWORD }} + run: make upload diff --git a/.github/workflows/publish-to-pypi.yaml b/.github/workflows/publish-to-pypi.yaml index 40a0b5e6..548c2615 100644 --- a/.github/workflows/publish-to-pypi.yaml +++ b/.github/workflows/publish-to-pypi.yaml @@ -1,4 +1,4 @@ -name: PyPI Prerelease +name: Publish to PyPI on: workflow_call: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f3355165..b79a5ab2 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,4 +1,4 @@ -name: PyPI Release +name: 'PyPI Release: Production (pinecone-client)' on: workflow_dispatch: