Skip to content

Automate pypi deployment #1

Automate pypi deployment

Automate pypi deployment #1

---
name: Publish Python 🐍 distributions 📦 to PyPI
on:
push:
tags:
- "*"
jobs:
build-and-publish-test-pypi
name: Build and publish Python 🐍 distributions 📦 to PyPI

Check failure on line 9 in .github/workflows/build_and_release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build_and_release.yml

Invalid workflow file

You have an error in your yaml syntax on line 9
runs-on: ubuntu-latest
environment:
name: pypi
url: https://test.pypi.org/p/dspy-ai-test
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install dependencies
run: python3 -m pip install setuptools wheel twine
- name: Extract tag name
id: tag
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Update version in setup.py
run: sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g"
setup.py
- name: Build a binary wheel
run: python3 setup.py sdist bdist_wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1 # This requires a trusted publisher to be setup in pypi/testpypi
with:
repository-url: https://test.pypi.org/legacy/
# test-intro-notebook: TODO
# needs: build-and-publish-test-pypi
# build-and-publish-pypi:
# needs: [build-and-publish-test-pypi, test-intro-notebook]
# name: Build and publish Python 🐍 distributions 📦 to PyPI
# runs-on: ubuntu-latest
# environment:
# name: pypi
# url: https://pypi.org/p/dspy-ai
# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing
# steps:
# - uses: actions/checkout@master
# - name: Set up Python 3.9
# uses: actions/setup-python@v3
# with:
# python-version: "3.9"
# - name: Install dependencies
# run: python3 -m pip install setuptools wheel twine
# - name: Extract tag name
# id: tag
# run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
# - name: Update version in setup.py
# run: sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g"
# setup.py
# - name: Build a binary wheel
# run: python3 setup.py sdist bdist_wheel
# - name: Publish distribution 📦 to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1 # This requires a trusted publisher to be setup in pypi/testpypi
# create-release-github: # TODO
# needs: needs: [build-and-publish-test-pypi, test-intro-notebook, build-and-publish-pypi]
# Make sure to include release notes