99 description : " Clean semver to promote (no .post)"
1010 required : true
1111 type : string
12+ ref :
13+ description : " Git ref to use (defaults to main)"
14+ required : false
15+ type : string
16+ pre_version :
17+ description : " Pre-release version (optional, for bookkeeping)"
18+ required : false
19+ type : string
20+ dry_run :
21+ description : " If true, skip publishing to PyPI (only TestPyPI)"
22+ required : false
23+ default : false
24+ type : boolean
1225
1326permissions :
1427 contents : write
@@ -86,13 +99,14 @@ jobs:
8699 POETRY_HTTP_BASIC_TESTPYPI_USERNAME : __token__
87100 POETRY_HTTP_BASIC_TESTPYPI_PASSWORD : ${{ secrets.TEST_PYPI_TOKEN }}
88101 POETRY_PYPI_TOKEN_PYPI : ${{ secrets.PYPI_TOKEN }}
102+ DRY_RUN : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run || 'false' }}
89103 run : |
90104 set -euo pipefail
91105 if [ -z "${POETRY_HTTP_BASIC_TESTPYPI_PASSWORD:-}" ]; then
92106 echo "Missing TEST_PYPI_TOKEN secret" >&2
93107 exit 1
94108 fi
95- if [ -z "${POETRY_PYPI_TOKEN_PYPI:-}" ]; then
109+ if [ "${DRY_RUN:-false}" != "true" ] && [ -z "${POETRY_PYPI_TOKEN_PYPI:-}" ]; then
96110 echo "Missing PYPI_TOKEN secret" >&2
97111 exit 1
98112 fi
@@ -106,12 +120,16 @@ jobs:
106120 publish_lib "$lib" "-r testpypi" "$CLEAN_VERSION"
107121 done
108122
109- echo "Publishing clean version $CLEAN_VERSION (core-first) to PyPI..."
110- publish_lib "rag-core-lib" "" "$CLEAN_VERSION"
111- wait_for_index "rag-core-lib" "$CLEAN_VERSION" "https://pypi.org" "PyPI"
112- for lib in rag-core-api admin-api-lib extractor-api-lib; do
113- publish_lib "$lib" "" "$CLEAN_VERSION"
114- done
123+ if [ "${DRY_RUN:-false}" = "true" ]; then
124+ echo "Dry run enabled: skipping PyPI publish."
125+ else
126+ echo "Publishing clean version $CLEAN_VERSION (core-first) to PyPI..."
127+ publish_lib "rag-core-lib" "" "$CLEAN_VERSION"
128+ wait_for_index "rag-core-lib" "$CLEAN_VERSION" "https://pypi.org" "PyPI"
129+ for lib in rag-core-api admin-api-lib extractor-api-lib; do
130+ publish_lib "$lib" "" "$CLEAN_VERSION"
131+ done
132+ fi
115133
116134 - name : Clear poetry caches
117135 run : |
0 commit comments