88 BRANCH_NAME : ${{ github.event.ref.BRANCH_NAME }}
99
1010jobs :
11+ get_asdf_version :
12+ runs-on : ubuntu-22.04
13+ outputs :
14+ asdf_version : ${{ steps.asdf-version.outputs.version }}
15+ tag_format : ${{ steps.load-config.outputs.TAG_FORMAT }}
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v5
19+
20+ - name : Get asdf version
21+ id : asdf-version
22+ run : echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"
23+
24+ - name : Load config value
25+ id : load-config
26+ run : |
27+ TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
28+ echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
29+
1130 quality_checks :
1231 uses :
NHSDigital/eps-workflow-quality-checks/.github/workflows/[email protected] 1332 secrets :
@@ -24,75 +43,15 @@ jobs:
2443 echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT"
2544
2645 tag_release :
27- needs : quality_checks
28- runs-on : ubuntu-22.04
29- outputs :
30- version_tag : ${{ steps.output_version_tag.outputs.VERSION_TAG }}
31- steps :
32- - name : Checkout code
33- 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-
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 : Setting up .npmrc
61- env :
62- NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63- run : |
64- echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
65- echo "@nhsdigital:registry=https://npm.pkg.github.com" >> ~/.npmrc
66-
67- - name : Install Dependencies
68- run : make install
69-
70- - name : Set VERSION_TAG env var to be short git SHA and get next tag varsion
71- id : output_version_tag
72- run : |
73- VERSION_TAG=$(git rev-parse --short HEAD)
74- npx semantic-release --dry-run > semantic-release-output.log
75- NEXT_VERSION=$(grep -i 'The next release version is' semantic-release-output.log | sed -E 's/.* ([[:digit:].]+)$/\1/')
76- if [ -z "${NEXT_VERSION}" ]
77- then
78- echo "Could not get next tag. Here is the log from semantic-release"
79- cat semantic-release-output.log
80- exit 1
81- fi
82- tagFormat=$(node -e "const config=require('./release.config.js'); console.log(config.tagFormat)")
83- if [ "${tagFormat}" = "null" ]
84- then
85- tagFormat="v\${version}"
86- fi
87- # disabling shellcheck as replace does not work
88- # shellcheck disable=SC2001
89- NEW_VERSION_TAG=$(echo "$tagFormat" | sed "s/\${version}/$NEXT_VERSION/")
90- echo "## VERSION TAG : ${VERSION_TAG}" >> "$GITHUB_STEP_SUMMARY"
91- echo "## NEXT TAG WILL BE : ${NEW_VERSION_TAG}" >> "$GITHUB_STEP_SUMMARY"
92- echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_OUTPUT"
93- echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_ENV"
94- env :
95- GITHUB_TOKEN : ${{ github.token }}
46+ needs : [quality_checks, get_commit_id, get_asdf_version]
47+ uses : NHSDigital/eps-workflow-semantic-release/.github/workflows/tag-release.yml@361957c147279f5f0f68b64fde9927833363d5f7
48+ with :
49+ dry_run : true
50+ asdfVersion : ${{ needs.get_asdf_version.outputs.asdf_version }}
51+ branch_name : main
52+ publish_package : false
53+ tag_format : ${{ needs.get_asdf_version.outputs.tag_format }}
54+ secrets : inherit
9655
9756 package_code :
9857 needs : [get_commit_id, tag_release]
10463
10564 release_dev :
10665 needs : [get_commit_id, tag_release, package_code]
107- uses : ./.github/workflows/cdk_release_code .yml
66+ uses : ./.github/workflows/release_all_stacks .yml
10867 with :
10968 STACK_NAME : epsam
11069 TARGET_ENVIRONMENT : dev
@@ -113,13 +72,47 @@ jobs:
11372 CDK_APP_NAME : EpsAssistMeApp
11473 DEPLOY_CODE : true
11574 LOG_RETENTION_IN_DAYS : 30
116- LOG_LEVEL : DEBUG
75+ LOG_LEVEL : " DEBUG"
76+ CREATE_INT_RELEASE_NOTES : false
77+ CREATE_PROD_RELEASE_NOTES : false
11778 MARK_JIRA_RELEASED : false
79+ CREATE_INT_RC_RELEASE_NOTES : false
80+ IS_PULL_REQUEST : false
11881 secrets :
11982 CLOUD_FORMATION_DEPLOY_ROLE : ${{ secrets.DEV_CLOUD_FORMATION_DEPLOY_ROLE }}
12083 CDK_PULL_IMAGE_ROLE : ${{ secrets.DEV_CDK_PULL_IMAGE_ROLE }}
84+ DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE : ${{ secrets.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
85+ INT_CLOUD_FORMATION_CHECK_VERSION_ROLE : ${{ secrets.INT_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
86+ PROD_CLOUD_FORMATION_CHECK_VERSION_ROLE : ${{ secrets.PROD_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
87+ DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE : ${{ secrets.DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE }}
12188 REGRESSION_TESTS_PEM : ${{ secrets.REGRESSION_TESTS_PEM }}
89+ SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
90+ SLACK_SIGNING_SECRET : ${{ secrets.SLACK_SIGNING_SECRET }}
91+
92+ release_qa :
93+ needs : [get_commit_id, tag_release, package_code, release_dev]
94+ uses : ./.github/workflows/release_all_stacks.yml
95+ with :
96+ STACK_NAME : epsam
97+ TARGET_ENVIRONMENT : qa
98+ VERSION_NUMBER : ${{ needs.tag_release.outputs.version_tag }}
99+ COMMIT_ID : ${{ needs.get_commit_id.outputs.commit_id }}
100+ CDK_APP_NAME : EpsAssistMeApp
101+ DEPLOY_CODE : true
102+ LOG_RETENTION_IN_DAYS : 30
103+ LOG_LEVEL : " DEBUG"
104+ CREATE_INT_RELEASE_NOTES : true
105+ CREATE_PROD_RELEASE_NOTES : true
106+ MARK_JIRA_RELEASED : false
107+ CREATE_INT_RC_RELEASE_NOTES : false
108+ IS_PULL_REQUEST : false
109+ secrets :
110+ CLOUD_FORMATION_DEPLOY_ROLE : ${{ secrets.QA_CLOUD_FORMATION_DEPLOY_ROLE }}
111+ CDK_PULL_IMAGE_ROLE : ${{ secrets.QA_CDK_PULL_IMAGE_ROLE }}
122112 DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE : ${{ secrets.DEV_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
113+ INT_CLOUD_FORMATION_CHECK_VERSION_ROLE : ${{ secrets.INT_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
114+ PROD_CLOUD_FORMATION_CHECK_VERSION_ROLE : ${{ secrets.PROD_CLOUD_FORMATION_CHECK_VERSION_ROLE }}
123115 DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE : ${{ secrets.DEV_CLOUD_FORMATION_EXECUTE_LAMBDA_ROLE }}
116+ REGRESSION_TESTS_PEM : ${{ secrets.REGRESSION_TESTS_PEM }}
124117 SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
125118 SLACK_SIGNING_SECRET : ${{ secrets.SLACK_SIGNING_SECRET }}
0 commit comments