@@ -22,29 +22,16 @@ concurrency:
2222 group : release-staging-${{ github.ref_name }}
2323 cancel-in-progress : false
2424
25- env :
26- # Project Configuration
27- PROJECT_NAME : ${{ vars.PROJECT_NAME || github.event.repository.name }}
28- BASE_BRANCH : ${{ vars.BASE_BRANCH || 'master' }}
29- PACKAGE_NAME : ${{ vars.PACKAGE_NAME || github.event.repository.name }}
30-
31- # Docker Configuration
32- DOCKER_HEALTH_CHECK_PORT : ${{ vars.DOCKER_HEALTH_CHECK_PORT || '8000' }}
33- DOCKER_HEALTH_CHECK_PATH : ${{ vars.DOCKER_HEALTH_CHECK_PATH || '/health' }}
34- DOCKER_REGISTRY_DOCKERHUB : ${{ vars.DOCKER_REGISTRY_DOCKERHUB || 'docker.io' }}
35- DOCKER_REGISTRY_GHCR : ${{ vars.DOCKER_REGISTRY_GHCR || 'ghcr.io' }}
36-
37- # Application Configuration
38- APP_ENV_VAR_NAME : ${{ vars.APP_ENV_VAR_NAME || 'API_TOKEN' }}
39- APP_ENV_VAR_VALUE : ${{ vars.APP_ENV_VAR_VALUE || 'your_token' }}
40-
41- # Documentation Configuration
42- DOCS_PREVIEW_BRANCH : ${{ vars.DOCS_PREVIEW_BRANCH || 'docs-preview' }}
43-
4425jobs :
26+ # Parse project configuration from intent.yaml
27+ config :
28+ name : Parse Configuration
29+ uses : ./.github/workflows/rw_parse_project_config.yaml
30+
4531 compute-version :
4632 name : Compute Staging Version
4733 runs-on : ubuntu-latest
34+ needs : config
4835 outputs :
4936 version : ${{ steps.version.outputs.version }}
5037 rc_version : ${{ steps.version.outputs.rc_version }}
9380
9481 build_git-tag_and_create_github-release :
9582 uses : Chisanan232/Template-Python-UV-Project/.github/workflows/rw_build_git-tag_and_create_github-release_v2.yaml@master
96- needs : compute-version
83+ needs : [config, compute-version]
9784 with :
9885 version : ${{ needs.compute-version.outputs.rc_version }}
9986 checkout-sha : ${{ github.sha }}
10390
10491 pypi-test :
10592 uses : ./.github/workflows/rw_python_package.yaml
106- needs : [compute-version, build_git-tag_and_create_github-release]
93+ needs : [config, compute-version, build_git-tag_and_create_github-release]
10794 with :
10895 operation : ' publish-testpypi'
10996 version : ${{ needs.compute-version.outputs.version }}
@@ -113,52 +100,52 @@ jobs:
113100 dockerhub-rc :
114101 name : Staging Release to DockerHub
115102 uses : Chisanan232/Template-Python-UV-Project/.github/workflows/rw_docker_operations.yaml@master
116- needs : [compute-version, build_git-tag_and_create_github-release]
103+ needs : [config, compute-version, build_git-tag_and_create_github-release]
117104 secrets :
118105 dockerhub-user : ${{ secrets.DOCKERHUB_USERNAME }}
119106 registry-token : ${{ secrets.DOCKERHUB_TOKEN }}
120107 with :
121108 operation : ' push'
122- registry : ${{ env.DOCKER_REGISTRY_DOCKERHUB }}
109+ registry : ${{ needs.config.outputs.docker_registry_dockerhub }}
123110 version : ${{ needs.compute-version.outputs.rc_version }}
124111 checkout-sha : ${{ github.sha }}
125112 enable-sbom : true
126113 enable-signing : true
127- health-check-port : ${{ env.DOCKER_HEALTH_CHECK_PORT }}
128- health-check-path : ${{ env.DOCKER_HEALTH_CHECK_PATH }}
129- app-env-var-name : ${{ env.APP_ENV_VAR_NAME }}
130- app-env-var-value : ${{ env.APP_ENV_VAR_VALUE }}
114+ health-check-port : ${{ needs.config.outputs.docker_health_check_port }}
115+ health-check-path : ${{ needs.config.outputs.docker_health_check_path }}
116+ app-env-var-name : ${{ needs.config.outputs.docker_app_env_var_name }}
117+ app-env-var-value : ${{ needs.config.outputs.docker_app_env_var_value }}
131118
132119 ghcr-rc :
133120 name : Staging Release to GHCR
134121 uses : Chisanan232/Template-Python-UV-Project/.github/workflows/rw_docker_operations.yaml@master
135- needs : [compute-version, build_git-tag_and_create_github-release]
122+ needs : [config, compute-version, build_git-tag_and_create_github-release]
136123 with :
137124 operation : ' push'
138- registry : ${{ env.DOCKER_REGISTRY_GHCR }}
125+ registry : ${{ needs.config.outputs.docker_registry_ghcr }}
139126 version : ${{ needs.compute-version.outputs.rc_version }}
140127 checkout-sha : ${{ github.sha }}
141128 enable-sbom : true
142129 enable-signing : true
143- health-check-port : ${{ env.DOCKER_HEALTH_CHECK_PORT }}
144- health-check-path : ${{ env.DOCKER_HEALTH_CHECK_PATH }}
145- app-env-var-name : ${{ env.APP_ENV_VAR_NAME }}
146- app-env-var-value : ${{ env.APP_ENV_VAR_VALUE }}
130+ health-check-port : ${{ needs.config.outputs.docker_health_check_port }}
131+ health-check-path : ${{ needs.config.outputs.docker_health_check_path }}
132+ app-env-var-name : ${{ needs.config.outputs.docker_app_env_var_name }}
133+ app-env-var-value : ${{ needs.config.outputs.docker_app_env_var_value }}
147134
148135 docs-preview :
149136 uses : Chisanan232/Template-Python-UV-Project/.github/workflows/rw_docs_operations.yaml@master
150- needs : compute-version
137+ needs : [config, compute-version]
151138 with :
152139 operation : ' deploy-preview'
153140 version : ${{ needs.compute-version.outputs.rc_version }}
154141 checkout-sha : ${{ github.sha }}
155- preview-branch : ${{ env.DOCS_PREVIEW_BRANCH }}
142+ preview-branch : ${{ needs.config.outputs.docs_preview_branch }}
156143 upload-artifacts : true
157144
158145 staging-summary :
159146 name : Staging Release Summary
160147 runs-on : ubuntu-latest
161- needs : [compute-version, pypi-test, ghcr-rc, docs-preview]
148+ needs : [config, compute-version, pypi-test, ghcr-rc, docs-preview]
162149 if : always()
163150 steps :
164151 - name : Generate staging release summary
@@ -173,7 +160,7 @@ jobs:
173160 echo "📦 Staging Artifacts:"
174161 echo "- Base Version: ${{ needs.compute-version.outputs.version }}"
175162 echo "- RC Version: ${{ needs.compute-version.outputs.rc_version }}"
176- echo "- TestPyPI: https://test.pypi.org/project/${{ env.PROJECT_NAME }}/${{ needs.compute-version.outputs.version }}/"
163+ echo "- TestPyPI: https://test.pypi.org/project/${{ needs.config.outputs.project_name }}/${{ needs.compute-version.outputs.version }}/"
177164 echo "- GHCR RC Image: ghcr.io/${{ github.repository }}:${{ needs.compute-version.outputs.rc_version }}"
178165 echo "- Docs Preview: docs-preview branch"
179166 echo ""
@@ -186,10 +173,10 @@ jobs:
186173 echo ""
187174 echo "🧪 Testing Instructions:"
188175 echo "1. Install from TestPyPI:"
189- echo " pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ ${{ env.PROJECT_NAME }}==${{ needs.compute-version.outputs.version }}"
176+ echo " pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ ${{ needs.config.outputs.project_name }}==${{ needs.compute-version.outputs.version }}"
190177 echo ""
191178 echo "2. Test RC Docker image:"
192- echo " docker run -p ${{ env.DOCKER_HEALTH_CHECK_PORT }}:${{ env.DOCKER_HEALTH_CHECK_PORT }} -e ${{ env.APP_ENV_VAR_NAME }}=${{ env.APP_ENV_VAR_VALUE }} ghcr.io/${{ github.repository }}:${{ needs.compute-version.outputs.rc_version }}"
179+ echo " docker run -p ${{ needs.config.outputs.docker_health_check_port }}:${{ needs.config.outputs.docker_health_check_port }} -e ${{ needs.config.outputs.docker_app_env_var_name }}=${{ needs.config.outputs.docker_app_env_var_value }} ghcr.io/${{ github.repository }}:${{ needs.compute-version.outputs.rc_version }}"
193180 echo ""
194181 echo "3. Review documentation preview in docs-preview branch"
195182 echo ""
0 commit comments