@@ -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 }}
0 commit comments