<commit_before># Release process

Only for Maintainers.

 1. Decide the tag name (version name) to be released.
    eg: 1.0.0-rc2, 1.0.0 etc.

 2. Run the following PowerShell from the root of the
    repo to get combined changelog (to be used later).

    ```powershell
        $changelogs = Get-ChildItem -Path . -Recurse -Filter changelog.md
        foreach ($changelog in $changelogs)
        {
         Add-Content -Path .\combinedchangelog.md -Value "**$($changelog.Directory.Name)**"
         $lines = Get-Content -Path $changelog.FullName
         $started = $false
         $ended = $false
         foreach ($line in $lines)
             {
                if($line -like "## Unreleased" -and $started -ne $true)
                {
                  $started = $true
                }
                elseif($line -like "## *" -and $started -eq $true)
                {
                  $ended = $true
                  break
                }
                else
                {
                    if ($started -eq $true)
                    {
                        Add-Content -Path .\combinedchangelog.md $line
                    }
                }
             }
        }
    ```

    This generates combined changelog to be used in Github release.
    Once contents of combined changelog is saved somewhere,
    delete the file.

 3. Run the following PowerShell script from the root of the repo.
    This updates all the changelog to have release date for the
    current version being released.
    Replace the version with actual version.
    The actual version would be the tag name from step1.

    ```powershell
         $changelogs = Get-ChildItem -Path . -Recurse -Filter changelog.md
        foreach ($changelog in $changelogs)
        {
         (Get-Content -Path $changelog.FullName) -replace "Unreleased", "Unreleased

    ## 1.0.0-rc2

    Released $(Get-Date -UFormat '%Y-%b-%d')" | Set-Content -Path $changelog.FullName
        }
    ```

 4. Normalize PublicApi files (Stable Release Only)
    Run the PowerShell script `.\build\finalize-publicapi.ps1`.
    This will merge the contents of Unshipped.txt into the Shipped.txt.

 5. Submit PR with the above changes, and get it merged.

 6. Tag Git with version to be released e.g.:

    ```sh
    git tag -a 1.0.0-rc2 -m "1.0.0-rc2"
    git push origin 1.0.0-rc2
    ```

    We use [MinVer](https://github.com/adamralph/minver) to do versioning,
    which produces version numbers based on git tags.

    Note:
    If releasing only core components, prefix the tag
    with "core-". For example:
    git tag -a core-1.1.0-beta1 -m "1.1.0-beta1 of all core components"

    If releasing only non-core components, use tags without
    prefix. For example:
    git tag -a 1.0.0-rc3 -m "1.0.0-rc3 of all non-core components"

    If releasing both, push both tags above.

 7. Open [Pack and publish to MyGet
    workflow](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/publish-packages-1.0.yml)
    and manually trigger a build. At the end of this, MyGet will have the
    packages. The package name will be the tag name used in step 5.

 8. Validate using MyGet packages. Basic sanity checks :)

 9. From the above build, get the artifacts from the drop, which has all the
    NuGet packages.

10. Copy all the NuGet files and symbols into a local folder. If only
    releasing core packages, only copy them over.

11. Download latest [nuget.exe](https://www.nuget.org/downloads) into
    the same folder from step 9.

12. Obtain the API key from nuget.org (Only maintainers have access)

13. Run the following commands from PowerShell from local folder used in step 9:

    ```powershell
    .\nuget.exe setApiKey <actual api key>

    get-childitem -Recurse | where {$_.extension -eq
    ".nupkg"} | foreach ($_) {.\nuget.exe push $_.fullname -Source
    https://api.nuget.org/v3/index.json}
    ```

14. Packages would be available in nuget.org in few minutes.
    Validate that the package is uploaded.

15. Delete the API key generated in step 11.

16. Make the Github release with tag from Step5
    and contents of combinedchangelog from Step2.

    TODO: Add tagging for Metrics release.
    TODO: Separate version for instrumention/hosting/OTshim package.

17. Update the OpenTelemetry.io document
    [here](https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/net)
    by sending a Pull Request.

18. If a new stable version of the core packages were released,
    update `OTelPreviousStableVer` in Common.props
    to the just released stable version.<commit_msg>Minor updates to RELEASING doc (#3598)<commit_after># Release process

Only for Maintainers.

 1. Decide the tag name (version name) to be released. e.g. 1.4.0-beta.1,
    1.0.0-rc9.7 etc.

 2. Run the following PowerShell from the root of the repo to get combined
    changelog (to be used later).

    ```powershell
        $changelogs = Get-ChildItem -Path . -Recurse -Filter changelog.md
        foreach ($changelog in $changelogs)
        {
         Add-Content -Path .\combinedchangelog.md -Value "**$($changelog.Directory.Name)**"
         $lines = Get-Content -Path $changelog.FullName
         $started = $false
         $ended = $false
         foreach ($line in $lines)
             {
                if($line -like "## Unreleased" -and $started -ne $true)
                {
                  $started = $true
                }
                elseif($line -like "## *" -and $started -eq $true)
                {
                  $ended = $true
                  break
                }
                else
                {
                    if ($started -eq $true)
                    {
                        Add-Content -Path .\combinedchangelog.md $line
                    }
                }
             }
        }
    ```

    This generates combined changelog to be used in GitHub release. Once
    contents of combined changelog is saved somewhere, delete the file.

 3. Run the following PowerShell script from the root of the repo. This updates
    all the changelog to have release date for the current version being
    released. Replace the version with actual version. In the script below,
    replace `1.4.0-beta.1` with the tag name chosen for the package in Step 1.

    ```powershell
         $changelogs = Get-ChildItem -Path . -Recurse -Filter changelog.md
        foreach ($changelog in $changelogs)
        {
         (Get-Content -Path $changelog.FullName) -replace "Unreleased", "Unreleased

    ## 1.4.0-beta.1

    Released $(Get-Date -UFormat '%Y-%b-%d')" | Set-Content -Path $changelog.FullName
        }
    ```

 4. Normalize PublicApi files (Stable Release Only): Run the PowerShell script
    `.\build\finalize-publicapi.ps1`. This will merge the contents of
    Unshipped.txt into the Shipped.txt.

 5. Submit PR with the above changes, and get it merged.

 6. Tag Git with version to be released. We use
    [MinVer](https://github.com/adamralph/minver) to do versioning, which
    produces version numbers based on git tags.

    Note: If releasing only core components, only add and push the tag prefixed
    with `core-`. For example:

    ```sh
    git tag -a core-1.4.0-beta.1 -m "1.4.0-beta.1 of all core components"
    git push origin core-1.4.0-beta.1
    ```

    If releasing only non-core components, only add and push the tags without
    prefix. For example:

    ```sh
    git tag -a 1.0.0-rc9.7 -m "1.0.0-rc9.7 of all non-core components"
    git push origin 1.0.0-rc9.7
    ```

    If releasing both, push both tags above.

 7. Open [Pack and publish to MyGet
    workflow](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/publish-packages-1.0.yml)
    and manually trigger a build. At the end of this, MyGet will have the
    packages. The package name will be the tag name used in Step 5.

 8. Validate using MyGet packages. Basic sanity checks :)

 9. From the above build, get the artifacts from the drop, which has all the
    NuGet packages.

10. Copy all the NuGet files and symbols into a local folder. If only releasing
    core packages, only copy them over.

11. Download latest [nuget.exe](https://www.nuget.org/downloads) into the same
    folder from Step 9.

12. Obtain the API key from nuget.org (Only maintainers have access)

13. Run the following commands from PowerShell from local folder used in Step 9:

    ```powershell
    .\nuget.exe setApiKey <actual api key>

    get-childitem -Recurse | where {$_.extension -eq ".nupkg"} | foreach ($_) {.\nuget.exe push $_.fullname -Source https://api.nuget.org/v3/index.json}
    ```

14. Packages would be available in nuget.org in few minutes. Validate that the
    package is uploaded.

15. Delete the API key generated in Step 11.

16. Make the Github release with tag from Step 5 and contents of
    combinedchangelog from Step 2.

    TODO: Add tagging for Metrics release. TODO: Separate version for
    instrumention/hosting/OTshim package.

17. Update the OpenTelemetry.io document
    [here](https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/net)
    by sending a Pull Request.

18. If a new stable version of the core packages were released, update
    `OTelPreviousStableVer` in Common.props to the just released stable version.
{'fraction_non_alphanumeric': 0.09080201306349717, 'fraction_numerical': 0.0176678445229682, 'mean_word_length': 2.230716015219647, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5129569', 'n_tokens_mistral': 2881, 'n_tokens_neox': 2700, 'n_words': 1061}