|
80 | 80 | TAG: ${{ steps.version.outputs.TAG }} |
81 | 81 | run: | |
82 | 82 | if git rev-parse "$TAG" >/dev/null 2>&1; then |
83 | | - echo "::error::Tag $TAG already exists. Use re-release workflow to overwrite." |
| 83 | + echo "::error::Tag $TAG already exists. Delete the existing tag and release branch before re-running, or bump the version in pyproject.toml." |
84 | 84 | exit 1 |
85 | 85 | fi |
86 | 86 |
|
|
92 | 92 | run: | |
93 | 93 | RELEASE_BRANCH="release-$PACKAGE-$VERSION" |
94 | 94 | if git ls-remote --exit-code --heads origin "$RELEASE_BRANCH" >/dev/null 2>&1; then |
95 | | - echo "::error::Release branch $RELEASE_BRANCH already exists. Use re-release workflow to overwrite." |
| 95 | + echo "::error::Release branch $RELEASE_BRANCH already exists. Delete the existing tag and release branch before re-running, or bump the version in pyproject.toml." |
96 | 96 | exit 1 |
97 | 97 | fi |
98 | 98 |
|
@@ -150,18 +150,26 @@ jobs: |
150 | 150 | uv build --package afm-langchain |
151 | 151 | fi |
152 | 152 |
|
153 | | - - name: Publish to PyPI |
| 153 | + - name: Publish afm-core to PyPI |
| 154 | + if: inputs.package == 'afm-core' |
154 | 155 | working-directory: python-interpreter |
155 | 156 | env: |
156 | | - PACKAGE: ${{ inputs.package }} |
157 | | - UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |
158 | | - run: | |
159 | | - if [ "$PACKAGE" = "afm-core" ]; then |
160 | | - uv publish dist/afm_core-* |
161 | | - uv publish dist/afm_cli-* |
162 | | - elif [ "$PACKAGE" = "afm-langchain" ]; then |
163 | | - uv publish dist/afm_langchain-* |
164 | | - fi |
| 157 | + UV_PUBLISH_TOKEN: ${{ secrets.AFM_CORE_PYPI_API_TOKEN }} |
| 158 | + run: uv publish dist/afm_core-* |
| 159 | + |
| 160 | + - name: Publish afm-cli to PyPI |
| 161 | + if: inputs.package == 'afm-core' |
| 162 | + working-directory: python-interpreter |
| 163 | + env: |
| 164 | + UV_PUBLISH_TOKEN: ${{ secrets.AFM_CLI_PYPI_API_TOKEN }} |
| 165 | + run: uv publish dist/afm_cli-* |
| 166 | + |
| 167 | + - name: Publish afm-langchain to PyPI |
| 168 | + if: inputs.package == 'afm-langchain' |
| 169 | + working-directory: python-interpreter |
| 170 | + env: |
| 171 | + UV_PUBLISH_TOKEN: ${{ secrets.AFM_LANGCHAIN_PYPI_API_TOKEN }} |
| 172 | + run: uv publish dist/afm_langchain-* |
165 | 173 |
|
166 | 174 | docker: |
167 | 175 | needs: [validate, test] |
@@ -189,6 +197,7 @@ jobs: |
189 | 197 | with: |
190 | 198 | tag: ${{ needs.validate.outputs.tag }} |
191 | 199 | implementation: python-interpreter |
| 200 | + package: ${{ inputs.package }} |
192 | 201 | version: ${{ needs.validate.outputs.release_version }} |
193 | 202 | branch: ${{ inputs.branch }} |
194 | 203 | is_rerelease: false |
@@ -230,6 +239,10 @@ jobs: |
230 | 239 | uv version --bump patch --package afm-cli --frozen |
231 | 240 | # Sync the afm-core exact pin in afm-cli's dependencies |
232 | 241 | NEW_CORE_VERSION=$(uv version --short --package afm-core) |
| 242 | + if [[ ! "$NEW_CORE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then |
| 243 | + echo "::error::Failed to get valid afm-core version, got: '$NEW_CORE_VERSION'" |
| 244 | + exit 1 |
| 245 | + fi |
233 | 246 | sed -i "s/\"afm-core==.*\"/\"afm-core==$NEW_CORE_VERSION\"/" packages/afm-cli/pyproject.toml |
234 | 247 | elif [ "$PACKAGE" = "afm-langchain" ]; then |
235 | 248 | uv version --bump patch --package afm-langchain --frozen |
|
0 commit comments