Skip to content

Commit a62a13a

Browse files
CCM-11026: publish event schemas (copy) (#642)
1 parent dcc1870 commit a62a13a

File tree

72 files changed

+2354
-8438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2354
-8438
lines changed

.github/workflows/pr_closed.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,60 @@ jobs:
5454
targetAccountGroup: "nhs-notify-template-management-dev"
5555
targetComponent: ${{ matrix.component }}
5656
terraformAction: "apply"
57+
58+
check-event-schemas-version-change:
59+
name: Check for event schemas package version change
60+
needs: check-merge-or-workflow-dispatch
61+
if: needs.check-merge-or-workflow-dispatch.outputs.deploy == 'true'
62+
runs-on: ubuntu-latest
63+
permissions:
64+
contents: read
65+
packages: read
66+
steps:
67+
- name: Checkout code
68+
uses: actions/[email protected]
69+
70+
- name: Use Node.js 20
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: '20.18.2'
74+
registry-url: 'https://npm.pkg.github.com'
75+
76+
- name: check if local version differs from latest published version
77+
run: |
78+
published_version=$(npm view @nhsdigital/nhs-notify-event-schemas-template-management --json 2>/dev/null | jq -r '.["dist-tags"].latest')
79+
local_version=$(cat packages/event-schemas/package.json | jq -r '.version')
80+
if [[ $local_version = $published_version ]]; then
81+
echo "Local version is the same as the latest published version - skipping publish"
82+
echo "version_changed=false" >> $GITHUB_OUTPUT
83+
else
84+
echo "Local version is different to the latest published version - publishing new version"
85+
echo "version_changed=true" >> $GITHUB_OUTPUT
86+
fi
87+
88+
publish-event-schemas:
89+
name: Publish event schemas package to GitHub package registry
90+
needs: check-event-schemas-version-change
91+
if: needs.check-event-schemas-version-change.outputs.version_changed == 'true'
92+
runs-on: ubuntu-latest
93+
permissions:
94+
contents: read
95+
packages: write
96+
97+
steps:
98+
- name: Checkout code
99+
uses: actions/[email protected]
100+
101+
- name: Use Node.js 20
102+
uses: actions/setup-node@v4
103+
with:
104+
node-version: '20.18.2'
105+
registry-url: 'https://npm.pkg.github.com'
106+
107+
- name: Install dependencies
108+
run: npm ci
109+
110+
- name: Publish to GitHub Packages
111+
run: npm publish --workspace packages/event-schemas
112+
env:
113+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ acceptance-test-report
3535
# production
3636
/build
3737
dist
38+
*.tgz
3839

3940
# misc
4041
.DS_Store

.vscode/settings.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
2+
"editor.codeActionsOnSave": {
3+
"source.fixAll.eslint": "explicit"
4+
},
5+
"eslint.codeActionsOnSave.mode": "problems",
6+
"eslint.useFlatConfig": false,
27
"markdownlint.config": {
38
"MD013": false,
49
"MD024": {
510
"siblings_only": true
611
},
712
"MD033": false
8-
},
9-
"editor.codeActionsOnSave": {
10-
"source.fixAll.eslint": "explicit"
11-
},
12-
"eslint.codeActionsOnSave.mode": "problems"
13+
}
1314
}

0 commit comments

Comments
 (0)