55 tags :
66 - " *"
77jobs :
8- extract-tag :
9- runs-on : ubuntu-latest
10- outputs :
11- version : ${{ steps.extract_tag.outputs.tag }}
12- steps :
8+ extract-tag :
9+ runs-on : ubuntu-latest
10+ outputs :
11+ version : ${{ steps.extract_tag.outputs.tag }}
12+ steps :
1313 - uses : actions/checkout@v4
14- - id : extract_tag
15- name : Extract tag name
16- run : echo "::set-output name=tag::$(echo $GITHUB_REF | cut -d / -f 3)"
14+ - id : extract_tag
15+ name : Extract tag name
16+ run : echo "::set-output name=tag::$(echo $GITHUB_REF | cut -d / -f 3)"
1717
1818 build-and-publish-test-pypi :
1919 needs : extract-tag
2020 runs-on : ubuntu-latest
21- environment :
21+ environment :
2222 name : pypi
2323 permissions :
24- id-token : write # IMPORTANT: mandatory for trusted publishing
24+ id-token : write # IMPORTANT: mandatory for trusted publishing
2525 contents : write
2626 steps :
2727 - uses : actions/checkout@v4
@@ -31,19 +31,19 @@ jobs:
3131 python-version : " 3.9"
3232 - name : Install dependencies
3333 run : python3 -m pip install --upgrade setuptools wheel twine build semver packaging
34- - name : Get correct version for TestPyPI release
35- id : check_version
36- run : |
34+ - name : Get correct version for TestPyPI release
35+ id : check_version
36+ run : |
3737 VERSION=${{ needs.extract-tag.outputs.version }}
3838 PACKAGE_NAME="dspy-ai-test"
3939 echo "Checking if $VERSION for $PACKAGE_NAME exists on TestPyPI"
4040 NEW_VERSION=$(python3 .github/workflows/build_utils/test_version.py $PACKAGE_NAME $VERSION)
4141 echo "Version to be used for TestPyPI release: $NEW_VERSION"
42- echo "::set-output name=version::$NEW_VERSION"
42+ echo "::set-output name=version::$NEW_VERSION"
4343 - name : Update version in pyproject.toml
44- run : sed -i '/#replace_package_version_marker/{n;s/version="[^"]*"/version="${{ steps.check_version.outputs.version }}"/;}' pyproject.toml
44+ run : sed -i '/#replace_package_version_marker/{n;s/version="[^"]*"/version="${{ steps.check_version.outputs.version }}"/;}' pyproject.toml
4545 - name : Update package name in pyproject.toml
46- run : sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy-ai-test"/;}' pyproject.toml
46+ run : sed -i '/#replace_package_name_marker/{n;s/name="[^"]*"/name="dspy-ai-test"/;}' pyproject.toml
4747 - name : Build a binary wheel
4848 run : python3 -m build
4949 # Test the locally built wheel
5959 # Publish to test-PyPI
6060 - name : Publish distribution 📦 to test-PyPI
6161 uses : pypa/gh-action-pypi-publish@release/v1 # This requires a trusted publisher to be setup in pypi/testpypi
62- with :
62+ with :
6363 repository-url : https://test.pypi.org/legacy/
6464
6565 # TODO: Add tests using dspy-ai-test
@@ -69,10 +69,10 @@ jobs:
6969 # Only publish to PyPI if the repository owner is stanfordnlp
7070 if : github.repository_owner == 'stanfordnlp'
7171 runs-on : ubuntu-latest
72- environment :
72+ environment :
7373 name : pypi
7474 permissions :
75- id-token : write # IMPORTANT: mandatory for trusted publishing
75+ id-token : write # IMPORTANT: mandatory for trusted publishing
7676 contents : write
7777 steps :
7878 - uses : actions/checkout@v4
@@ -106,39 +106,39 @@ jobs:
106106 rm -r test_before_pypi
107107 - name : Publish distribution 📦 to PyPI (dspy)
108108 uses : pypa/gh-action-pypi-publish@release/v1
109- with :
109+ with :
110110 attestations : false
111111 # Publish to dspy-ai
112112 - name : Update package name in pyproject.toml
113113 run : sed -i '/#replace_package_name_marker/{n;s/name *= *"[^"]*"/name="dspy-ai"/;}' ./dspy/.internal_dspyai/pyproject.toml
114114 - name : Update version for dspy-ai release
115115 run : sed -i '/#replace_package_version_marker/{n;s/version *= *"[^"]*"/version="${{ needs.extract-tag.outputs.version }}"/;}' ./dspy/.internal_dspyai/pyproject.toml
116- - name : Update dspy dependency for dspy-ai release
116+ - name : Update dspy dependency for dspy-ai release
117117 run : |
118118 sed -i '/#replace_dspy_version_marker/{n;s/dspy *>= *"[^"]*/dspy>=${{ needs.extract-tag.outputs.version }}/;}' ./dspy/.internal_dspyai/pyproject.toml
119119 - name : Build a binary wheel (dspy-ai)
120120 run : python3 -m build ./dspy/.internal_dspyai/
121121 - name : Publish distribution 📦 to PyPI (dspy-ai)
122122 uses : pypa/gh-action-pypi-publish@release/v1
123- with :
123+ with :
124124 attestations : false
125125 packages-dir : ./dspy/.internal_dspyai/dist/
126126 - uses : stefanzweifel/git-auto-commit-action@v5 # auto commit changes to main
127127 with :
128128 commit_message : Update versions
129129 create_branch : true
130130 branch : release-${{ needs.extract-tag.outputs.version }}
131- - name : Checkout main branch
132- run : |
133- git fetch origin
134- git checkout main
131+ - name : Checkout main branch
132+ run : |
133+ git fetch origin
134+ git checkout main
135135 - name : Configure git user
136- run : |
136+ run : |
137137 git config --global user.email "[email protected] " 138138 git config --global user.name "Github Actions"
139- - name : Merge release branch into main
140- run : |
141- git merge --no-ff release-${{ needs.extract-tag.outputs.version }}
139+ - name : Merge release branch into main
140+ run : |
141+ git merge --no-ff release-${{ needs.extract-tag.outputs.version }}
142142 - name : Push changes to main
143- run : |
144- git push origin main
143+ run : |
144+ git push origin main
0 commit comments