File tree Expand file tree Collapse file tree 2 files changed +58
-4
lines changed
Expand file tree Collapse file tree 2 files changed +58
-4
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,34 @@ jobs:
4343 with :
4444 versioning : ' semver'
4545
46+ dynamic-version-check :
47+ name : ' Dynamic Version Check'
48+ runs-on : ubuntu-24.04
49+ needs : repository
50+ if : needs.repository.outputs.python_project == 'true'
51+ outputs :
52+ dynamic_version : ${{ steps.dynamic-version.outputs.dynamic_version }}
53+ permissions :
54+ contents : read
55+ steps :
56+ # Harden the runner used by this workflow
57+ - uses : step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
58+ with :
59+ egress-policy : audit
60+
61+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
62+
63+ - name : ' Check for dynamic versioning'
64+ id : dynamic-version
65+ # yamllint disable-line rule:line-length
66+ uses : lfreleng-actions/python-dynamic-version-action@757278a7dce3add2c777305e7ec61d9e2b97ed7e # v0.1.6
67+
4668 python-build :
4769 name : ' Python Build'
4870 needs :
4971 - repository
5072 - tag-validate
73+ - dynamic-version-check
5174 if : needs.repository.outputs.python_project == 'true'
5275 runs-on : ' ubuntu-24.04'
5376 outputs :
7396 # yamllint disable-line rule:line-length
7497 uses : lfreleng-actions/python-build-action@56dd541a74b5cf9f0c5939ed98387478824720a2 # v0.1.8
7598 with :
76- tag : " ${{ needs.tag-validate.outputs.tag }}"
99+ # Only pass tag if NOT using dynamic versioning
100+ # yamllint disable-line rule:line-length
101+ tag : ${{ needs.dynamic-version-check.outputs.dynamic_version == 'true' && '' || needs.tag-validate.outputs.tag }}
102+ # Skip version patching when using dynamic versioning
103+ skip_version_patch : ${{ needs.dynamic-version-check.outputs.dynamic_version == 'true' }}
77104 sigstore_sign : true
78105 attestations : true
79106
Original file line number Diff line number Diff line change 3333 permissions :
3434 contents : read
3535
36+ dynamic-version-check :
37+ name : " Dynamic Version Check"
38+ runs-on : ubuntu-24.04
39+ needs : repository
40+ if : needs.repository.outputs.python_project == 'true'
41+ outputs :
42+ dynamic_version : ${{ steps.dynamic-version.outputs.dynamic_version }}
43+ permissions :
44+ contents : read
45+ steps :
46+ # Harden the runner used by this workflow
47+ - uses : step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
48+ with :
49+ egress-policy : audit
50+
51+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52+
53+ - name : " Check for dynamic versioning"
54+ id : dynamic-version
55+ # yamllint disable-line rule:line-length
56+ uses : lfreleng-actions/python-dynamic-version-action@757278a7dce3add2c777305e7ec61d9e2b97ed7e # v0.1.6
57+
3658 python-build :
3759 name : " Python Build"
38- needs : repository
60+ needs :
61+ - repository
62+ - dynamic-version-check
3963 if : needs.repository.outputs.python_project == 'true'
4064 runs-on : ubuntu-24.04
4165 outputs :
5882 id : python-build
5983 # yamllint disable-line rule:line-length
6084 uses : lfreleng-actions/python-build-action@56dd541a74b5cf9f0c5939ed98387478824720a2 # v0.1.8
61-
6285 with :
63- tag : ${{ needs.repository.outputs.build_tag }}
86+ # Only pass tag if NOT using dynamic versioning
87+ # yamllint disable-line rule:line-length
88+ tag : ${{ needs.dynamic-version-check.outputs.dynamic_version == 'true' && '' || needs.repository.outputs.build_tag }}
89+ # Skip version patching when using dynamic versioning
90+ skip_version_patch : ${{ needs.dynamic-version-check.outputs.dynamic_version == 'true' }}
6491
6592 python-tests :
6693 name : " Python Tests"
You can’t perform that action at this time.
0 commit comments