Skip to content

Commit 5c2f92c

Browse files
committed
➕ Apply the new design of common values in release intent config into the release system.
1 parent cecc706 commit 5c2f92c

File tree

3 files changed

+107
-149
lines changed

3 files changed

+107
-149
lines changed

.github/workflows/release-staging.yml

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
4425
jobs:
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 }}
@@ -93,7 +80,7 @@ jobs:
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 }}
@@ -103,7 +90,7 @@ jobs:
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 ""

.github/workflows/release-validate.yml

Lines changed: 34 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -35,107 +35,93 @@ concurrency:
3535
group: release-validate-${{ github.ref }}
3636
cancel-in-progress: true
3737

38-
env:
39-
# Project Configuration
40-
PROJECT_NAME: ${{ vars.PROJECT_NAME || github.event.repository.name }}
41-
BASE_BRANCH: ${{ vars.BASE_BRANCH || 'master' }}
42-
PACKAGE_NAME: ${{ vars.PACKAGE_NAME || github.event.repository.name }}
43-
44-
# Docker Configuration
45-
DOCKER_HEALTH_CHECK_PORT: ${{ vars.DOCKER_HEALTH_CHECK_PORT || '8000' }}
46-
DOCKER_HEALTH_CHECK_PATH: ${{ vars.DOCKER_HEALTH_CHECK_PATH || '/health' }}
47-
DOCKER_REGISTRY_DOCKERHUB: ${{ vars.DOCKER_REGISTRY_DOCKERHUB || 'docker.io' }}
48-
DOCKER_REGISTRY_GHCR: ${{ vars.DOCKER_REGISTRY_GHCR || 'ghcr.io' }}
49-
50-
# Application Configuration
51-
APP_ENV_VAR_NAME: ${{ vars.APP_ENV_VAR_NAME || 'API_TOKEN' }}
52-
APP_ENV_VAR_VALUE: ${{ vars.APP_ENV_VAR_VALUE || 'test_token' }}
53-
54-
# Validation Configuration
55-
VALIDATION_VERSION: ${{ vars.VALIDATION_VERSION || '1.0.0-validation' }}
56-
VALIDATION_TEST_VERSION: ${{ vars.VALIDATION_TEST_VERSION || 'validation-test' }}
57-
5838
jobs:
39+
# Parse project configuration from intent.yaml
40+
config:
41+
name: Parse Configuration
42+
uses: ./.github/workflows/rw_parse_project_config.yaml
43+
5944
intent-parse:
6045
uses: Chisanan232/Template-Python-UV-Project/.github/workflows/rw_parse_release_intent.yaml@master
46+
needs: config
6147
with:
62-
level: ${{ inputs.level || 'auto' }}
63-
python: 'auto'
64-
docker: 'auto'
65-
docs: 'auto'
48+
level: ${{ inputs.level || needs.config.outputs.level }}
49+
python: ${{ needs.config.outputs.python }}
50+
docker: ${{ needs.config.outputs.docker }}
51+
docs: ${{ needs.config.outputs.docs }}
6652
notes: 'Validation test run'
6753

6854
build_git-tag_and_create_github-release:
6955
uses: Chisanan232/Template-Python-UV-Project/.github/workflows/rw_build_git-tag_and_create_github-release_v2.yaml@master
70-
needs: intent-parse
56+
needs: [config, intent-parse]
7157
with:
72-
version: ${{ env.VALIDATION_VERSION }} # Test version for validation
58+
version: ${{ needs.config.outputs.validation_version }} # Test version for validation
7359
debug_mode: true
7460
secrets:
7561
github_auth_token: ${{ secrets.GITHUB_TOKEN }}
7662

7763
python-build-check:
7864
uses: ./.github/workflows/rw_python_package.yaml
79-
needs: build_git-tag_and_create_github-release
65+
needs: [config, build_git-tag_and_create_github-release]
8066
with:
8167
operation: 'test'
8268
artifact-name: 'validation-python-package'
8369

8470
docker-build-dockerhub:
8571
name: Validate DockerHub Build
8672
uses: Chisanan232/Template-Python-UV-Project/.github/workflows/rw_docker_operations.yaml@master
87-
needs: build_git-tag_and_create_github-release
73+
needs: [config, build_git-tag_and_create_github-release]
8874
with:
8975
operation: 'test'
90-
registry: ${{ env.DOCKER_REGISTRY_DOCKERHUB }}
76+
registry: ${{ needs.config.outputs.docker_registry_dockerhub }}
9177
image-name: ${{ github.repository }}
92-
version: ${{ env.VALIDATION_TEST_VERSION }}
93-
health-check-port: ${{ env.DOCKER_HEALTH_CHECK_PORT }}
94-
health-check-path: ${{ env.DOCKER_HEALTH_CHECK_PATH }}
78+
version: ${{ needs.config.outputs.validation_test_version }}
79+
health-check-port: ${{ needs.config.outputs.docker_health_check_port }}
80+
health-check-path: ${{ needs.config.outputs.docker_health_check_path }}
9581
enable-signing: true
96-
app-env-var-name: ${{ env.APP_ENV_VAR_NAME }}
97-
app-env-var-value: ${{ env.APP_ENV_VAR_VALUE }}
82+
app-env-var-name: ${{ needs.config.outputs.docker_app_env_var_name }}
83+
app-env-var-value: ${{ needs.config.outputs.docker_app_env_var_value }}
9884

9985
docker-build-ghcr:
10086
name: Validate GHCR Build
10187
uses: Chisanan232/Template-Python-UV-Project/.github/workflows/rw_docker_operations.yaml@master
102-
needs: build_git-tag_and_create_github-release
88+
needs: [config, build_git-tag_and_create_github-release]
10389
with:
10490
operation: 'test'
105-
registry: ${{ env.DOCKER_REGISTRY_GHCR }}
91+
registry: ${{ needs.config.outputs.docker_registry_ghcr }}
10692
image-name: ${{ github.repository }}
107-
version: ${{ env.VALIDATION_TEST_VERSION }}
108-
health-check-port: ${{ env.DOCKER_HEALTH_CHECK_PORT }}
109-
health-check-path: ${{ env.DOCKER_HEALTH_CHECK_PATH }}
93+
version: ${{ needs.config.outputs.validation_test_version }}
94+
health-check-port: ${{ needs.config.outputs.docker_health_check_port }}
95+
health-check-path: ${{ needs.config.outputs.docker_health_check_path }}
11096
enable-signing: true
111-
app-env-var-name: ${{ env.APP_ENV_VAR_NAME }}
112-
app-env-var-value: ${{ env.APP_ENV_VAR_VALUE }}
97+
app-env-var-name: ${{ needs.config.outputs.docker_app_env_var_name }}
98+
app-env-var-value: ${{ needs.config.outputs.docker_app_env_var_value }}
11399

114100
docs-build:
115101
uses: Chisanan232/Template-Python-UV-Project/.github/workflows/rw_docs_operations.yaml@master
116-
needs: intent-parse
102+
needs: [config, intent-parse]
117103
with:
118104
operation: 'test'
119105
upload-artifacts: true
120106

121107
supply-chain-loopback:
122108
name: Security Scan (Supply Chain)
123109
uses: Chisanan232/Template-Python-UV-Project/.github/workflows/rw_docker_operations.yaml@master
124-
needs: [docker-build-dockerhub, docker-build-ghcr]
110+
needs: [config, docker-build-dockerhub, docker-build-ghcr]
125111
with:
126112
operation: 'security-scan'
127-
registry: ${{ env.DOCKER_REGISTRY_DOCKERHUB }} # Use DockerHub build for security scan
113+
registry: ${{ needs.config.outputs.docker_registry_dockerhub }} # Use DockerHub build for security scan
128114
image-name: ${{ github.repository }}
129-
version: ${{ env.VALIDATION_TEST_VERSION }}
115+
version: ${{ needs.config.outputs.validation_test_version }}
130116
enable-sbom: true
131117
enable-signing: true
132-
app-env-var-name: ${{ env.APP_ENV_VAR_NAME }}
133-
app-env-var-value: ${{ env.APP_ENV_VAR_VALUE }}
118+
app-env-var-name: ${{ needs.config.outputs.docker_app_env_var_name }}
119+
app-env-var-value: ${{ needs.config.outputs.docker_app_env_var_value }}
134120

135121
validation-summary:
136122
name: Validation Summary
137123
runs-on: ubuntu-latest
138-
needs: [intent-parse, python-build-check, docker-build-dockerhub, docker-build-ghcr, docs-build, supply-chain-loopback]
124+
needs: [config, intent-parse, python-build-check, docker-build-dockerhub, docker-build-ghcr, docs-build, supply-chain-loopback]
139125
if: always()
140126
steps:
141127
- name: Check validation results

0 commit comments

Comments
 (0)