Skip to content

Commit d8aaf7e

Browse files
Robu6/libs nuget example (#57)
* Adding libs examples. * Add libs action to build stage. * correct typo * run.sh assembly names.
1 parent eedf32c commit d8aaf7e

Some content is hidden

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

42 files changed

+3429
-2
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,13 @@ trim_trailing_whitespace = unset
5757
indent_style = unset
5858
indent_size = unset
5959
generated_code = true
60+
61+
[*.sln]
62+
generated_code = true
63+
charset = unset
64+
end_of_line = unset
65+
insert_final_newline = unset
66+
trim_trailing_whitespace = unset
67+
indent_style = unset
68+
indent_size = unset
69+
generated_code = true
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Build libraries"
2+
description: "build libraries"
3+
inputs:
4+
version:
5+
description: "Version number"
6+
required: true
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 24
15+
16+
- name: Npm install
17+
working-directory: .
18+
run: npm ci
19+
shell: bash
20+
21+
- name: Build servers
22+
working-directory: ./src/server
23+
shell: bash
24+
run: |
25+
make build VERSION="${{ inputs.version }}"
26+
27+
- name: Upload abstractions artifact
28+
uses: actions/upload-artifact@v4
29+
with:
30+
path: "src/server/abstractions/bin/Release"
31+
name: libs-abstractions-${{ inputs.version }}
32+
33+
- name: Upload data artifact
34+
uses: actions/upload-artifact@v4
35+
with:
36+
path: "src/server/data/bin/Release"
37+
name: libs-data-${{ inputs.version }}
38+
39+
- name: Upload letter artifact
40+
uses: actions/upload-artifact@v4
41+
with:
42+
path: "src/server/letter/bin/Release"
43+
name: libs-letter-${{ inputs.version }}
44+
45+
- name: Upload host artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
path: "src/server/host/bin/Release"
49+
name: libs-host-${{ inputs.version }}

.github/actions/build-server/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ runs:
2929
run: |
3030
make build VERSION="${{ inputs.version }}"
3131
32-
- name: Upload csharp-server artifact
32+
- name: Upload csharp-server artifact
3333
uses: actions/upload-artifact@v4
3434
with:
3535
path: "server/csharp-server"

.github/workflows/stage-3-build.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ jobs:
6969
with:
7070
version: "${{ inputs.version }}"
7171

72+
artefact-libs:
73+
name: "Build libs"
74+
runs-on: ubuntu-latest
75+
timeout-minutes: 3
76+
steps:
77+
- name: "Checkout code"
78+
uses: actions/checkout@v4
79+
- name: "Build servers"
80+
uses: ./.github/actions/build-libraries
81+
with:
82+
version: "${{ inputs.version }}"
83+
7284
# artefact-1:
7385
# name: "Artefact 1"
7486
# runs-on: ubuntu-latest

.github/workflows/stage-5-publish.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,58 @@ jobs:
351351
message-title: "Notification title"
352352
message-text: "This is a notification body"
353353
link: ${{ github.event.pull_request.html_url }}
354+
355+
356+
### PUBLISH LIBS ABSTRACTION NUGET
357+
publishlibsabstractionsnuget:
358+
name: "Publish libs abstractions packages to nuget.pkg.github.com"
359+
runs-on: ubuntu-latest
360+
needs: [publish]
361+
permissions:
362+
packages: write
363+
contents: read
364+
steps:
365+
- name: "Get the artefacts"
366+
uses: actions/download-artifact@v4
367+
with:
368+
path: .
369+
name: libs-abstractions-${{ inputs.version }}
370+
- run: ls -la
371+
- run: |
372+
dotnet nuget add source \
373+
--username nhs-notify-supplier-api \
374+
--password ${{ secrets.GITHUB_TOKEN }} \
375+
--store-password-in-clear-text \
376+
--name github \
377+
"https://nuget.pkg.github.com/NHSDigital/index.json"
378+
- run: |
379+
echo "ROOT .version file is: $(cat .version)"
380+
echo "GH variable version is: ${{ inputs.version }}"
381+
name: Showing the base versions
382+
383+
- run: |
384+
VERSION=${{ inputs.version }}
385+
SHORT_VERSION="$(echo $VERSION | rev | cut -d"." -f2- | rev)"
386+
NUGET_VERSION="$(echo "$VERSION" | tr + .)"
387+
echo $VERSION
388+
echo $SHORT_VERSION
389+
echo $NUGET_VERSION
390+
SHORT_NUGET_VERSION="$(echo $NUGET_VERSION | rev | cut -d"." -f2- | rev)"
391+
echo $SHORT_NUGET_VERSION
392+
SHORTER_NUGET_VERSION="$(echo $SHORT_NUGET_VERSION | rev | cut -d"." -f2- | rev)"
393+
echo $SHORTER_NUGET_VERSION
394+
TEST_NUGET_VERSION="$(echo $NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')"
395+
TEST_NUGET_VERSION="$(echo $TEST_NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')"
396+
echo $TEST_NUGET_VERSION
397+
echo "TEST_NUGET_VERSION=$TEST_NUGET_VERSION" >> "$GITHUB_OUTPUT"
398+
name: Set the nuget version
399+
id: set-nuget-version
400+
401+
- run: |
402+
dotnet nuget push \
403+
nhs.notify.suppliers.api.abstractions.${TEST_NUGET_VERSION}.nupkg \
404+
--source github \
405+
--api-key $GITHUB_TOKEN
406+
env:
407+
TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }}
408+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitleaksignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ b1f85a7faf54eaf66074d7a6daa093aefe6b3ebe:sdk/python/pyproject.toml:ipv4:25
1414
4118582e5009685c1ac31fc664371649602a8a0e:specification/api/notify-supplier-next.yml:generic-api-key:119
1515
28aa8bcf42e1af50ab2541a345be851b53dd0f00:specification/api/notify-supplier-next.yml:generic-api-key:119
1616
28aa8bcf42e1af50ab2541a345be851b53dd0f00:specification/api/notify-supplier.yml:generic-api-key:115
17+
93e54b6baa390529aab08d9fd956837f7bb3f30:src/src.sln:ipv4:3
18+
493e54b6baa390529aab08d9fd956837f7bb3f30:src/src.sln:ipv4:3

infrastructure/terraform/components/api/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ No requirements.
2121
| <a name="input_parent_acct_environment"></a> [parent\_acct\_environment](#input\_parent\_acct\_environment) | Name of the environment responsible for the acct resources used, affects things like DNS zone. Useful for named dev environments | `string` | `"main"` | no |
2222
| <a name="input_project"></a> [project](#input\_project) | The name of the tfscaffold project | `string` | n/a | yes |
2323
| <a name="input_region"></a> [region](#input\_region) | The AWS Region | `string` | n/a | yes |
24+
| <a name="input_shared_infra_account_id"></a> [shared\_infra\_account\_id](#input\_shared\_infra\_account\_id) | The AWS Account ID of the shared infrastructure account | `string` | `"000000000000"` | no |
2425
## Modules
2526

2627
| Name | Source | Version |

scripts/config/pre-commit.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ repos:
1616
exclude: |
1717
(?x)^(
1818
sdk/.* |
19-
someotherdir/.*
19+
someotherdir/.* |
20+
src/server/host/Properties/launchSettings.json
2021
)$
2122
2223
# - id: ...

0 commit comments

Comments
 (0)