PyPI Release: Nightly (pinecone-client-nightly) #148
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: 'PyPI Release: Nightly (pinecone-client-nightly)' | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
run-tests: | |
uses: './.github/workflows/testing.yaml' | |
pypi-nightly: | |
needs: run-tests | |
timeout-minutes: 30 | |
name: pypi-nightly | |
runs-on: ubuntu-latest | |
steps: | |
- 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/[email protected] | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Setup Poetry | |
uses: ./.github/actions/setup-poetry | |
- name: Set dev version | |
id: version | |
run: | | |
currentDate=$(date +%Y%m%d%H%M%S) | |
versionNumber=$(poetry version -s) | |
devVersion="${versionNumber}.dev${currentDate}" | |
poetry version $devVersion | |
- name: Adjust module name | |
run: | | |
sed -i 's/pinecone-client/pinecone-client-nightly/g' pyproject.toml | |
- 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 | |
- 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 |