55# Note: We may want to rename this file at some point. However, if we rename the workflow file name,
66# we have to also update the Trusted Publisher settings on PyPI.
77
8- name : Packaging and Publishing
8+ name : CDK Publish
99
1010on :
1111 push :
12- tags :
13- - " v*"
12+ # tags:
13+ # - "v*"
1414 workflow_dispatch :
1515 inputs :
1616 version :
@@ -37,17 +37,30 @@ jobs:
3737 name : Build Python Package
3838 runs-on : ubuntu-24.04
3939 steps :
40- - name : Detect Release Tag Version
40+
41+ - name : Checkout CDK Repo
42+ uses : actions/checkout@v4
43+ with :
44+ fetch-depth : 0
45+
46+ - name : Detect Prerelease Version using Dunamai
47+ uses : mtkennerly/dunamai-action@v1
48+ with :
49+ args : --style pep440
50+ env-var : DETECTED_VERSION
51+
52+ - name : Detect Release Tag Version from git ref ('${{ github.ref_name }}')
4153 if : startsWith(github.ref, 'refs/tags/v')
4254 run : |
55+ echo "Overriding Dunamai detected version: '${{ env.DETECTED_VERSION || 'none' }}'"
56+ # Extract the version from the git ref
4357 DETECTED_VERSION=${{ github.ref_name }}
44- echo "Version ref set to '${DETECTED_VERSION}'"
4558 # Remove the 'v' prefix if it exists
4659 DETECTED_VERSION="${DETECTED_VERSION#v}"
47- echo "Setting version to '$DETECTED_VERSION'"
60+ echo "Setting detected version to '$DETECTED_VERSION'"
4861 echo "DETECTED_VERSION=${DETECTED_VERSION}" >> $GITHUB_ENV
4962
50- - name : Validate and set VERSION from git ref ( '${{ github.ref_name }}') and input ( ${{ github.event.inputs.version || 'none' }})
63+ - name : Validate and set VERSION ( git- ref= '${{ github.ref_name }}', detected='${{ env.DETECTED_VERSION }}', input=' ${{ github.event.inputs.version || 'none' }}' )
5164 id : set_version
5265 run : |
5366 INPUT_VERSION=${{ github.event.inputs.version }}
8497 echo "IS_PRERELEASE=true" >> $GITHUB_OUTPUT
8598 fi
8699
87- - uses : actions/checkout@v4
88- with :
89- fetch-depth : 0
90-
91100 - uses : hynek/build-and-inspect-python-package@v2
92101 env :
93102 # Pass in the evaluated version from the previous step
0 commit comments