@@ -4,7 +4,7 @@ name: release
44on :
55 push :
66 branches :
7- - <your_base_branch>
7+ - <your_base_branch> # Replace with your main branch (e.g., master, main)
88 paths :
99 - .github/tag_and_release/release-**
1010 workflow_dispatch :
@@ -56,6 +56,32 @@ concurrency:
5656 group : release-${{ github.ref_name }}
5757 cancel-in-progress : false
5858
59+ env :
60+ # Project Configuration
61+ PROJECT_NAME : ${{ vars.PROJECT_NAME || github.event.repository.name }}
62+ BASE_BRANCH : ${{ vars.BASE_BRANCH || 'master' }}
63+ PACKAGE_NAME : ${{ vars.PACKAGE_NAME || github.event.repository.name }}
64+
65+ # Git Configuration
66+ GIT_COMMIT_EMAIL :
${{ vars.GIT_COMMIT_EMAIL || '[email protected] ' }} 67+ GIT_COMMIT_NAME : ${{ vars.GIT_COMMIT_NAME || 'GitHub Action' }}
68+
69+ # Docker Configuration
70+ DOCKER_HEALTH_CHECK_PORT : ${{ vars.DOCKER_HEALTH_CHECK_PORT || '8000' }}
71+ DOCKER_HEALTH_CHECK_PATH : ${{ vars.DOCKER_HEALTH_CHECK_PATH || '/health' }}
72+ DOCKER_REGISTRY_DOCKERHUB : ${{ vars.DOCKER_REGISTRY_DOCKERHUB || 'docker.io' }}
73+ DOCKER_REGISTRY_GHCR : ${{ vars.DOCKER_REGISTRY_GHCR || 'ghcr.io' }}
74+
75+ # Application Configuration
76+ APP_ENV_VAR_NAME : ${{ vars.APP_ENV_VAR_NAME || 'API_TOKEN' }}
77+ APP_ENV_VAR_VALUE : ${{ vars.APP_ENV_VAR_VALUE || 'test_token' }}
78+
79+ # Documentation Configuration
80+ DOCS_PREVIEW_BRANCH : ${{ vars.DOCS_PREVIEW_BRANCH || 'docs-preview' }}
81+ DOCS_CI_CD_PATH : ${{ vars.DOCS_CI_CD_PATH || 'docs/contents/development/ci-cd.mdx' }}
82+ DOCS_INSTALLATION_PATH : ${{ vars.DOCS_INSTALLATION_PATH || 'docs/contents/document/installation.md' }}
83+ DOCS_README_PATH : ${{ vars.DOCS_README_PATH || 'docs/contents/document/README.md' }}
84+
5985jobs :
6086 intent :
6187 uses : Chisanan232/Template-Python-UV-Project/.github/workflows/rw_parse_release_intent.yaml@master
@@ -213,8 +239,8 @@ jobs:
213239
214240 - name : Configure git
215241 run : |
216- git config --global user.email "[email protected] " 217- git config --global user.name "GitHub Action "
242+ git config --global user.email "${{ env.GIT_COMMIT_EMAIL }} "
243+ git config --global user.name "${{ env.GIT_COMMIT_NAME }} "
218244
219245 - name : Bump version with uv
220246 id : bump
@@ -251,31 +277,31 @@ jobs:
251277 DOCS_UPDATED=false
252278
253279 # Update main CI/CD documentation if it exists
254- if [ -f "docs/contents/development/ci-cd.mdx " ]; then
280+ if [ -f "${{ env.DOCS_CI_CD_PATH }} " ]; then
255281 # Update any version references in installation examples, if they exist
256- if grep -q "clickup-mcp-server " "docs/contents/development/ci-cd.mdx "; then
282+ if grep -q "${{ env.PROJECT_NAME }} " "${{ env.DOCS_CI_CD_PATH }} "; then
257283 # This is just a placeholder - adjust pattern as needed for actual version references
258284 echo "Found version references in ci-cd.mdx to update"
259285 DOCS_UPDATED=true
260286 fi
261287 fi
262288
263289 # Update package installation docs if they exist
264- if [ -f "docs/contents/document/installation.md " ]; then
265- if grep -q "pip install.*clickup-mcp-server " "docs/contents/document/installation.md "; then
266- sed -i.bak "s/clickup-mcp-server ==[0-9]\+\.[0-9]\+\.[0-9]\+/clickup-mcp-server ==$NEW_VERSION/g" "docs/contents/document/installation.md "
267- rm -f "docs/contents/document/installation.md .bak" 2>/dev/null || true
290+ if [ -f "${{ env.DOCS_INSTALLATION_PATH }} " ]; then
291+ if grep -q "pip install.*${{ env.PROJECT_NAME }} " "${{ env.DOCS_INSTALLATION_PATH }} "; then
292+ sed -i.bak "s/${{ env.PROJECT_NAME }} ==[0-9]\+\.[0-9]\+\.[0-9]\+/${{ env.PROJECT_NAME }} ==$NEW_VERSION/g" "${{ env.DOCS_INSTALLATION_PATH }} "
293+ rm -f "${{ env.DOCS_INSTALLATION_PATH }} .bak" 2>/dev/null || true
268294 echo "Updated installation documentation with new version"
269295 DOCS_UPDATED=true
270296 fi
271297 fi
272298
273299 # Update README if it has version references
274- if [ -f "docs/contents/document/README.md " ]; then
275- if grep -q "clickup-mcp-server " "docs/contents/document/README.md "; then
300+ if [ -f "${{ env.DOCS_README_PATH }} " ]; then
301+ if grep -q "${{ env.PROJECT_NAME }} " "${{ env.DOCS_README_PATH }} "; then
276302 # Update version references in README examples
277- sed -i.bak "s/clickup-mcp-server ==[0-9]\+\.[0-9]\+\.[0-9]\+/clickup-mcp-server ==$NEW_VERSION/g" "docs/contents/document/README.md "
278- rm -f "docs/contents/document/README.md .bak" 2>/dev/null || true
303+ sed -i.bak "s/${{ env.PROJECT_NAME }} ==[0-9]\+\.[0-9]\+\.[0-9]\+/${{ env.PROJECT_NAME }} ==$NEW_VERSION/g" "${{ env.DOCS_README_PATH }} "
304+ rm -f "${{ env.DOCS_README_PATH }} .bak" 2>/dev/null || true
279305 echo "Updated README documentation with new version"
280306 DOCS_UPDATED=true
281307 fi
@@ -288,13 +314,13 @@ jobs:
288314 # Add documentation files if they were updated
289315 if [ "$DOCS_UPDATED" = true ]; then
290316 # Add any updated documentation files
291- if [ -f "docs/contents/document/installation.md " ]; then
292- git add "docs/contents/document/installation.md "
293- FILES_TO_COMMIT="$FILES_TO_COMMIT docs/contents/document/installation.md "
317+ if [ -f "${{ env.DOCS_INSTALLATION_PATH }} " ]; then
318+ git add "${{ env.DOCS_INSTALLATION_PATH }} "
319+ FILES_TO_COMMIT="$FILES_TO_COMMIT ${{ env.DOCS_INSTALLATION_PATH }} "
294320 fi
295- if [ -f "docs/contents/document/README.md " ]; then
296- git add "docs/contents/document/README.md "
297- FILES_TO_COMMIT="$FILES_TO_COMMIT docs/contents/document/README.md "
321+ if [ -f "${{ env.DOCS_README_PATH }} " ]; then
322+ git add "${{ env.DOCS_README_PATH }} "
323+ FILES_TO_COMMIT="$FILES_TO_COMMIT ${{ env.DOCS_README_PATH }} "
298324 fi
299325 COMMIT_MESSAGE="⬆️ chore: bump version to $NEW_VERSION, sync uv.lock, and update docs"
300326 echo "Documentation files updated and will trigger documentation workflow"
@@ -362,11 +388,13 @@ jobs:
362388 registry-token : ${{ secrets.DOCKERHUB_TOKEN }}
363389 with :
364390 operation : ' push'
365- registry : ' docker.io '
391+ registry : ${{ env.DOCKER_REGISTRY_DOCKERHUB }}
366392 version : ${{ needs.bump_version.outputs.version }}
367393 checkout-sha : ${{ needs.bump_version.outputs.new_sha }}
368394 enable-sbom : true
369395 enable-signing : true
396+ app-env-var-name : ${{ env.APP_ENV_VAR_NAME }}
397+ app-env-var-value : ${{ env.APP_ENV_VAR_VALUE }}
370398
371399 release_docker_ghcr :
372400 name : Release to GHCR
@@ -375,11 +403,13 @@ jobs:
375403 if : needs.intent.outputs.do_release == 'true' && needs.intent.outputs.docker != 'skip'
376404 with :
377405 operation : ' push'
378- registry : ' ghcr.io '
406+ registry : ${{ env.DOCKER_REGISTRY_GHCR }}
379407 version : ${{ needs.bump_version.outputs.version }}
380408 checkout-sha : ${{ needs.bump_version.outputs.new_sha }}
381409 enable-sbom : true
382410 enable-signing : true
411+ app-env-var-name : ${{ env.APP_ENV_VAR_NAME }}
412+ app-env-var-value : ${{ env.APP_ENV_VAR_VALUE }}
383413
384414 release_docs :
385415 uses : Chisanan232/Template-Python-UV-Project/.github/workflows/rw_docs_operations.yaml@master
0 commit comments