chore(main): release 4.0.0 (#15) #35
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| release-please: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| tag_name: ${{ steps.release.outputs.tag_name }} | |
| steps: | |
| - name: Release | |
| id: release | |
| uses: googleapis/release-please-action@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| publish: | |
| name: Publish | |
| needs: release-please | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: | | |
| - name: Build | |
| run: dotnet build --configuration Release | |
| - name: Pack GitHub | |
| run: dotnet pack -c Release --output nupkgs/github | |
| - name: Pack NuGet | |
| run: dotnet pack -c Release --output nupkgs/nuget /p:PackagePrefix=Toothless. | |
| - name: Push Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: latest | |
| path: ./nupkgs/**/*.nupkg | |
| push-guthub: | |
| name: Push GitHub Nuget | |
| needs: publish | |
| permissions: | |
| packages: write | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: latest | |
| - name: NuGet Login | |
| uses: NuGet/login@v1 | |
| id: nuget-login | |
| with: | |
| user: toothless | |
| - name: Dotnet NuGet Add Source | |
| run: dotnet nuget add source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --name github --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text | |
| - name: Dotnet NuGet Push (GitHub) | |
| run: dotnet nuget push nupkg/github/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source github --skip-duplicate | |
| - name: Dotnet NuGet Push (NuGet) | |
| run: dotnet nuget push nupkg/nuget/*.nupkg --api-key ${{ steps.nuget-login.outputs.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |