Skip to content

Commit be08f6d

Browse files
Adding other example poc libs.
1 parent ca74a4e commit be08f6d

File tree

9 files changed

+198
-8
lines changed

9 files changed

+198
-8
lines changed

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

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,3 +406,170 @@ jobs:
406406
env:
407407
TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }}
408408
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
409+
410+
411+
412+
### PUBLISH LIBS LETTERS NUGET
413+
publishliblettersnuget:
414+
name: "Publish libs letter packages to nuget.pkg.github.com"
415+
runs-on: ubuntu-latest
416+
needs: [publish]
417+
permissions:
418+
packages: write
419+
contents: read
420+
steps:
421+
- name: "Get the artefacts"
422+
uses: actions/download-artifact@v4
423+
with:
424+
path: .
425+
name: libs-letter-${{ inputs.version }}
426+
- run: ls -la
427+
- run: |
428+
dotnet nuget add source \
429+
--username nhs-notify-supplier-api \
430+
--password ${{ secrets.GITHUB_TOKEN }} \
431+
--store-password-in-clear-text \
432+
--name github \
433+
"https://nuget.pkg.github.com/NHSDigital/index.json"
434+
- run: |
435+
echo "ROOT .version file is: $(cat .version)"
436+
echo "GH variable version is: ${{ inputs.version }}"
437+
name: Showing the base versions
438+
439+
- run: |
440+
VERSION=${{ inputs.version }}
441+
SHORT_VERSION="$(echo $VERSION | rev | cut -d"." -f2- | rev)"
442+
NUGET_VERSION="$(echo "$VERSION" | tr + .)"
443+
echo $VERSION
444+
echo $SHORT_VERSION
445+
echo $NUGET_VERSION
446+
SHORT_NUGET_VERSION="$(echo $NUGET_VERSION | rev | cut -d"." -f2- | rev)"
447+
echo $SHORT_NUGET_VERSION
448+
SHORTER_NUGET_VERSION="$(echo $SHORT_NUGET_VERSION | rev | cut -d"." -f2- | rev)"
449+
echo $SHORTER_NUGET_VERSION
450+
TEST_NUGET_VERSION="$(echo $NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')"
451+
TEST_NUGET_VERSION="$(echo $TEST_NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')"
452+
echo $TEST_NUGET_VERSION
453+
echo "TEST_NUGET_VERSION=$TEST_NUGET_VERSION" >> "$GITHUB_OUTPUT"
454+
name: Set the nuget version
455+
id: set-nuget-version
456+
457+
- run: |
458+
dotnet nuget push \
459+
nhs.notify.suppliers.api.letter.${TEST_NUGET_VERSION}.nupkg \
460+
--source github \
461+
--api-key $GITHUB_TOKEN
462+
env:
463+
TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }}
464+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
465+
466+
467+
### PUBLISH LIBS data NUGET
468+
publishlibhostnuget:
469+
name: "Publish libs host packages to nuget.pkg.github.com"
470+
runs-on: ubuntu-latest
471+
needs: [publish]
472+
permissions:
473+
packages: write
474+
contents: read
475+
steps:
476+
- name: "Get the artefacts"
477+
uses: actions/download-artifact@v4
478+
with:
479+
path: .
480+
name: libs-host-${{ inputs.version }}
481+
- run: ls -la
482+
- run: |
483+
dotnet nuget add source \
484+
--username nhs-notify-supplier-api \
485+
--password ${{ secrets.GITHUB_TOKEN }} \
486+
--store-password-in-clear-text \
487+
--name github \
488+
"https://nuget.pkg.github.com/NHSDigital/index.json"
489+
- run: |
490+
echo "ROOT .version file is: $(cat .version)"
491+
echo "GH variable version is: ${{ inputs.version }}"
492+
name: Showing the base versions
493+
494+
- run: |
495+
VERSION=${{ inputs.version }}
496+
SHORT_VERSION="$(echo $VERSION | rev | cut -d"." -f2- | rev)"
497+
NUGET_VERSION="$(echo "$VERSION" | tr + .)"
498+
echo $VERSION
499+
echo $SHORT_VERSION
500+
echo $NUGET_VERSION
501+
SHORT_NUGET_VERSION="$(echo $NUGET_VERSION | rev | cut -d"." -f2- | rev)"
502+
echo $SHORT_NUGET_VERSION
503+
SHORTER_NUGET_VERSION="$(echo $SHORT_NUGET_VERSION | rev | cut -d"." -f2- | rev)"
504+
echo $SHORTER_NUGET_VERSION
505+
TEST_NUGET_VERSION="$(echo $NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')"
506+
TEST_NUGET_VERSION="$(echo $TEST_NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')"
507+
echo $TEST_NUGET_VERSION
508+
echo "TEST_NUGET_VERSION=$TEST_NUGET_VERSION" >> "$GITHUB_OUTPUT"
509+
name: Set the nuget version
510+
id: set-nuget-version
511+
512+
- run: |
513+
dotnet nuget push \
514+
nhs.notify.suppliers.api.host.${TEST_NUGET_VERSION}.nupkg \
515+
--source github \
516+
--api-key $GITHUB_TOKEN
517+
env:
518+
TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }}
519+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
520+
521+
522+
523+
### PUBLISH LIBS host NUGET
524+
publishlibdatanuget:
525+
name: "Publish libs host packages to nuget.pkg.github.com"
526+
runs-on: ubuntu-latest
527+
needs: [publish]
528+
permissions:
529+
packages: write
530+
contents: read
531+
steps:
532+
- name: "Get the artefacts"
533+
uses: actions/download-artifact@v4
534+
with:
535+
path: .
536+
name: libs-host-${{ inputs.version }}
537+
- run: ls -la
538+
- run: |
539+
dotnet nuget add source \
540+
--username nhs-notify-supplier-api \
541+
--password ${{ secrets.GITHUB_TOKEN }} \
542+
--store-password-in-clear-text \
543+
--name github \
544+
"https://nuget.pkg.github.com/NHSDigital/index.json"
545+
- run: |
546+
echo "ROOT .version file is: $(cat .version)"
547+
echo "GH variable version is: ${{ inputs.version }}"
548+
name: Showing the base versions
549+
550+
- run: |
551+
VERSION=${{ inputs.version }}
552+
SHORT_VERSION="$(echo $VERSION | rev | cut -d"." -f2- | rev)"
553+
NUGET_VERSION="$(echo "$VERSION" | tr + .)"
554+
echo $VERSION
555+
echo $SHORT_VERSION
556+
echo $NUGET_VERSION
557+
SHORT_NUGET_VERSION="$(echo $NUGET_VERSION | rev | cut -d"." -f2- | rev)"
558+
echo $SHORT_NUGET_VERSION
559+
SHORTER_NUGET_VERSION="$(echo $SHORT_NUGET_VERSION | rev | cut -d"." -f2- | rev)"
560+
echo $SHORTER_NUGET_VERSION
561+
TEST_NUGET_VERSION="$(echo $NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')"
562+
TEST_NUGET_VERSION="$(echo $TEST_NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')"
563+
echo $TEST_NUGET_VERSION
564+
echo "TEST_NUGET_VERSION=$TEST_NUGET_VERSION" >> "$GITHUB_OUTPUT"
565+
name: Set the nuget version
566+
id: set-nuget-version
567+
568+
- run: |
569+
dotnet nuget push \
570+
nhs.notify.suppliers.api.host.${TEST_NUGET_VERSION}.nupkg \
571+
--source github \
572+
--api-key $GITHUB_TOKEN
573+
env:
574+
TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }}
575+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build: # Build the project artefact @Pipeline
1414
(cd server && make build)
1515
(cd sdk && make build)
1616
(cd docs && make build)
17-
17+
(cd libs && make build)
1818
publish: # Publish the project artefact @Pipeline
1919
# TODO: Implement the artefact publishing step
2020

sdk/_config.version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 0.2.0-20250704.123845+a16df0f
1+
version: 0.2.0-20250708.142731+ca74a4e

server/_config.version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 0.2.0-20250704.123842+a16df0f
1+
version: 0.2.0-20250708.142722+ca74a4e

src/server/_config.version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 0.2.0-20250708.102840+fb71052
1+
version: 0.2.0-20250708.142439+ca74a4e

src/server/abstractions/abstractions.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Nullable>enable</Nullable>
77
<PublishTrimmed>false</PublishTrimmed>
88
<AssemblyName>nhs.notify.suppliers.api.abstractions</AssemblyName>
9+
<NoDefaultExcludes>true</NoDefaultExcludes>
910
</PropertyGroup>
1011

1112
<ItemGroup>
@@ -16,5 +17,9 @@
1617
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.6" />
1718
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="9.0.6" />
1819
</ItemGroup>
19-
20+
<ItemGroup>
21+
<Content Include="../.version">
22+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
23+
</Content>
24+
</ItemGroup>
2025
</Project>

src/server/data/data.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,24 @@
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<AssemblyName>nhs.notify.suppliers.api.data</AssemblyName>
8+
<NoDefaultExcludes>true</NoDefaultExcludes>
89
</PropertyGroup>
910

1011
<ItemGroup>
1112

1213
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.3.0" />
1314
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.17" />
14-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.6" />
15+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions"
16+
Version="9.0.6" />
1517
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
1618
</ItemGroup>
1719

1820
<ItemGroup>
1921
<ProjectReference Include="..\abstractions\abstractions.csproj" />
2022
</ItemGroup>
21-
23+
<ItemGroup>
24+
<Content Include="../.version">
25+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
26+
</Content>
27+
</ItemGroup>
2228
</Project>

src/server/host/host.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
<AssemblyName>nhs.notify.suppliers.api.host</AssemblyName>
88
<IsPackable>true</IsPackable>
9+
<NoDefaultExcludes>true</NoDefaultExcludes>
910
</PropertyGroup>
1011

1112
<ItemGroup>
@@ -23,6 +24,12 @@
2324
<Content Include="run.sh">
2425
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2526
</Content>
27+
<Content Include="../.version">
28+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
29+
</Content>
30+
31+
<Content Update="appsettings.*.json" CopyToPublishDirectory="Never" />
32+
<Content Update="appsettings.json" CopyToPublishDirectory="Never" />
2633
</ItemGroup>
2734

2835

src/server/letter/letter.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<AssemblyName>nhs.notify.suppliers.api.letter</AssemblyName>
8+
<NoDefaultExcludes>true</NoDefaultExcludes>
89
</PropertyGroup>
910

1011
<ItemGroup>
@@ -17,5 +18,9 @@
1718
<ItemGroup>
1819
<ProjectReference Include="..\abstractions\abstractions.csproj" />
1920
</ItemGroup>
20-
21+
<ItemGroup>
22+
<Content Include="../.version">
23+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
24+
</Content>
25+
</ItemGroup>
2126
</Project>

0 commit comments

Comments
 (0)