From bf14c586d5e3c1571600eed3cedf246025756482 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:54:57 +0200 Subject: [PATCH 01/55] Support GitHub Packages as NuGet source feed --- build/lambda-functions/README.md | 3 +++ build/netcore/README.md | 4 ++++ build/netcore/action.yml | 7 +++++++ 3 files changed, 14 insertions(+) diff --git a/build/lambda-functions/README.md b/build/lambda-functions/README.md index 04a2a482..a14db252 100644 --- a/build/lambda-functions/README.md +++ b/build/lambda-functions/README.md @@ -21,6 +21,9 @@ jobs: build: name: Build runs-on: ubuntu-latest + permissions: + contents: read + packages: read steps: - uses: actions/checkout@v4 - name: Build AWS Lambda functions diff --git a/build/netcore/README.md b/build/netcore/README.md index c535561a..0d935b35 100644 --- a/build/netcore/README.md +++ b/build/netcore/README.md @@ -21,6 +21,9 @@ jobs: build: name: Build runs-on: ubuntu-latest + permissions: + contents: read + packages: read steps: - uses: actions/checkout@v4 - name: Build and test projects @@ -38,6 +41,7 @@ jobs: | `projectsToBuild` | The path to the projects to build - can be a .csproj or a .sln file | **true** | | `projectsToTest` | The path to the projects to test - can be a .csproj or a .sln file | **true** | | `dotnetVersion` | The .NET version to use | *false* | `''` | If you don't specify this, you should use your own `actions/setup-dotnet` task before | +| `useGitHubPackages` | Whether to use GitHub Packages | *false* | `true` | Use the GitHub packages from current owner or organization | | `verbosity` | The verbosity of the scripts | *false* | `minimal` | Set to `minimal`, `normal` or `detailed` | ### Outputs diff --git a/build/netcore/action.yml b/build/netcore/action.yml index bc620fed..eead191a 100644 --- a/build/netcore/action.yml +++ b/build/netcore/action.yml @@ -11,6 +11,9 @@ inputs: dotnetVersion: description: The .NET version to use default: '8.0.x' + useGitHubPackages: + description: Whether to use GitHub Packages + default: true verbosity: description: The verbosity of the scripts default: quiet @@ -27,6 +30,10 @@ runs: uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ inputs.dotnetVersion }} + - name: Add GitHub Packages as NuGet feed + if: inputs.useGitHubPackages + shell: pwsh + run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ env.GH_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - name: Restore packages shell: pwsh run: dotnet restore ${{ inputs.projectsToBuild }} --verbosity ${{ inputs.VERBOSITY }} From 648f9c3d19a1a3fbefae3e24adf1b20c45949fae Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:12:54 +0200 Subject: [PATCH 02/55] Test --- build/netcore/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/netcore/action.yml b/build/netcore/action.yml index eead191a..85a876ba 100644 --- a/build/netcore/action.yml +++ b/build/netcore/action.yml @@ -33,7 +33,7 @@ runs: - name: Add GitHub Packages as NuGet feed if: inputs.useGitHubPackages shell: pwsh - run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ env.GH_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - name: Restore packages shell: pwsh run: dotnet restore ${{ inputs.projectsToBuild }} --verbosity ${{ inputs.VERBOSITY }} From 872a071c846fa407bc6268078cfe3ac1f3bce9e8 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:25:38 +0200 Subject: [PATCH 03/55] Minor improvements --- build/netcore/README.md | 5 ++--- build/netcore/action.yml | 7 +++---- release/nuget/README.md | 3 ++- release/nuget/action.yml | 10 +++++++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/build/netcore/README.md b/build/netcore/README.md index 0d935b35..3ba62017 100644 --- a/build/netcore/README.md +++ b/build/netcore/README.md @@ -22,8 +22,8 @@ jobs: name: Build runs-on: ubuntu-latest permissions: - contents: read - packages: read + contents: read # Required to checkout repository + packages: read # Required to fetch NuGet packages steps: - uses: actions/checkout@v4 - name: Build and test projects @@ -41,7 +41,6 @@ jobs: | `projectsToBuild` | The path to the projects to build - can be a .csproj or a .sln file | **true** | | `projectsToTest` | The path to the projects to test - can be a .csproj or a .sln file | **true** | | `dotnetVersion` | The .NET version to use | *false* | `''` | If you don't specify this, you should use your own `actions/setup-dotnet` task before | -| `useGitHubPackages` | Whether to use GitHub Packages | *false* | `true` | Use the GitHub packages from current owner or organization | | `verbosity` | The verbosity of the scripts | *false* | `minimal` | Set to `minimal`, `normal` or `detailed` | ### Outputs diff --git a/build/netcore/action.yml b/build/netcore/action.yml index 85a876ba..c8ec74e5 100644 --- a/build/netcore/action.yml +++ b/build/netcore/action.yml @@ -11,9 +11,6 @@ inputs: dotnetVersion: description: The .NET version to use default: '8.0.x' - useGitHubPackages: - description: Whether to use GitHub Packages - default: true verbosity: description: The verbosity of the scripts default: quiet @@ -31,9 +28,11 @@ runs: with: dotnet-version: ${{ inputs.dotnetVersion }} - name: Add GitHub Packages as NuGet feed - if: inputs.useGitHubPackages shell: pwsh run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Restore packages shell: pwsh run: dotnet restore ${{ inputs.projectsToBuild }} --verbosity ${{ inputs.VERBOSITY }} diff --git a/release/nuget/README.md b/release/nuget/README.md index 970f9f05..dc9b72c2 100644 --- a/release/nuget/README.md +++ b/release/nuget/README.md @@ -23,7 +23,8 @@ jobs: env: GH_TOKEN: ${{ github.token }} permissions: - contents: write + contents: write # Required to checkout repository and create release + packages: write # Required to fetch and push NuGet packages steps: - uses: actions/checkout@v4 - name: Deploy libraries diff --git a/release/nuget/action.yml b/release/nuget/action.yml index fe894776..7c7e4967 100644 --- a/release/nuget/action.yml +++ b/release/nuget/action.yml @@ -48,6 +48,12 @@ runs: uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ inputs.dotnetVersion }} + - name: Add GitHub Packages as NuGet feed + shell: pwsh + run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Restore packages shell: pwsh run: dotnet restore ${{ inputs.projectsToBuild }} --verbosity ${{ inputs.VERBOSITY }} @@ -85,9 +91,7 @@ runs: - name: Publish packages to GitHub Packages if: inputs.destination == 'githubpackages' shell: pwsh - run: | - dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ env.GH_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - dotnet nuget push ./build/*.nupkg --source github + run: dotnet nuget push ./build/*.nupkg --source github env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true From e58f4734b590344aca342ece9cced3a8ff428110 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:17:34 +0200 Subject: [PATCH 04/55] Test --- build/lambda-functions/action.yml | 5 +++++ build/lambda-functions/build-lambda-functions.ps1 | 1 + 2 files changed, 6 insertions(+) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 723d72f0..6fb81677 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -20,12 +20,17 @@ inputs: runs: using: composite steps: + - name: Add GitHub Packages as NuGet feed + shell: pwsh + run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - name: Build AWS Lambda functions with script shell: pwsh run: ${{ github.action_path }}/build-lambda-functions.ps1 ` -solutionPath "${{ inputs.solutionPath }}" ` -publishPathFilter "${{ inputs.publishPathFilter }}" ` -verbosity ${{ inputs.verbosity }} + env: + GH_TOKEN: ${{ github.token }} - name: Upload artifact (compressed) uses: actions/upload-artifact@v4 with: diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index f45a4e8b..3068463f 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -25,6 +25,7 @@ Param( Write-Output "Solution path is: $solutionPath" Write-Output "Publish path filter is: $publishPathFilter" Write-Output "Verbosity is: $verbosity" +Write-Output "Token is: $($env:GH_TOKEN)" Write-Output '==========' From 61caabc31594375c33a7aa82d630c87e21d6c7a7 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:45:22 +0200 Subject: [PATCH 05/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 3068463f..67b21aff 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -22,10 +22,14 @@ Param( [string]$verbosity ) +$repositoryOwner = $env:GITHUB_REPOSITORY_OWNER +$githubToken = $env:GH_TOKEN + Write-Output "Solution path is: $solutionPath" Write-Output "Publish path filter is: $publishPathFilter" Write-Output "Verbosity is: $verbosity" -Write-Output "Token is: $($env:GH_TOKEN)" +Write-Output "Token length is: $($githubToken.length)" +Write-Output "Repository owner is: $repositoryOwner" Write-Output '==========' @@ -36,7 +40,11 @@ $dir = (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image dotnet publish "$solutionPath" -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd + +$commandAddSource = "dotnet nuget add source --username $repositoryOwner --password ""$githubToken"" --store-password-in-clear-text --name github ""https://nuget.pkg.github.com/$repositoryOwner/index.json""" +$commandPublish = "dotnet publish ""$solutionPath"" -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" + +docker run --rm -v "$($dir):/src" -w /src $image "$commandAddSource && $commandPublish" if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From d46bc95792698656239808c95c258da99992e9d0 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:49:00 +0200 Subject: [PATCH 06/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 67b21aff..7c0831d7 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,8 +41,8 @@ Write-Output "Pull Docker image, used to build functions" docker pull $image -q -$commandAddSource = "dotnet nuget add source --username $repositoryOwner --password ""$githubToken"" --store-password-in-clear-text --name github ""https://nuget.pkg.github.com/$repositoryOwner/index.json""" -$commandPublish = "dotnet publish ""$solutionPath"" -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" +$commandAddSource = "dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" +$commandPublish = "dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" docker run --rm -v "$($dir):/src" -w /src $image "$commandAddSource && $commandPublish" if (!$?) { From 38353e8db6ca70de10c06d50523ce28930e80ea5 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:51:35 +0200 Subject: [PATCH 07/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 7c0831d7..c4751bd6 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -44,7 +44,7 @@ docker pull $image -q $commandAddSource = "dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" $commandPublish = "dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" -docker run --rm -v "$($dir):/src" -w /src $image "$commandAddSource && $commandPublish" +docker run --rm -v "$($dir):/src" -w /src $image $commandAddSource && $commandPublish if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 4bd46e146d2f7b305e143e633aa3c4c649f3a42d Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:17:38 +0200 Subject: [PATCH 08/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index c4751bd6..10b5315f 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,7 +41,7 @@ Write-Output "Pull Docker image, used to build functions" docker pull $image -q -$commandAddSource = "dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" +$commandAddSource = "dotnet new nugetconfig && dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" $commandPublish = "dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" docker run --rm -v "$($dir):/src" -w /src $image $commandAddSource && $commandPublish From da1da1469abf04b477186fdd17963dd2452f5ae6 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:22:05 +0200 Subject: [PATCH 09/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 10b5315f..ca6d76c6 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -40,11 +40,11 @@ $dir = (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q - -$commandAddSource = "dotnet new nugetconfig && dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" +$commandNewNuget = "dotnet new nugetconfig" +$commandAddSource = " dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" $commandPublish = "dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" -docker run --rm -v "$($dir):/src" -w /src $image $commandAddSource && $commandPublish +docker run --rm -v "$($dir):/src" -w /src $image $commandNewNuget && $commandAddSource && $commandPublish if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From c674e09cf540d51da056a0983b8e5caaa15d60bc Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:26:01 +0200 Subject: [PATCH 10/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index ca6d76c6..2d73cb08 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -44,7 +44,7 @@ $commandNewNuget = "dotnet new nugetconfig" $commandAddSource = " dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" $commandPublish = "dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" -docker run --rm -v "$($dir):/src" -w /src $image $commandNewNuget && $commandAddSource && $commandPublish +docker run --rm -v "$($dir):/src" -w /src $image $commandNewNuget if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 5096aff7fbadf801301fc4d8ddfb3e1835720ef4 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:31:23 +0200 Subject: [PATCH 11/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 2d73cb08..07ebddc3 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,10 +41,10 @@ Write-Output "Pull Docker image, used to build functions" docker pull $image -q $commandNewNuget = "dotnet new nugetconfig" -$commandAddSource = " dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" +$commandAddSource = "dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" $commandPublish = "dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" -docker run --rm -v "$($dir):/src" -w /src $image $commandNewNuget +docker run --rm -v "$($dir):/src" -w /src $image dotnet new nugetconfig if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 708e4c9f6ac29f0663c979d05b49fcd3b94d1add Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:54:44 +0200 Subject: [PATCH 12/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 07ebddc3..497ca6b9 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -44,7 +44,7 @@ $commandNewNuget = "dotnet new nugetconfig" $commandAddSource = "dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" $commandPublish = "dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" -docker run --rm -v "$($dir):/src" -w /src $image dotnet new nugetconfig +docker run --rm -v "$($dir):/src" -w /src $image dotnet new nugetconfig && dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 37fffdf1329b31a14476123c97525be9fa86391d Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:58:52 +0200 Subject: [PATCH 13/55] Fix --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 497ca6b9..e9badad8 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -44,7 +44,7 @@ $commandNewNuget = "dotnet new nugetconfig" $commandAddSource = "dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" $commandPublish = "dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" -docker run --rm -v "$($dir):/src" -w /src $image dotnet new nugetconfig && dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" +docker run --rm -v "$($dir):/src" -w /src $image dotnet new nugetconfig ; dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 8eda4623ad3f3ef29d48b8a9512fef28fa1ea7c1 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 14:07:10 +0200 Subject: [PATCH 14/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index e9badad8..24f12b2c 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,10 +41,10 @@ Write-Output "Pull Docker image, used to build functions" docker pull $image -q $commandNewNuget = "dotnet new nugetconfig" -$commandAddSource = "dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json" +$commandAddSource = "dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config" $commandPublish = "dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" -docker run --rm -v "$($dir):/src" -w /src $image dotnet new nugetconfig ; dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json +docker run --rm -v "$($dir):/src" -w /src $image $commandNewNuget ; $commandAddSource ; $commandPublish if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 7585ec38804e3078dcb6e004a10969399a59dc41 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 14:10:12 +0200 Subject: [PATCH 15/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 24f12b2c..e06bf112 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -40,11 +40,10 @@ $dir = (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -$commandNewNuget = "dotnet new nugetconfig" -$commandAddSource = "dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config" -$commandPublish = "dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd" - -docker run --rm -v "$($dir):/src" -w /src $image $commandNewNuget ; $commandAddSource ; $commandPublish +docker run --rm -v "$($dir):/src" -w /src $image \ + dotnet new nugetconfig ; \ + dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; \ + dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 7935c73f65279a4ee0f93a7669625d850685350b Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 14:52:38 +0200 Subject: [PATCH 16/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index e06bf112..ae6289d4 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -40,9 +40,9 @@ $dir = (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image \ - dotnet new nugetconfig ; \ - dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; \ +docker run --rm -v "$($dir):/src" -w /src $image ` + dotnet new nugetconfig ; ` + dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" From bb5e293ece7390507e5b59d2c576c5a07693c0f9 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:07:45 +0200 Subject: [PATCH 17/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index ae6289d4..0057b589 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -42,6 +42,7 @@ docker pull $image -q docker run --rm -v "$($dir):/src" -w /src $image ` dotnet new nugetconfig ; ` + dir ; ` dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { From f0c460672a8c254c97183d9815f7b847fb4940e5 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:45:22 +0200 Subject: [PATCH 18/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 0057b589..d60d9251 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -35,13 +35,13 @@ Write-Output '==========' $sw = [Diagnostics.Stopwatch]::StartNew() $image = "public.ecr.aws/sam/build-dotnet8:latest-x86_64" -$dir = (Get-Location).Path +$solutionDir = [System.IO.Path]::GetDirectoryName($solutionPath) +$dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q docker run --rm -v "$($dir):/src" -w /src $image ` - dotnet new nugetconfig ; ` dir ; ` dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd From b79a6792f1569d48ad6d43042d93f10c19ee776e Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:04:40 +0200 Subject: [PATCH 19/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 2 -- build/netcore/action.yml | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index d60d9251..2d3c3f0f 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -42,8 +42,6 @@ Write-Output "Pull Docker image, used to build functions" docker pull $image -q docker run --rm -v "$($dir):/src" -w /src $image ` - dir ; ` - dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" diff --git a/build/netcore/action.yml b/build/netcore/action.yml index c8ec74e5..c11176d9 100644 --- a/build/netcore/action.yml +++ b/build/netcore/action.yml @@ -27,12 +27,12 @@ runs: uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ inputs.dotnetVersion }} - - name: Add GitHub Packages as NuGet feed - shell: pwsh - run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - env: - DOTNET_NOLOGO: true - DOTNET_CLI_TELEMETRY_OPTOUT: true + #- name: Add GitHub Packages as NuGet feed + # shell: pwsh + # run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/$#{{ github.repository_owner }}/index.json" + # env: + # DOTNET_NOLOGO: true + # DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Restore packages shell: pwsh run: dotnet restore ${{ inputs.projectsToBuild }} --verbosity ${{ inputs.VERBOSITY }} From 8c0ad4a05125e3bc1866f209f20fb057b5a88ef1 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:10:08 +0200 Subject: [PATCH 20/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 2d3c3f0f..99112455 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,8 +41,7 @@ $dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image ` - dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 9b5fd92393dd41812a06731db88a7c0537c4f79a Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:11:46 +0200 Subject: [PATCH 21/55] Test --- build/netcore/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/netcore/action.yml b/build/netcore/action.yml index c11176d9..c8ec74e5 100644 --- a/build/netcore/action.yml +++ b/build/netcore/action.yml @@ -27,12 +27,12 @@ runs: uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ inputs.dotnetVersion }} - #- name: Add GitHub Packages as NuGet feed - # shell: pwsh - # run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/$#{{ github.repository_owner }}/index.json" - # env: - # DOTNET_NOLOGO: true - # DOTNET_CLI_TELEMETRY_OPTOUT: true + - name: Add GitHub Packages as NuGet feed + shell: pwsh + run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Restore packages shell: pwsh run: dotnet restore ${{ inputs.projectsToBuild }} --verbosity ${{ inputs.VERBOSITY }} From 34ccd97dfde4d24bf868cd3005d6a50629525635 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:16:24 +0200 Subject: [PATCH 22/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 99112455..132035f3 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -36,12 +36,13 @@ Write-Output '==========' $sw = [Diagnostics.Stopwatch]::StartNew() $image = "public.ecr.aws/sam/build-dotnet8:latest-x86_64" $solutionDir = [System.IO.Path]::GetDirectoryName($solutionPath) +$solutionFileName = [System.IO.Path]::GetFileName($solutionPath) $dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionFileName -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 918ff1a385d672a7170b0065bb6be491ee3394ce Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:21:09 +0200 Subject: [PATCH 23/55] TestTest --- build/lambda-functions/build-lambda-functions.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 132035f3..f429194e 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -39,10 +39,16 @@ $solutionDir = [System.IO.Path]::GetDirectoryName($solutionPath) $solutionFileName = [System.IO.Path]::GetFileName($solutionPath) $dir = $solutionDir # (Get-Location).Path +Write-Output "Old dir: $((Get-Location).Path)" +Write-Output "New dir: $dir" + + Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionFileName -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image ` + dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` + dotnet publish $solutionFileName -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 592a2762befab5d51c5a56125e4fe2ba519057f3 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:28:11 +0200 Subject: [PATCH 24/55] Revert "TestTest" This reverts commit 918ff1a385d672a7170b0065bb6be491ee3394ce. --- build/lambda-functions/build-lambda-functions.ps1 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index f429194e..132035f3 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -39,16 +39,10 @@ $solutionDir = [System.IO.Path]::GetDirectoryName($solutionPath) $solutionFileName = [System.IO.Path]::GetFileName($solutionPath) $dir = $solutionDir # (Get-Location).Path -Write-Output "Old dir: $((Get-Location).Path)" -Write-Output "New dir: $dir" - - Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image ` - dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` - dotnet publish $solutionFileName -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionFileName -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From c560803fdd1ed9c183ee34f1953291bf05cceca3 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:28:14 +0200 Subject: [PATCH 25/55] Revert "Test" This reverts commit 34ccd97dfde4d24bf868cd3005d6a50629525635. --- build/lambda-functions/build-lambda-functions.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 132035f3..99112455 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -36,13 +36,12 @@ Write-Output '==========' $sw = [Diagnostics.Stopwatch]::StartNew() $image = "public.ecr.aws/sam/build-dotnet8:latest-x86_64" $solutionDir = [System.IO.Path]::GetDirectoryName($solutionPath) -$solutionFileName = [System.IO.Path]::GetFileName($solutionPath) $dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionFileName -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 56f41109d9d4597a7267f408d20e0418b6084b11 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:28:18 +0200 Subject: [PATCH 26/55] Revert "Test" This reverts commit 9b5fd92393dd41812a06731db88a7c0537c4f79a. --- build/netcore/action.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/netcore/action.yml b/build/netcore/action.yml index c8ec74e5..c11176d9 100644 --- a/build/netcore/action.yml +++ b/build/netcore/action.yml @@ -27,12 +27,12 @@ runs: uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ inputs.dotnetVersion }} - - name: Add GitHub Packages as NuGet feed - shell: pwsh - run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - env: - DOTNET_NOLOGO: true - DOTNET_CLI_TELEMETRY_OPTOUT: true + #- name: Add GitHub Packages as NuGet feed + # shell: pwsh + # run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/$#{{ github.repository_owner }}/index.json" + # env: + # DOTNET_NOLOGO: true + # DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Restore packages shell: pwsh run: dotnet restore ${{ inputs.projectsToBuild }} --verbosity ${{ inputs.VERBOSITY }} From 14056c434030b0bb27c823f9387fd63cb1be7f44 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:28:21 +0200 Subject: [PATCH 27/55] Revert "Test" This reverts commit 8c0ad4a05125e3bc1866f209f20fb057b5a88ef1. --- build/lambda-functions/build-lambda-functions.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 99112455..2d3c3f0f 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,7 +41,8 @@ $dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image ` + dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 15e28f93ed1b2a64051f1cebb23100f1d3e2fc39 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:28:24 +0200 Subject: [PATCH 28/55] Revert "Test" This reverts commit b79a6792f1569d48ad6d43042d93f10c19ee776e. --- build/lambda-functions/build-lambda-functions.ps1 | 2 ++ build/netcore/action.yml | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 2d3c3f0f..d60d9251 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -42,6 +42,8 @@ Write-Output "Pull Docker image, used to build functions" docker pull $image -q docker run --rm -v "$($dir):/src" -w /src $image ` + dir ; ` + dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" diff --git a/build/netcore/action.yml b/build/netcore/action.yml index c11176d9..c8ec74e5 100644 --- a/build/netcore/action.yml +++ b/build/netcore/action.yml @@ -27,12 +27,12 @@ runs: uses: actions/setup-dotnet@v4 with: dotnet-version: ${{ inputs.dotnetVersion }} - #- name: Add GitHub Packages as NuGet feed - # shell: pwsh - # run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/$#{{ github.repository_owner }}/index.json" - # env: - # DOTNET_NOLOGO: true - # DOTNET_CLI_TELEMETRY_OPTOUT: true + - name: Add GitHub Packages as NuGet feed + shell: pwsh + run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Restore packages shell: pwsh run: dotnet restore ${{ inputs.projectsToBuild }} --verbosity ${{ inputs.VERBOSITY }} From 3705e32a97c9954cbe3927f82761d182b2782688 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:58:54 +0200 Subject: [PATCH 29/55] Test --- build/lambda-functions/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 6fb81677..fc3c53e3 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -20,9 +20,9 @@ inputs: runs: using: composite steps: - - name: Add GitHub Packages as NuGet feed - shell: pwsh - run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + #- name: Add GitHub Packages as NuGet feed + # shell: pwsh + # run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - name: Build AWS Lambda functions with script shell: pwsh run: ${{ github.action_path }}/build-lambda-functions.ps1 ` From 009488205e536f57121caa926f69289414c64c92 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:24:18 +0200 Subject: [PATCH 30/55] Back --- build/lambda-functions/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index fc3c53e3..6fb81677 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -20,9 +20,9 @@ inputs: runs: using: composite steps: - #- name: Add GitHub Packages as NuGet feed - # shell: pwsh - # run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + - name: Add GitHub Packages as NuGet feed + shell: pwsh + run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - name: Build AWS Lambda functions with script shell: pwsh run: ${{ github.action_path }}/build-lambda-functions.ps1 ` From dde2a4d0216a5c04801ddb42504441f860e9b89d Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:29:45 +0200 Subject: [PATCH 31/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index d60d9251..99112455 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,10 +41,7 @@ $dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image ` - dir ; ` - dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` - dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 9dcfe76350789df7c122cc4b1577101a091200ab Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:33:03 +0200 Subject: [PATCH 32/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 99112455..c1245b6d 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -35,8 +35,7 @@ Write-Output '==========' $sw = [Diagnostics.Stopwatch]::StartNew() $image = "public.ecr.aws/sam/build-dotnet8:latest-x86_64" -$solutionDir = [System.IO.Path]::GetDirectoryName($solutionPath) -$dir = $solutionDir # (Get-Location).Path +$dir = (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q From 9b775a7007850bacbbb928a2d37e2adb7229daf7 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:34:19 +0200 Subject: [PATCH 33/55] Restore before running docker --- build/lambda-functions/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 6fb81677..355d8a90 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -23,6 +23,12 @@ runs: - name: Add GitHub Packages as NuGet feed shell: pwsh run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" + - name: Restore packages + shell: pwsh + run: dotnet restore ${{ inputs.solutionPath }} --verbosity ${{ inputs.VERBOSITY }} + env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Build AWS Lambda functions with script shell: pwsh run: ${{ github.action_path }}/build-lambda-functions.ps1 ` From e2138ce6765c0825f7c678ac70b49d1e7970c796 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:36:37 +0200 Subject: [PATCH 34/55] Don't restore with Docker --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index c1245b6d..9923d296 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -40,7 +40,7 @@ $dir = (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true --no-restore -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 81f5ed5a1d50e6b5c09ea42bce0bfb5845372721 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:42:23 +0200 Subject: [PATCH 35/55] Test --- build/lambda-functions/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 355d8a90..6a3e6bab 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -25,7 +25,7 @@ runs: run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - name: Restore packages shell: pwsh - run: dotnet restore ${{ inputs.solutionPath }} --verbosity ${{ inputs.VERBOSITY }} + run: dotnet restore ${{ inputs.solutionPath }} --runtime linux-x64 --verbosity ${{ inputs.VERBOSITY }} env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true From 82436cba01e025ab48f043cc06f021d4f14812bd Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:46:14 +0200 Subject: [PATCH 36/55] Build a first time without Docker --- build/lambda-functions/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 6a3e6bab..ac25bfc0 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -29,6 +29,12 @@ runs: env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true + - name: Build application + shell: pwsh + run: dotnet build ${{ inputs.solutionPath }} --configuration Release --no-restore --runtime linux-x64 --verbosity ${{ inputs.VERBOSITY }} + env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Build AWS Lambda functions with script shell: pwsh run: ${{ github.action_path }}/build-lambda-functions.ps1 ` From b742d7e454b7bdba4ed974e47fbee33b7e0bdf08 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:50:59 +0200 Subject: [PATCH 37/55] Test --- build/lambda-functions/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index ac25bfc0..1af26ff4 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -20,6 +20,9 @@ inputs: runs: using: composite steps: + - name: Get .NET version + shell: pwsh + run: dotnet --version - name: Add GitHub Packages as NuGet feed shell: pwsh run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" From eb5c8f4a66d40871c0f3ee639150ce70e7ebb5d9 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:52:18 +0200 Subject: [PATCH 38/55] Test --- build/lambda-functions/action.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 1af26ff4..f03530b4 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -20,9 +20,7 @@ inputs: runs: using: composite steps: - - name: Get .NET version - shell: pwsh - run: dotnet --version + # @todo Install .NET - name: Add GitHub Packages as NuGet feed shell: pwsh run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" @@ -34,7 +32,7 @@ runs: DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Build application shell: pwsh - run: dotnet build ${{ inputs.solutionPath }} --configuration Release --no-restore --runtime linux-x64 --verbosity ${{ inputs.VERBOSITY }} + run: dotnet build ${{ inputs.solutionPath }} --configuration Release --no-restore --verbosity ${{ inputs.VERBOSITY }} env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true From 229b1a085e4c079d22c507c5f192f6bf16e8bfb0 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:55:06 +0200 Subject: [PATCH 39/55] Revert "Test" This reverts commit eb5c8f4a66d40871c0f3ee639150ce70e7ebb5d9. --- build/lambda-functions/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index f03530b4..1af26ff4 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -20,7 +20,9 @@ inputs: runs: using: composite steps: - # @todo Install .NET + - name: Get .NET version + shell: pwsh + run: dotnet --version - name: Add GitHub Packages as NuGet feed shell: pwsh run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" @@ -32,7 +34,7 @@ runs: DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Build application shell: pwsh - run: dotnet build ${{ inputs.solutionPath }} --configuration Release --no-restore --verbosity ${{ inputs.VERBOSITY }} + run: dotnet build ${{ inputs.solutionPath }} --configuration Release --no-restore --runtime linux-x64 --verbosity ${{ inputs.VERBOSITY }} env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true From 9dbc67ee769934b51d0881b1ce4927d043a0c999 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:55:10 +0200 Subject: [PATCH 40/55] Revert "Test" This reverts commit b742d7e454b7bdba4ed974e47fbee33b7e0bdf08. --- build/lambda-functions/action.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 1af26ff4..ac25bfc0 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -20,9 +20,6 @@ inputs: runs: using: composite steps: - - name: Get .NET version - shell: pwsh - run: dotnet --version - name: Add GitHub Packages as NuGet feed shell: pwsh run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" From d4b9fe6244ad8dcfe5e66dfe3d729f5d5a7d218c Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:55:12 +0200 Subject: [PATCH 41/55] Revert "Build a first time without Docker" This reverts commit 82436cba01e025ab48f043cc06f021d4f14812bd. --- build/lambda-functions/action.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index ac25bfc0..6a3e6bab 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -29,12 +29,6 @@ runs: env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true - - name: Build application - shell: pwsh - run: dotnet build ${{ inputs.solutionPath }} --configuration Release --no-restore --runtime linux-x64 --verbosity ${{ inputs.VERBOSITY }} - env: - DOTNET_NOLOGO: true - DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Build AWS Lambda functions with script shell: pwsh run: ${{ github.action_path }}/build-lambda-functions.ps1 ` From 530361d6643fe1f8c604cd27b9273f89c4dcacc4 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:55:15 +0200 Subject: [PATCH 42/55] Revert "Test" This reverts commit 81f5ed5a1d50e6b5c09ea42bce0bfb5845372721. --- build/lambda-functions/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 6a3e6bab..355d8a90 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -25,7 +25,7 @@ runs: run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - name: Restore packages shell: pwsh - run: dotnet restore ${{ inputs.solutionPath }} --runtime linux-x64 --verbosity ${{ inputs.VERBOSITY }} + run: dotnet restore ${{ inputs.solutionPath }} --verbosity ${{ inputs.VERBOSITY }} env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true From 154f6d9d4c52a81ee717bd4c42c5236e6f0cdbd9 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:55:17 +0200 Subject: [PATCH 43/55] Revert "Don't restore with Docker" This reverts commit e2138ce6765c0825f7c678ac70b49d1e7970c796. --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 9923d296..c1245b6d 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -40,7 +40,7 @@ $dir = (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true --no-restore -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From f769c6f218552110274a4eb7f68e679cdfaed7c2 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:55:19 +0200 Subject: [PATCH 44/55] Revert "Restore before running docker" This reverts commit 9b775a7007850bacbbb928a2d37e2adb7229daf7. --- build/lambda-functions/action.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 355d8a90..6fb81677 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -23,12 +23,6 @@ runs: - name: Add GitHub Packages as NuGet feed shell: pwsh run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ github.token }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" - - name: Restore packages - shell: pwsh - run: dotnet restore ${{ inputs.solutionPath }} --verbosity ${{ inputs.VERBOSITY }} - env: - DOTNET_NOLOGO: true - DOTNET_CLI_TELEMETRY_OPTOUT: true - name: Build AWS Lambda functions with script shell: pwsh run: ${{ github.action_path }}/build-lambda-functions.ps1 ` From b486f8afee6130520674dfdd7b7b61d776f4f25c Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:55:22 +0200 Subject: [PATCH 45/55] Revert "Test" This reverts commit 9dcfe76350789df7c122cc4b1577101a091200ab. --- build/lambda-functions/build-lambda-functions.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index c1245b6d..99112455 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -35,7 +35,8 @@ Write-Output '==========' $sw = [Diagnostics.Stopwatch]::StartNew() $image = "public.ecr.aws/sam/build-dotnet8:latest-x86_64" -$dir = (Get-Location).Path +$solutionDir = [System.IO.Path]::GetDirectoryName($solutionPath) +$dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q From 8ac217174892938fe919cf50240e91411aea27e0 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:55:25 +0200 Subject: [PATCH 46/55] Revert "Test" This reverts commit dde2a4d0216a5c04801ddb42504441f860e9b89d. --- build/lambda-functions/build-lambda-functions.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 99112455..d60d9251 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,7 +41,10 @@ $dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image ` + dir ; ` + dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` + dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 615a851e6b2d3133c737d0f5afec0f9e2436f59d Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 17:55:46 +0200 Subject: [PATCH 47/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index d60d9251..e75509ae 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -42,7 +42,6 @@ Write-Output "Pull Docker image, used to build functions" docker pull $image -q docker run --rm -v "$($dir):/src" -w /src $image ` - dir ; ` dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { From 5fe109824cd8e1a2028f47e1faed8728095d55c5 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:05:37 +0200 Subject: [PATCH 48/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index e75509ae..93791920 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -42,7 +42,7 @@ Write-Output "Pull Docker image, used to build functions" docker pull $image -q docker run --rm -v "$($dir):/src" -w /src $image ` - dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json --configfile nuget.config ; ` + dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json ; ` dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" From 8cc985223f3614f1da2ae5c78d795780fdc687a3 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:09:11 +0200 Subject: [PATCH 49/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 93791920..02837841 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -42,7 +42,7 @@ Write-Output "Pull Docker image, used to build functions" docker pull $image -q docker run --rm -v "$($dir):/src" -w /src $image ` - dotnet nuget add source --username $repositoryOwner --password $githubToken --store-password-in-clear-text --name github https://nuget.pkg.github.com/$repositoryOwner/index.json ; ` + ; ` dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" From 8a92c9cab65add15eae8da3f7e622977144368d4 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:10:57 +0200 Subject: [PATCH 50/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 02837841..99112455 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,9 +41,7 @@ $dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image ` - ; ` - dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 99f35e0494464327e95d888570c2ae0068a6104f Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:12:42 +0200 Subject: [PATCH 51/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 99112455..48a799ee 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,7 +41,7 @@ $dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image dotnet publish "$solutionPath" -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 3f81d954aba8c7e12a60a8abf64efde86e5e4754 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:14:47 +0200 Subject: [PATCH 52/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index 48a799ee..ac075180 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -41,7 +41,7 @@ $dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image dotnet publish "$solutionPath" -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +docker run --rm -v "$($dir):/src" -w /src $image ; dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From 3be26be38e04fd96bea43cd218caed82ba477ed4 Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:32:23 +0200 Subject: [PATCH 53/55] Test --- build/lambda-functions/build-lambda-functions.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index ac075180..d1b37f46 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -39,9 +39,10 @@ $solutionDir = [System.IO.Path]::GetDirectoryName($solutionPath) $dir = $solutionDir # (Get-Location).Path Write-Output "Pull Docker image, used to build functions" -docker pull $image -q +#docker pull $image -q -docker run --rm -v "$($dir):/src" -w /src $image ; dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd +#docker run --rm -v "$($dir):/src" -w /src $image ; +dotnet publish $solutionPath -c Release -r linux-x64 --sc true -p:BuildSource=AwsCmd if (!$?) { Write-Output "::error title=Build failed::Build failed" throw 1 From ba41bb1b71c54b561ad2738a187fe3143685c91a Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:46:31 +0200 Subject: [PATCH 54/55] Comment unnecessary commands --- build/lambda-functions/action.yml | 4 ++-- build/lambda-functions/build-lambda-functions.ps1 | 13 ++++--------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 6fb81677..151377f7 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -29,8 +29,8 @@ runs: -solutionPath "${{ inputs.solutionPath }}" ` -publishPathFilter "${{ inputs.publishPathFilter }}" ` -verbosity ${{ inputs.verbosity }} - env: - GH_TOKEN: ${{ github.token }} + #env: # @todo Clean that + # GH_TOKEN: ${{ github.token }} - name: Upload artifact (compressed) uses: actions/upload-artifact@v4 with: diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index d1b37f46..4e1fb0bc 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -22,23 +22,18 @@ Param( [string]$verbosity ) -$repositoryOwner = $env:GITHUB_REPOSITORY_OWNER -$githubToken = $env:GH_TOKEN - Write-Output "Solution path is: $solutionPath" Write-Output "Publish path filter is: $publishPathFilter" Write-Output "Verbosity is: $verbosity" -Write-Output "Token length is: $($githubToken.length)" -Write-Output "Repository owner is: $repositoryOwner" Write-Output '==========' $sw = [Diagnostics.Stopwatch]::StartNew() -$image = "public.ecr.aws/sam/build-dotnet8:latest-x86_64" -$solutionDir = [System.IO.Path]::GetDirectoryName($solutionPath) -$dir = $solutionDir # (Get-Location).Path +#$image = "public.ecr.aws/sam/build-dotnet8:latest-x86_64" @todo Clean that +#$solutionDir = [System.IO.Path]::GetDirectoryName($solutionPath) +#$dir = $solutionDir # (Get-Location).Path -Write-Output "Pull Docker image, used to build functions" +#Write-Output "Pull Docker image, used to build functions" #docker pull $image -q #docker run --rm -v "$($dir):/src" -w /src $image ; From dc43be3c993b3a91f3fb1d01e8b5367bdc5aa60a Mon Sep 17 00:00:00 2001 From: Antoine Milochau <48644548+amilochau@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:49:00 +0200 Subject: [PATCH 55/55] Minor improvements --- .github/workflows/release.yml | 2 -- build/lambda-functions/action.yml | 2 -- clean/artifacts/action.yml | 4 +--- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ef8bf03..9212921d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,8 +25,6 @@ jobs: name: Create Release runs-on: ubuntu-latest environment: RELEASE - env: - GH_TOKEN: ${{ github.token }} permissions: contents: write steps: diff --git a/build/lambda-functions/action.yml b/build/lambda-functions/action.yml index 151377f7..c5bd0604 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -29,8 +29,6 @@ runs: -solutionPath "${{ inputs.solutionPath }}" ` -publishPathFilter "${{ inputs.publishPathFilter }}" ` -verbosity ${{ inputs.verbosity }} - #env: # @todo Clean that - # GH_TOKEN: ${{ github.token }} - name: Upload artifact (compressed) uses: actions/upload-artifact@v4 with: diff --git a/clean/artifacts/action.yml b/clean/artifacts/action.yml index cadf13e7..885fc40c 100644 --- a/clean/artifacts/action.yml +++ b/clean/artifacts/action.yml @@ -21,6 +21,4 @@ runs: shell: pwsh run: ${{ github.action_path }}/clean-artifacts.ps1 ` -runId ${{ inputs.runId }} ` - -verbosity ${{ inputs.verbosity }} - env: - GH_TOKEN: ${{ github.token }} \ No newline at end of file + -verbosity ${{ inputs.verbosity }} \ No newline at end of file