@@ -23,69 +23,34 @@ jobs:
2323 run : |
2424 echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT"
2525
26- tag_release :
27- needs : quality_checks
26+ get_asdf_version :
2827 runs-on : ubuntu-22.04
2928 outputs :
30- version_tag : ${{ steps.output_version_tag.outputs.VERSION_TAG }}
29+ asdf_version : ${{ steps.asdf-version.outputs.version }}
30+ tag_format : ${{ steps.load-config.outputs.TAG_FORMAT }}
3131 steps :
3232 - name : Checkout code
3333 uses : actions/checkout@v5
34- with :
35- ref : ${{ env.BRANCH_NAME }}
36- fetch-depth : 0
37-
38- # using git commit sha for version of action to ensure we have stable version
39- - name : Install asdf
40- uses : asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
41- with :
42- asdf_branch : v0.14.1
43-
44- - name : Cache asdf
45- uses : actions/cache@v4
46- with :
47- path : |
48- ~/.asdf
49- key : ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
50- restore-keys : |
51- ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
52-
53- - name : Install asdf dependencies in .tool-versions
54- uses : asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
55- with :
56- asdf_branch : v0.14.1
57- env :
58- PYTHON_CONFIGURE_OPTS : --enable-shared
59-
60- - name : Install Dependencies
61- run : make install
6234
63- - name : Set VERSION_TAG env var to be short git SHA and get next tag varsion
64- id : output_version_tag
35+ - name : Get asdf version
36+ id : asdf-version
37+ run : echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"
38+ - name : Load config value
39+ id : load-config
6540 run : |
66- VERSION_TAG=$(git rev-parse --short HEAD)
67- npx semantic-release --dry-run > semantic-release-output.log
68- NEXT_VERSION=$(grep -i 'The next release version is' semantic-release-output.log | sed -E 's/.* ([[:digit:].]+)$/\1/')
69- if [ -z "${NEXT_VERSION}" ]
70- then
71- echo "Could not get next tag. Here is the log from semantic-release"
72- cat semantic-release-output.log
73- exit 1
74- fi
75- tagFormat=$(node -e "const config=require('./release.config.js'); console.log(config.tagFormat)")
76- if [ "${tagFormat}" = "null" ]
77- then
78- tagFormat="v\${version}"
79- fi
80- # disabling shellcheck as replace does not work
81- # shellcheck disable=SC2001
82- NEW_VERSION_TAG=$(echo "$tagFormat" | sed "s/\${version}/$NEXT_VERSION/")
83- echo "## VERSION TAG : ${VERSION_TAG}" >> "$GITHUB_STEP_SUMMARY"
84- echo "## NEXT TAG WILL BE : ${NEW_VERSION_TAG}" >> "$GITHUB_STEP_SUMMARY"
85- echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_OUTPUT"
86- echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_ENV"
87- env :
88- GITHUB_TOKEN : ${{ github.token }}
41+ TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
42+ echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
43+
44+ tag_release :
45+ needs : [quality_checks, get_commit_id, get_asdf_version]
46+ uses : NHSDigital/eps-workflow-semantic-release/.github/workflows/tag-release.yml@2a3f4ab96e04b7547c4ee5b786745b98809c89be
47+ with :
48+ dry_run : true
49+ asdfVersion : ${{ needs.get_asdf_version.outputs.asdf_version }}
50+ branch_name : main
51+ publish_package : false
52+ tag_format : ${{ needs.get_asdf_version.outputs.tag_format }}
53+ secrets : inherit
8954
9055 package_code :
9156 needs : [tag_release, get_commit_id]
12388 INT_CLOUD_FORMATION_CHECK_VERSION_ROLE : ${{ secrets.INT_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
12489 PROD_CLOUD_FORMATION_CHECK_VERSION_ROLE : ${{ secrets.PROD_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
12590
126-
12791 release_qa :
12892 needs : [tag_release, release_dev, package_code, get_commit_id]
12993 uses : ./.github/workflows/cdk_release_code.yml
0 commit comments