diff --git a/.github/workflows/reusable-dotnet-quality.yml b/.github/workflows/reusable-dotnet-quality.yml index c3548f5..e994229 100644 --- a/.github/workflows/reusable-dotnet-quality.yml +++ b/.github/workflows/reusable-dotnet-quality.yml @@ -171,5 +171,7 @@ jobs: ./**/Summary.txt ./**/fossa.html env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_NOLOGO: 1 # https://docs.github.com/en/actions/reference/workflows-and-actions/contexts GITHUB_TOKEN: ${{ github.token }} diff --git a/actions/dotnet/build-test-sonar/action.yml b/actions/dotnet/build-test-sonar/action.yml index 5806512..04b4b76 100644 --- a/actions/dotnet/build-test-sonar/action.yml +++ b/actions/dotnet/build-test-sonar/action.yml @@ -78,6 +78,9 @@ runs: - name: Build .NET solution run: dotnet build --no-restore --configuration Debug shell: bash + env: + BUILD_SOURCEBRANCHNAME: ${{ github.ref_name }} + BUILD_BUILDID: ${{ github.run_id }} - name: Run tests run: | dotnet test --no-build --verbosity normal --configuration Debug \ diff --git a/actions/dotnet/build-test/action.yml b/actions/dotnet/build-test/action.yml index e98e4ea..d13591e 100644 --- a/actions/dotnet/build-test/action.yml +++ b/actions/dotnet/build-test/action.yml @@ -17,6 +17,9 @@ runs: - name: Build .NET code run: dotnet build --no-restore --configuration Debug shell: bash + env: + BUILD_SOURCEBRANCHNAME: ${{ github.ref_name }} + BUILD_BUILDID: ${{ github.run_id }} - name: Run tests run: | dotnet test --no-build --verbosity normal --configuration Debug \ diff --git a/actions/dotnet/pack-push/action.yml b/actions/dotnet/pack-push/action.yml new file mode 100644 index 0000000..a1de296 --- /dev/null +++ b/actions/dotnet/pack-push/action.yml @@ -0,0 +1,41 @@ +name: Pack & Push +description: Package .NET projects and push to the registry + +inputs: + dotnet-version: + description: .NET SDK version to be used + required: false + default: "10.0" + registry-token: + description: Registry + required: true + registry-address: + description: Registry address (NuGet.org by default) + required: false + default: "https://api.nuget.org/v3/index.json" + push-enabled: + description: Push + required: false + default: "false" + +runs: + using: "composite" + steps: + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version }} + - name: Package + # "**/*.csproj;!**/*Tests.csproj" + run: dotnet pack --configuration Release -o output + shell: bash + env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_NOLOGO: 1 + BUILD_SOURCEBRANCHNAME: ${{ github.ref_name }} + BUILD_BUILDID: ${{ github.run_id }} + - name: Push to registry + if: ${{ inputs.push-enabled == 'true' }} + # "$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg" + run: for f in output/*.nupkg; do dotnet nuget push "$f" --api-key ${{ inputs.registry-token }} --source ${{ inputs.registry-address }} ; done + shell: bash