diff --git a/.github/workflows/cicd-1-pull-request.yaml b/.github/workflows/cicd-1-pull-request.yaml index b2b659bf7..f27f04fdf 100644 --- a/.github/workflows/cicd-1-pull-request.yaml +++ b/.github/workflows/cicd-1-pull-request.yaml @@ -187,18 +187,3 @@ jobs: pr_number: ${{ needs.metadata.outputs.pr_number }} proxy_deployed: "${{ needs.metadata.outputs.deploy_proxy }}" secrets: inherit - publish-stage: # Recommended maximum execution time is 10 minutes - name: "Publish stage" - needs: [metadata, acceptance-stage] - uses: ./.github/workflows/stage-5-publish.yaml - if: (github.event_name == 'push' && github.ref == 'refs/heads/main') - with: - build_datetime: "${{ needs.metadata.outputs.build_datetime }}" - build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}" - build_epoch: "${{ needs.metadata.outputs.build_epoch }}" - nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}" - python_version: "${{ needs.metadata.outputs.python_version }}" - terraform_version: "${{ needs.metadata.outputs.terraform_version }}" - version: "${{ needs.metadata.outputs.version }}" - is_version_prerelease: "${{ needs.metadata.outputs.is_version_prerelease }}" - secrets: inherit diff --git a/.github/workflows/stage-5-publish.yaml b/.github/workflows/stage-5-publish.yaml deleted file mode 100644 index df5192a8f..000000000 --- a/.github/workflows/stage-5-publish.yaml +++ /dev/null @@ -1,635 +0,0 @@ -name: "Publish stage" - -on: - workflow_call: - inputs: - build_datetime: - description: "Build datetime, set by the CI/CD pipeline workflow" - required: true - type: string - build_timestamp: - description: "Build timestamp, set by the CI/CD pipeline workflow" - required: true - type: string - build_epoch: - description: "Build epoch, set by the CI/CD pipeline workflow" - required: true - type: string - nodejs_version: - description: "Node.js version, set by the CI/CD pipeline workflow" - required: true - type: string - python_version: - description: "Python version, set by the CI/CD pipeline workflow" - required: true - type: string - terraform_version: - description: "Terraform version, set by the CI/CD pipeline workflow" - required: true - type: string - version: - description: "Version of the software, set by the CI/CD pipeline workflow" - required: true - type: string - is_version_prerelease: - description: "Is this a semantically versioned pre release, set by the CI/CD pipeline workflow" - required: true - type: string -jobs: - publish: - name: "Publish packages" - runs-on: ubuntu-latest - timeout-minutes: 10 - outputs: - release_id: ${{ steps.create_release.outputs.id }} - upload_url: ${{ steps.create_release.outputs.upload_url }} - - steps: - - name: "Checkout code" - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: "Get the artefacts 1" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: ./artifacts/jekyll-docs-${{ inputs.version }} - name: jekyll-docs-${{ inputs.version }} - - - name: "Get the artefacts 2" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: ./artifacts/sdk-html-docs-${{ inputs.version }} - name: sdk-html-docs-${{ inputs.version }} - - - name: "Get the artefacts 3" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: ./artifacts/sdk-swagger-docs-${{ inputs.version }} - name: sdk-swagger-docs-${{ inputs.version }} - - - name: "Get the artefacts 4" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: ./artifacts/sdk-html-${{ inputs.version }} - name: sdk-html-${{ inputs.version }} - - - name: "Get the artefacts 5" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: ./artifacts/sdk-ts-${{ inputs.version }} - name: sdk-ts-${{ inputs.version }} - - - name: "Get the artefacts 6" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: ./artifacts/sdk-python-${{ inputs.version }} - name: sdk-python-${{ inputs.version }} - - - name: "Get the artefacts 7" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: ./artifacts/sdk-csharp-${{ inputs.version }} - name: sdk-csharp-${{ inputs.version }} - - # Take out for now - might add again in the future - # - name: "Get the artefacts 9" - # uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - # with: - # path: ./artifacts/server-csharp-${{ inputs.version }} - # name: server-csharp-${{ inputs.version }} - - - name: "Create release" - id: create_release - uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ inputs.version }} - release_name: ${{ inputs.version }} - body: | - Release of ${{ inputs.version }} - draft: false - prerelease: ${{ inputs.is_version_prerelease == 'true'}} - - - name: "Upload jekyll docs release asset" - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: "${{ steps.create_release.outputs.upload_url }}" - asset_path: ./artifacts/jekyll-docs-${{ inputs.version }}/artifact.tar - asset_name: jekyll-docs-${{ inputs.version }}.tar - asset_content_type: "application/gzip" - - - name: "Upload sdk html docs release asset" - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: "${{ steps.create_release.outputs.upload_url }}" - asset_path: ./artifacts/sdk-html-docs-${{ inputs.version }}/artifact.tar - asset_name: sdk-html-docs-${{ inputs.version }}.tar - asset_content_type: "application/gzip" - - - name: "Upload sdk swagger docs release asset" - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: "${{ steps.create_release.outputs.upload_url }}" - asset_path: ./artifacts/sdk-swagger-docs-${{ inputs.version }}/artifact.tar - asset_name: sdk-swagger-docs-${{ inputs.version }}.tar - asset_content_type: "application/gzip" - - - name: "zip html release asset" - # GitHub pages needs a single tar called artifact inside the zip. - working-directory: ./artifacts/sdk-html-${{ inputs.version }} - run: zip -r ../sdk-html-${{ inputs.version }}.zip . - shell: bash - - - name: "Upload sdk html release asset" - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: "${{ steps.create_release.outputs.upload_url }}" - asset_path: ./artifacts/sdk-html-${{ inputs.version }}.zip - asset_name: sdk-html-${{ inputs.version }}.zip - asset_content_type: "application/gzip" - - - name: "zip sdk ts release asset" - # GitHub pages needs a single tar called artifact inside the zip. - working-directory: ./artifacts/sdk-ts-${{ inputs.version }} - run: zip -r ../sdk-ts-${{ inputs.version }}.zip . - shell: bash - - - name: "Upload sdk ts release asset" - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: "${{ steps.create_release.outputs.upload_url }}" - asset_path: ./artifacts/sdk-ts-${{ inputs.version }}.zip - asset_name: sdk-ts-${{ inputs.version }}.zip - asset_content_type: "application/gzip" - - - name: "zip sdk python release asset" - # GitHub pages needs a single tar called artifact inside the zip. - working-directory: ./artifacts/sdk-python-${{ inputs.version }} - run: zip -r ../sdk-python-${{ inputs.version }}.zip . - shell: bash - - - name: "Upload sdk python release asset" - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: "${{ steps.create_release.outputs.upload_url }}" - asset_path: ./artifacts/sdk-python-${{ inputs.version }}.zip - asset_name: sdk-python-${{ inputs.version }}.zip - asset_content_type: "application/gzip" - - - name: "zip sdk csharp release asset" - # GitHub pages needs a single tar called artifact inside the zip. - working-directory: ./artifacts/sdk-csharp-${{ inputs.version }} - run: zip -r ../sdk-csharp-${{ inputs.version }}.zip . - shell: bash - - - name: "Upload sdk csharp release asset" - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: "${{ steps.create_release.outputs.upload_url }}" - asset_path: ./artifacts/sdk-csharp-${{ inputs.version }}.zip - asset_name: sdk-csharp-${{ inputs.version }}.zip - asset_content_type: "application/gzip" - - # Take out for now - might add again in the future - # - name: "zip csharp server release asset" - # # GitHub pages needs a single tar called artifact inside the zip. - # working-directory: ./artifacts/server-csharp-${{ inputs.version }} - # run: zip -r ../server-csharp-${{ inputs.version }}.zip . - # shell: bash - - # Take out for now - might add again in the future - # - name: "Upload csharp server release asset" - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: "${{ steps.create_release.outputs.upload_url }}" - # asset_path: ./artifacts/server-csharp-${{ inputs.version }}.zip - # asset_name: server-csharp-${{ inputs.version }}.zip - # asset_content_type: "application/gzip" - - publish-oas-specs: - name: "Publish OAS spec (${{ matrix.apimEnv }})" - runs-on: ubuntu-latest - needs: [publish] - permissions: - id-token: write # This is required for requesting the JWT - contents: write # This is required for publishing release asset - timeout-minutes: 10 - strategy: - matrix: - apimEnv: [internal-dev, int, ref, prod] - steps: - - name: "Download OAS spec artifact" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: ./artifacts/api-oas-specification-${{ matrix.apimEnv }}-${{ inputs.version }} - name: api-oas-specification-${{ matrix.apimEnv }}-${{ inputs.version }} - - - name: "Zip OAS specification" - working-directory: ./artifacts/api-oas-specification-${{ matrix.apimEnv }}-${{ inputs.version }} - run: zip -r ../api-oas-specification-${{ matrix.apimEnv }}-${{ inputs.version }}.zip . - shell: bash - - - name: "Upload OAS specification release asset" - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.publish.outputs.upload_url }} - asset_path: ./artifacts/api-oas-specification-${{ matrix.apimEnv }}-${{ inputs.version }}.zip - asset_name: api-oas-specification-${{ matrix.apimEnv }}-${{ inputs.version }}.zip - asset_content_type: "application/zip" - - # Take out for now - might add again in the future - # ### PUBLISH DOCKER - THIS NEEDS CHANGING TO DO THE DOCKER BUILD IN THE BUILD STAGE AND ARTIFACT IT. SEE publishlibhostdocker below how how and the buildlibs action. - # publishdocker: - # name: "Publish docker packages" - # runs-on: ubuntu-latest - # needs: [publish] - # permissions: - # packages: write - # contents: read - # steps: - # - name: "Get the artefacts csharp docker" - # uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - # with: - # path: . - # name: server-csharp-docker-${{ inputs.version }} - # - name: "Get the artefacts csharp server" - # uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - # with: - # path: ./csharp-server - # name: server-csharp-${{ inputs.version }} - # - run: ls -la - # - run: | - # docker build . -t ghcr.io/nhsdigital/nhsnotifysupplierserver:latest - # echo $CR_PAT | docker login ghcr.io -u nhs-notify-supplier-api --password-stdin - # docker push ghcr.io/nhsdigital/nhsnotifysupplierserver:latest - # env: - # CR_PAT: ${{ secrets.GITHUB_TOKEN }} - - ### PUBLISH NUGET - publishnuget: - name: "Publish nuget packages to nuget.pkg.github.com" - runs-on: ubuntu-latest - needs: [publish] - permissions: - packages: write - contents: read - steps: - - name: "Get the artefacts" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: . - name: sdk-csharp-${{ inputs.version }} - - run: | - ls -la - - run: | - dotnet nuget add source \ - --username nhs-notify-supplier-api \ - --password ${{ secrets.GITHUB_TOKEN }} \ - --store-password-in-clear-text \ - --name github \ - "https://nuget.pkg.github.com/NHSDigital/index.json" - - run: | - echo "ROOT .version file is: $(cat .version)" - echo "GH variable version is: ${{ inputs.version }}" - name: Showing the base versions - - - run: | - VERSION=${{ inputs.version }} - SHORT_VERSION="$(echo $VERSION | rev | cut -d"." -f2- | rev)" - NUGET_VERSION="$(echo "$VERSION" | tr + .)" - echo $VERSION - echo $SHORT_VERSION - echo $NUGET_VERSION - SHORT_NUGET_VERSION="$(echo $NUGET_VERSION | rev | cut -d"." -f2- | rev)" - echo $SHORT_NUGET_VERSION - SHORTER_NUGET_VERSION="$(echo $SHORT_NUGET_VERSION | rev | cut -d"." -f2- | rev)" - echo $SHORTER_NUGET_VERSION - TEST_NUGET_VERSION="$(echo $NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')" - TEST_NUGET_VERSION="$(echo $TEST_NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')" - echo $TEST_NUGET_VERSION - echo "TEST_NUGET_VERSION=$TEST_NUGET_VERSION" >> "$GITHUB_OUTPUT" - name: Set the nuget version - id: set-nuget-version - - - run: | - dotnet nuget push \ - nhsnotifysupplier.${TEST_NUGET_VERSION}.nupkg \ - --source github \ - --api-key $GITHUB_TOKEN - env: - TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - ### Publish NPM - - publishnpm: - name: "Publish npm packages to npm.pkg.github.com" - runs-on: ubuntu-latest - needs: [publish] - permissions: - packages: write - contents: read - steps: - - name: "Get the artefacts" - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - path: . - name: sdk-ts-${{ inputs.version }} - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version: "24.3" - registry-url: "https://npm.pkg.github.com" - scope: "@NHSDigital" - - - run: ls -la - - run: npm cache clear --force - - run: npm i - - run: npm run build - - run: ls -la - - run: npm publish --verbose --tag next - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - success: - name: "Success notification" - runs-on: ubuntu-latest - needs: [publish, publishnpm] - steps: - - name: "Check prerequisites for notification" - id: check - run: echo "secret_exist=${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL != '' }}" >> $GITHUB_OUTPUT - - name: "Notify on publishing packages" - if: steps.check.outputs.secret_exist == 'true' - uses: nhs-england-tools/notify-msteams-action@a9fbb9bb41ef7db9c74d4fdc893f12812094fecf # v1.0.5 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - teams-webhook-url: ${{ secrets.TEAMS_NOTIFICATION_WEBHOOK_URL }} - message-title: "Notification title" - message-text: "This is a notification body" - link: ${{ github.event.pull_request.html_url }} - - # Take out for now - might add again in the future - # ### PUBLISH LIBS ABSTRACTION NUGET - # publishlibsabstractionsnuget: - # name: "Publish libs abstractions packages to nuget.pkg.github.com" - # runs-on: ubuntu-latest - # needs: [publish] - # permissions: - # packages: write - # contents: read - # steps: - # - name: "Get the artefacts" - # uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - # with: - # path: . - # name: libs-abstractions-${{ inputs.version }} - # - run: | - # ls -la - # find . -name ".version" - # - run: | - # dotnet nuget add source \ - # --username nhs-notify-supplier-api \ - # --password ${{ secrets.GITHUB_TOKEN }} \ - # --store-password-in-clear-text \ - # --name github \ - # "https://nuget.pkg.github.com/NHSDigital/index.json" - # - run: | - # echo "ROOT .version file is: $(cat .version)" - # echo "GH variable version is: ${{ inputs.version }}" - # name: Showing the base versions - - # - run: | - # VERSION=${{ inputs.version }} - # SHORT_VERSION="$(echo $VERSION | rev | cut -d"." -f2- | rev)" - # NUGET_VERSION="$(echo "$VERSION" | tr + .)" - # echo $VERSION - # echo $SHORT_VERSION - # echo $NUGET_VERSION - # SHORT_NUGET_VERSION="$(echo $NUGET_VERSION | rev | cut -d"." -f2- | rev)" - # echo $SHORT_NUGET_VERSION - # SHORTER_NUGET_VERSION="$(echo $SHORT_NUGET_VERSION | rev | cut -d"." -f2- | rev)" - # echo $SHORTER_NUGET_VERSION - # TEST_NUGET_VERSION="$(echo $NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')" - # TEST_NUGET_VERSION="$(echo $TEST_NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')" - # echo $TEST_NUGET_VERSION - # echo "TEST_NUGET_VERSION=$TEST_NUGET_VERSION" >> "$GITHUB_OUTPUT" - # name: Set the nuget version - # id: set-nuget-version - - # - run: | - # dotnet nuget push \ - # nhs.notify.suppliers.api.abstractions.${TEST_NUGET_VERSION}.nupkg \ - # --source github \ - # --api-key $GITHUB_TOKEN - # env: - # TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # ### PUBLISH LIBS LETTERS NUGET - # publishliblettersnuget: - # name: "Publish libs letter packages to nuget.pkg.github.com" - # runs-on: ubuntu-latest - # needs: [publish] - # permissions: - # packages: write - # contents: read - # steps: - # - name: "Get the artefacts" - # uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - # with: - # path: . - # name: libs-letter-${{ inputs.version }} - # - run: | - # ls -la - # find . -name ".version" - # - run: | - # dotnet nuget add source \ - # --username nhs-notify-supplier-api \ - # --password ${{ secrets.GITHUB_TOKEN }} \ - # --store-password-in-clear-text \ - # --name github \ - # "https://nuget.pkg.github.com/NHSDigital/index.json" - # - run: | - # echo "ROOT .version file is: $(cat .version)" - # echo "GH variable version is: ${{ inputs.version }}" - # name: Showing the base versions - - # - run: | - # VERSION=${{ inputs.version }} - # SHORT_VERSION="$(echo $VERSION | rev | cut -d"." -f2- | rev)" - # NUGET_VERSION="$(echo "$VERSION" | tr + .)" - # echo $VERSION - # echo $SHORT_VERSION - # echo $NUGET_VERSION - # SHORT_NUGET_VERSION="$(echo $NUGET_VERSION | rev | cut -d"." -f2- | rev)" - # echo $SHORT_NUGET_VERSION - # SHORTER_NUGET_VERSION="$(echo $SHORT_NUGET_VERSION | rev | cut -d"." -f2- | rev)" - # echo $SHORTER_NUGET_VERSION - # TEST_NUGET_VERSION="$(echo $NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')" - # TEST_NUGET_VERSION="$(echo $TEST_NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')" - # echo $TEST_NUGET_VERSION - # echo "TEST_NUGET_VERSION=$TEST_NUGET_VERSION" >> "$GITHUB_OUTPUT" - # name: Set the nuget version - # id: set-nuget-version - - # - run: | - # dotnet nuget push \ - # nhs.notify.suppliers.api.letter.${TEST_NUGET_VERSION}.nupkg \ - # --source github \ - # --api-key $GITHUB_TOKEN - # env: - # TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # ### PUBLISH LIBS data NUGET - # publishlibhostnuget: - # name: "Publish libs data packages to nuget.pkg.github.com" - # runs-on: ubuntu-latest - # needs: [publish] - # permissions: - # packages: write - # contents: read - # steps: - # - name: "Get the artefacts" - # uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - # with: - # path: . - # name: libs-data-${{ inputs.version }} - # - run: | - # ls -la - # find . -name ".version" - # - run: | - # dotnet nuget add source \ - # --username nhs-notify-supplier-api \ - # --password ${{ secrets.GITHUB_TOKEN }} \ - # --store-password-in-clear-text \ - # --name github \ - # "https://nuget.pkg.github.com/NHSDigital/index.json" - # - run: | - # echo "ROOT .version file is: $(cat .version)" - # echo "GH variable version is: ${{ inputs.version }}" - # name: Showing the base versions - - # - run: | - # VERSION=${{ inputs.version }} - # SHORT_VERSION="$(echo $VERSION | rev | cut -d"." -f2- | rev)" - # NUGET_VERSION="$(echo "$VERSION" | tr + .)" - # echo $VERSION - # echo $SHORT_VERSION - # echo $NUGET_VERSION - # SHORT_NUGET_VERSION="$(echo $NUGET_VERSION | rev | cut -d"." -f2- | rev)" - # echo $SHORT_NUGET_VERSION - # SHORTER_NUGET_VERSION="$(echo $SHORT_NUGET_VERSION | rev | cut -d"." -f2- | rev)" - # echo $SHORTER_NUGET_VERSION - # TEST_NUGET_VERSION="$(echo $NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')" - # TEST_NUGET_VERSION="$(echo $TEST_NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')" - # echo $TEST_NUGET_VERSION - # echo "TEST_NUGET_VERSION=$TEST_NUGET_VERSION" >> "$GITHUB_OUTPUT" - # name: Set the nuget version - # id: set-nuget-version - - # - run: | - # dotnet nuget push \ - # nhs.notify.suppliers.api.data.${TEST_NUGET_VERSION}.nupkg \ - # --source github \ - # --api-key $GITHUB_TOKEN - # env: - # TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # ### PUBLISH LIBS host NUGET - # publishlibdatanuget: - # name: "Publish libs host packages to nuget.pkg.github.com" - # runs-on: ubuntu-latest - # needs: [publish] - # permissions: - # packages: write - # contents: read - # steps: - # - name: "Get the artefacts" - # uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - # with: - # path: . - # name: libs-host-${{ inputs.version }} - # - run: | - # ls -la - # find . -name ".version" - # - run: | - # dotnet nuget add source \ - # --username nhs-notify-supplier-api \ - # --password ${{ secrets.GITHUB_TOKEN }} \ - # --store-password-in-clear-text \ - # --name github \ - # "https://nuget.pkg.github.com/NHSDigital/index.json" - # - run: | - # echo "ROOT .version file is: $(cat .version)" - # echo "GH variable version is: ${{ inputs.version }}" - # name: Showing the base versions - - # - run: | - # VERSION=${{ inputs.version }} - # SHORT_VERSION="$(echo $VERSION | rev | cut -d"." -f2- | rev)" - # NUGET_VERSION="$(echo "$VERSION" | tr + .)" - # echo $VERSION - # echo $SHORT_VERSION - # echo $NUGET_VERSION - # SHORT_NUGET_VERSION="$(echo $NUGET_VERSION | rev | cut -d"." -f2- | rev)" - # echo $SHORT_NUGET_VERSION - # SHORTER_NUGET_VERSION="$(echo $SHORT_NUGET_VERSION | rev | cut -d"." -f2- | rev)" - # echo $SHORTER_NUGET_VERSION - # TEST_NUGET_VERSION="$(echo $NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')" - # TEST_NUGET_VERSION="$(echo $TEST_NUGET_VERSION | sed -E 's/.([^.]*)$/\1/')" - # echo $TEST_NUGET_VERSION - # echo "TEST_NUGET_VERSION=$TEST_NUGET_VERSION" >> "$GITHUB_OUTPUT" - # name: Set the nuget version - # id: set-nuget-version - - # - run: | - # dotnet nuget push \ - # nhs.notify.suppliers.api.host.${TEST_NUGET_VERSION}.nupkg \ - # --source github \ - # --api-key $GITHUB_TOKEN - # env: - # TEST_NUGET_VERSION: ${{ steps.set-nuget-version.outputs.TEST_NUGET_VERSION }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # ### PUBLISH LIBS host docker - # publishlibhostdocker: - # name: "Publish libs host docker" - # runs-on: ubuntu-latest - # needs: [publish] - # permissions: - # packages: write - # contents: read - # steps: - # - name: "Get the artefacts" - # uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - # with: - # path: . - # name: libs-host-docker-${{ inputs.version }} - - # - run: | - # ls -Rla - # docker load --input myimage.tar - # docker image ls -a - # echo $CR_PAT | docker login ghcr.io -u nhs-notify-supplier-api --password-stdin - # docker push ghcr.io/nhsdigital/libshostdocker:latest - # env: - # CR_PAT: ${{ secrets.GITHUB_TOKEN }}