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/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/lambda-functions/action.yml b/build/lambda-functions/action.yml index 723d72f0..c5bd0604 100644 --- a/build/lambda-functions/action.yml +++ b/build/lambda-functions/action.yml @@ -20,6 +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: Build AWS Lambda functions with script shell: pwsh run: ${{ github.action_path }}/build-lambda-functions.ps1 ` diff --git a/build/lambda-functions/build-lambda-functions.ps1 b/build/lambda-functions/build-lambda-functions.ps1 index f45a4e8b..4e1fb0bc 100644 --- a/build/lambda-functions/build-lambda-functions.ps1 +++ b/build/lambda-functions/build-lambda-functions.ps1 @@ -29,13 +29,15 @@ Write-Output "Verbosity is: $verbosity" Write-Output '==========' $sw = [Diagnostics.Stopwatch]::StartNew() -$image = "public.ecr.aws/sam/build-dotnet8:latest-x86_64" -$dir = (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" -docker pull $image -q +#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 diff --git a/build/netcore/README.md b/build/netcore/README.md index c535561a..3ba62017 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 # Required to checkout repository + packages: read # Required to fetch NuGet packages steps: - uses: actions/checkout@v4 - name: Build and test projects diff --git a/build/netcore/action.yml b/build/netcore/action.yml index bc620fed..c8ec74e5 100644 --- a/build/netcore/action.yml +++ b/build/netcore/action.yml @@ -27,6 +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: Restore packages shell: pwsh run: dotnet restore ${{ inputs.projectsToBuild }} --verbosity ${{ inputs.VERBOSITY }} 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 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