Release #18
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: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - run: echo "ACTIONS_ALLOW_UNSECURE_COMMANDS=true" >> $GITHUB_ENV | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v0 | |
| with: | |
| versionSpec: "5.x" | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: "9.0.x" | |
| - name: Determine Version | |
| id: gitversion | |
| uses: gittools/actions/gitversion/execute@v0 | |
| with: | |
| useConfigFile: true | |
| - name: Pack | |
| run: dotnet pack source /p:Version=${{ steps.gitversion.outputs.majorMinorPatch }} /p:InformationalVersion=${{ steps.gitversion.outputs.informationalVersion }} /p:PackageReleaseNotes="https://github.com/$GITHUB_REPOSITORY/releases/tag/${{ steps.gitversion.outputs.majorMinorPatch }}" -o ./releases | |
| - name: Publish | |
| run: dotnet nuget push ./releases/**/*.nupkg -k=${{ secrets.NUGETORGAPIKEY }} -s=nuget.org | |
| - run: git log $(git describe --tags --abbrev=0)..HEAD --oneline | |
| - name: Generate CHANGELOG.md | |
| id: releasenotes | |
| run: | | |
| gh api repos/$GITHUB_REPOSITORY/releases/generate-notes \ | |
| -f tag_name="${{ steps.gitversion.outputs.majorMinorPatch }}" \ | |
| -q .body > CHANGELOG.md | |
| echo -e "\n\n" >> CHANGELOG.md | |
| git log $(git describe --tags --abbrev=0)..HEAD --oneline >> CHANGELOG.md | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.gitversion.outputs.majorMinorPatch }} | |
| release_name: Release ${{ steps.gitversion.outputs.majorMinorPatch }} | |
| body_path: CHANGELOG.md | |
| draft: false | |
| prerelease: false |