chore: Bump Microsoft.Extensions.DependencyInjection and 2 others (#598) #431
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches-ignore: | |
| - dependabot/* | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| is_stable_build: | |
| description: Use a version number indicating this is a stable release | |
| required: true | |
| default: "false" | |
| release: | |
| description: Create a release | |
| required: true | |
| default: "false" | |
| env: | |
| IS_STABLE_BUILD: ${{ github.event.inputs.is_stable_build }} | |
| jobs: | |
| build: | |
| if: ${{ !contains(github.event.head_commit.message, 'ci skip') || github.event_name == 'workflow_dispatch' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| outputs: | |
| package_version: ${{ steps.build_script.outputs.package_version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | | |
| 8.x | |
| 9.x | |
| 10.x | |
| - name: Run build script | |
| id: build_script | |
| run: ./build.ps1 -ci | |
| - uses: actions/upload-artifact@v7 | |
| if: ${{ matrix.os == 'windows-latest' }} | |
| with: | |
| name: packages | |
| path: artifacts/ | |
| if-no-files-found: error | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| name: unittests-${{ matrix.os }} | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| release: | |
| if: ${{ github.event.inputs.release }} | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # for creating GitHub releases | |
| id-token: write # for NuGet trusted publishing (OIDC) | |
| packages: write # for GitHub Package Registry | |
| env: | |
| PACKAGE_VERSION: ${{ needs.build.outputs.package_version }} | |
| steps: | |
| - run: echo "Releasing ${{ env.PACKAGE_VERSION }}" | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: packages | |
| path: packages | |
| - name: Configure GitHub NuGet registry | |
| run: dotnet nuget add source --name github --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | |
| - name: Push to GitHub package registry | |
| run: dotnet nuget push packages/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source github --skip-duplicate | |
| - name: NuGet login (trusted publishing) | |
| id: nuget-login | |
| uses: nuget/login@v1 | |
| with: | |
| user: natemcmaster | |
| - name: Push to NuGet.org | |
| run: dotnet nuget push packages/*.nupkg --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| name: ${{ env.PACKAGE_VERSION }} | |
| tag_name: v${{ env.PACKAGE_VERSION }} | |
| body: | | |
| ## How to get this update | |
| Packages have been posted to these feeds: | |
| #### NuGet.org | |
| https://nuget.org/packages/McMaster.Extensions.CommandLineUtils/${{ env.PACKAGE_VERSION }} | |
| https://nuget.org/packages/McMaster.Extensions.Hosting.CommandLine/${{ env.PACKAGE_VERSION }} | |
| #### GitHub Package Registry | |
| https://github.com/natemcmaster?tab=packages&repo_name=CommandLineUtils | |
| draft: false | |
| append_body: true | |
| generate_release_notes: true | |
| prerelease: ${{ env.IS_STABLE_BUILD == 'false' }} # Example: v3.1.0-beta | |
| files: packages/* |