Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
3e0bdb5
start of construct library
anthony-nhs Oct 14, 2025
dc1cf8d
fix build things
anthony-nhs Oct 14, 2025
446fb22
add tests
anthony-nhs Oct 14, 2025
8d51008
remove unused file
anthony-nhs Oct 14, 2025
e76b556
no precompilation
anthony-nhs Oct 14, 2025
17848c0
add commands to package the construct
anthony-nhs Oct 14, 2025
7f8ccac
fix bundling
anthony-nhs Oct 14, 2025
2e192df
add some documentation
anthony-nhs Oct 14, 2025
94bcbd3
start of a proper readme
anthony-nhs Oct 14, 2025
1c2f9c2
more documentation
anthony-nhs Oct 14, 2025
0df41d9
publish to github package
anthony-nhs Oct 14, 2025
4b15681
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 14, 2025
5b2eb66
fix test
anthony-nhs Oct 14, 2025
b16e8ac
add coverage
anthony-nhs Oct 14, 2025
bff714f
create an artifact
anthony-nhs Oct 14, 2025
939efbb
update docs
anthony-nhs Oct 14, 2025
9732c73
fix pipeline
anthony-nhs Oct 14, 2025
d5866e6
fix var name
anthony-nhs Oct 15, 2025
0e0800b
weekly release
anthony-nhs Oct 15, 2025
b2619a0
remove unused package
anthony-nhs Oct 15, 2025
d977d63
package code everywhere
anthony-nhs Oct 15, 2025
95a42c8
use common workflows
anthony-nhs Oct 15, 2025
f80238f
fix ci workflow
anthony-nhs Oct 15, 2025
4f40760
update check scan result script
anthony-nhs Oct 15, 2025
a5ef249
build package
anthony-nhs Oct 16, 2025
02d6eaf
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 16, 2025
1391e69
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 16, 2025
20ee9df
fix package
anthony-nhs Oct 16, 2025
1101650
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 24, 2025
8f59e48
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 24, 2025
a907676
set up for publishing
anthony-nhs Oct 24, 2025
4eea72b
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 24, 2025
4224f1b
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 27, 2025
0818f2f
update packages
anthony-nhs Oct 27, 2025
852a510
try packaging
anthony-nhs Oct 27, 2025
e83de2f
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 27, 2025
7800d38
trigger build
anthony-nhs Oct 27, 2025
7af903f
use current branch name
anthony-nhs Oct 27, 2025
6e4a176
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 27, 2025
df023c6
trigger build
anthony-nhs Oct 27, 2025
d64c6bf
move npmrc
anthony-nhs Oct 27, 2025
3a242cf
skip qc
anthony-nhs Oct 27, 2025
23f39fb
put npmrc in new location
anthony-nhs Oct 27, 2025
f7bd280
try publishing
anthony-nhs Oct 27, 2025
1a1aa0c
update package-lock
anthony-nhs Oct 27, 2025
6fa9a0c
trigger build
anthony-nhs Oct 27, 2025
df16e5d
try latest
anthony-nhs Oct 27, 2025
057ba5e
fix sonar issues
anthony-nhs Oct 27, 2025
d26b01f
fix workflows
anthony-nhs Oct 27, 2025
5231658
latest version
anthony-nhs Oct 27, 2025
dbc2b5e
fix branch name
anthony-nhs Oct 27, 2025
15c451c
tidy things
anthony-nhs Oct 27, 2025
b7a57bc
update readme
anthony-nhs Oct 27, 2025
da9bc12
fix workflow
anthony-nhs Oct 27, 2025
72cb259
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 29, 2025
3ceef75
Merge remote-tracking branch 'origin/main' into cdk_construct
anthony-nhs Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 16 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: merge to main workflow
name: release workflow

on:
push:
Expand Down Expand Up @@ -55,29 +55,29 @@ jobs:
needs: [quality_checks, get_commit_id, get_asdf_version]
uses: NHSDigital/eps-workflow-semantic-release/.github/workflows/tag-release.yml@361957c147279f5f0f68b64fde9927833363d5f7
with:
dry_run: false
dry_run: true
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
branch_name: main
publish_package: false
publish_package: true
tag_format: ${{ needs.get_asdf_version.outputs.tag_format }}
secrets: inherit

package_code:
needs: [tag_release, quality_checks, get_commit_id]
uses: ./.github/workflows/docker_image_build.yml
with:
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
VERSION_NUMBER: pre-release-${{ needs.get_commit_id.outputs.sha_short }}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}

release_dev:
needs: [tag_release, package_code, get_commit_id]
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: dev
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
VERSION_NUMBER: pre-release-${{ needs.get_commit_id.outputs.sha_short }}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
TAG_LATEST: true
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
TAG_LATEST: false
DOCKER_IMAGE_TAG: pre-release-${{ needs.get_commit_id.outputs.sha_short }}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.DEV_CDK_PUSH_IMAGE_ROLE }}

Expand All @@ -86,10 +86,10 @@ jobs:
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: qa
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
VERSION_NUMBER: pre-release-${{ needs.get_commit_id.outputs.sha_short }}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
TAG_LATEST: true
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
TAG_LATEST: false
DOCKER_IMAGE_TAG: pre-release-${{ needs.get_commit_id.outputs.sha_short }}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.QA_CDK_PUSH_IMAGE_ROLE }}

Expand All @@ -98,33 +98,13 @@ jobs:
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: ref
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
VERSION_NUMBER: pre-release-${{ needs.get_commit_id.outputs.sha_short }}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
TAG_LATEST: true
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
TAG_LATEST: false
DOCKER_IMAGE_TAG: pre-release-${{ needs.get_commit_id.outputs.sha_short }}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.REF_CDK_PUSH_IMAGE_ROLE }}

release_int:
needs: [tag_release, release_qa, package_code, get_commit_id]
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: int
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
TAG_LATEST: true
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.INT_CDK_PUSH_IMAGE_ROLE }}

release_prod:
needs: [tag_release, release_int, package_code, get_commit_id]
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: prod
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
TAG_LATEST: true
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.PROD_CDK_PUSH_IMAGE_ROLE }}
package_npm_code:
needs: [quality_checks, get_commit_id]
uses: ./.github/workflows/package_npm_code.yml
13 changes: 0 additions & 13 deletions .github/workflows/dependabot_auto_approve_and_merge.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/package_npm_code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: docker image build

on:
workflow_call:

jobs:
get_asdf_version:
runs-on: ubuntu-22.04
outputs:
asdf_version: ${{ steps.asdf-version.outputs.version }}
tag_format: ${{ steps.load-config.outputs.TAG_FORMAT }}
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Get asdf version
id: asdf-version
run: echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"
- name: Load config value
id: load-config
run: |
TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
package_npm_code:
runs-on: ubuntu-22.04
needs: [get_asdf_version]
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ env.BRANCH_NAME }}

# using git commit sha for version of action to ensure we have stable version
- name: Install asdf
uses: asdf-vm/actions/setup@1902764435ca0dd2f3388eea723a4f92a4eb8302
with:
asdf_version: ${{ needs.get_asdf_version.outputs.asdf_version }}

- name: Cache asdf
uses: actions/cache@v4
with:
path: |
~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}

- name: Install asdf dependencies in .tool-versions
uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
with:
asdf_version: ${{ needs.get_asdf_version.outputs.asdf_version }}
env:
PYTHON_CONFIGURE_OPTS: --enable-shared

- name: Install dependencies
run: |
make install

- name: Package code
run: |
make package

- uses: actions/upload-artifact@v4
name: Upload packaged code
with:
name: nhsdigital-eps-cdk-constructs-1.0.0.tgz
path: |
lib/nhsdigital-eps-cdk-constructs-1.0.0.tgz
27 changes: 24 additions & 3 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}

jobs:
dependabot-auto-approve-and-merge:
needs: quality_checks
uses: NHSDigital/eps-workflow-dependabot/.github/workflows/dependabot-auto-approve-and-merge.yml@5b176f0bba32ef623dee7d134391160c0058402d
secrets:
AUTOMERGE_APP_ID: ${{ secrets.AUTOMERGE_APP_ID }}
AUTOMERGE_PEM: ${{ secrets.AUTOMERGE_PEM }}
get_asdf_version:
runs-on: ubuntu-22.04
outputs:
Expand Down Expand Up @@ -78,15 +84,19 @@ jobs:
echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT"
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"

package_code:
package_docker_image:
needs: [get_issue_number, quality_checks, get_commit_id]
uses: ./.github/workflows/docker_image_build.yml
with:
VERSION_NUMBER: PR-${{ needs.get_issue_number.outputs.issue_number }}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}

release_code:
needs: [get_issue_number, package_code, get_commit_id]
package_npm_code:
needs: [quality_checks, get_commit_id]
uses: ./.github/workflows/package_npm_code.yml

release_docker_image:
needs: [get_issue_number, package_docker_image, get_commit_id]
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: dev
Expand All @@ -96,3 +106,14 @@ jobs:
DOCKER_IMAGE_TAG: PR-${{ needs.get_issue_number.outputs.issue_number }}-${{ needs.get_commit_id.outputs.sha_short }}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.DEV_CDK_PUSH_IMAGE_ROLE }}

tag_release:
needs: [get_commit_id, get_asdf_version]
uses: NHSDigital/eps-workflow-semantic-release/.github/workflows/tag-release.yml@7c0d0e06afc120ec47372b479aa147ff9b453bca
with:
dry_run: true
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
branch_name: ${{ github.event.pull_request.head.ref }}
publish_package: true
tag_format: ${{ needs.get_asdf_version.outputs.tag_format }}
secrets: inherit
131 changes: 131 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: release workflow

on:
workflow_dispatch:
schedule:
- cron: "0 8 * * 3"

env:
BRANCH_NAME: ${{ github.ref_name }}

jobs:
get_commit_id:
runs-on: ubuntu-22.04
outputs:
commit_id: ${{ steps.commit_id.outputs.commit_id }}
sha_short: ${{ steps.commit_id.outputs.sha_short }}

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ env.BRANCH_NAME }}

- name: Get Commit ID
id: commit_id
run: |
# echo "commit_id=${{ github.sha }}" >> "$GITHUB_ENV"
echo "commit_id=${{ github.sha }}" >> "$GITHUB_OUTPUT"
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
get_asdf_version:
runs-on: ubuntu-22.04
outputs:
asdf_version: ${{ steps.asdf-version.outputs.version }}
tag_format: ${{ steps.load-config.outputs.TAG_FORMAT }}
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Get asdf version
id: asdf-version
run: echo "version=$(awk '!/^#/ && NF {print $1; exit}' .tool-versions.asdf)" >> "$GITHUB_OUTPUT"
- name: Load config value
id: load-config
run: |
TAG_FORMAT=$(yq '.TAG_FORMAT' .github/config/settings.yml)
echo "TAG_FORMAT=$TAG_FORMAT" >> "$GITHUB_OUTPUT"
quality_checks:
uses: NHSDigital/eps-workflow-quality-checks/.github/workflows/quality-checks.yml@4a6d03ad51516eddc448daf454805f85fe2025b9
needs: [get_asdf_version, get_commit_id]
with:
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

tag_release:
needs: [quality_checks, get_commit_id, get_asdf_version]
uses: NHSDigital/eps-workflow-semantic-release/.github/workflows/tag-release.yml@7c0d0e06afc120ec47372b479aa147ff9b453bca
with:
dry_run: false
asdfVersion: ${{ needs.get_asdf_version.outputs.asdf_version }}
branch_name: main
publish_package: true
tag_format: ${{ needs.get_asdf_version.outputs.tag_format }}
secrets: inherit

package_code:
needs: [tag_release, quality_checks, get_commit_id]
uses: ./.github/workflows/docker_image_build.yml
with:
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}

release_dev:
needs: [tag_release, package_code, get_commit_id]
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: dev
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
TAG_LATEST: true
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.DEV_CDK_PUSH_IMAGE_ROLE }}

release_qa:
needs: [tag_release, release_dev, package_code, get_commit_id]
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: qa
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
TAG_LATEST: true
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.QA_CDK_PUSH_IMAGE_ROLE }}

release_ref:
needs: [tag_release, release_dev, package_code, get_commit_id]
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: ref
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
TAG_LATEST: true
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.REF_CDK_PUSH_IMAGE_ROLE }}

release_int:
needs: [tag_release, release_qa, package_code, get_commit_id]
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: int
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
TAG_LATEST: true
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.INT_CDK_PUSH_IMAGE_ROLE }}

release_prod:
needs: [tag_release, release_int, package_code, get_commit_id]
uses: ./.github/workflows/docker_image_upload.yml
with:
AWS_ENVIRONMENT: prod
VERSION_NUMBER: ${{needs.tag_release.outputs.version_tag}}
COMMIT_ID: ${{ needs.get_commit_id.outputs.commit_id }}
TAG_LATEST: true
DOCKER_IMAGE_TAG: ${{needs.tag_release.outputs.version_tag}}
secrets:
CDK_PUSH_IMAGE_ROLE: ${{ secrets.PROD_CDK_PUSH_IMAGE_ROLE }}
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
@nhsdigital:registry=https://npm.pkg.github.com
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,14 @@ repos:
types_or: [sh, shell]
pass_filenames: false

- id: lint-cdkConstructs
name: Lint cdkConstructs
entry: npm
args: ["run", "--prefix=packages/cdkConstructs", "lint"]
language: system
files: ^packages\/cdkConstructs
types_or: [ts, tsx, javascript, jsx, json]
pass_filenames: false

fail_fast: true
default_stages: [pre-commit]
Loading