-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into romain.marcadier/gls-…
…enablement # Conflicts: # .github/workflows/tests.yml
- Loading branch information
Showing
63 changed files
with
1,669 additions
and
1,955 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Release | ||
on: | ||
pull_request: | ||
paths: ['internal/version/version.go'] | ||
push: | ||
branches: ['main'] | ||
paths: ['internal/version/version.go'] | ||
|
||
jobs: | ||
validate: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # To be able to create draft releases | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache-dependency-path: '**/*.sum' | ||
|
||
# Obtains the current configured version tag from source, and verifies it is a valid tag name. | ||
# Also checks whether the tag already exists. | ||
- name: Determine version | ||
id: version | ||
run: |- | ||
set -euo pipefail | ||
# From https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string, with added v prefix. | ||
VERSION_TAG_REGEX='^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$' | ||
version=$(grep -E "${VERSION_TAG_REGEX}" <(go run . version)) | ||
echo "tag=${version}" >> "${GITHUB_OUTPUT}" | ||
if gh release view "${version}" --json isDraft; then | ||
echo "exists=true" >> "${GITHUB_OUTPUT}" | ||
else | ||
echo "exists=false" >> "${GITHUB_OUTPUT}" | ||
fi | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
# If this is a pull request, and the release does not yet exist, the PR title must be "release: <tag>" | ||
- name: 'Pull Request title must be "release: ${{ steps.version.outputs.tag }}"' | ||
if: "github.event_name == 'pull_request' && !fromJSON(steps.version.outputs.exists) && format('release: {0}', steps.version.outputs.tag) != github.event.pull_request.title" | ||
run: |- | ||
echo 'Please update the PR title to "release: ${{ steps.version.outputs.tag }}" (instead of ${{ toJSON(github.event.pull_request.title) }})' | ||
exit 1 | ||
# Release must not already exist (if the PR title suggests this is intended to be a release) | ||
- name: Release ${{ steps.version.outputs.tag }} already exists | ||
if: github.event_name == 'pull_request' && fromJSON(steps.version.outputs.exists) && startsWith(github.event.pull_request.title, 'release:') | ||
run: |- | ||
echo 'A release already exists for tag ${{ steps.version.outputs.tag }}. Please update to another version.' | ||
exit 1 | ||
# If the release does not yet exist, create a draft release targeting this commit. | ||
- name: Create draft release | ||
if: github.event_name == 'push' && steps.version.outputs.exists == 'false' | ||
run: |- | ||
gh release create '${{ steps.version.outputs.tag }}' --draft --generate-notes --target='${{ github.sha }}' --title='${{ steps.version.outputs.tag }}' ${{ contains(steps.version.outputs.tag, '-') && '--prerelease' || '' }} | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,33 @@ | ||
# Release process | ||
|
||
## Overview | ||
|
||
The release process consists of creating a release branch, merging fixes to `main` **and** to the release branch, and releasing release candidates as things progress. Once a release candidate is stable, a final version can be released. | ||
|
||
## Steps | ||
|
||
### Create the release branch and the first release candidate | ||
|
||
1. Checkout the repository on the correct branch and changeset (`main`). | ||
2. Create a new release branch: `git checkout -b vX.Y`. | ||
3. Add a tag for the first release candidate: `git tag vX.Y.Z-rc.1`. | ||
4. Push the branch and tag. | ||
|
||
1. Determine the new release's version number | ||
- Follow [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html) semantics | ||
+ Be mindful of the `v0.x.y` semantics! | ||
- The placeholder `vX.Y.Z` is used to refer to the tag name including this version number in all | ||
steps below | ||
1. Check out the repository on the correct commit, which is most likely `origin/main` | ||
```console | ||
$ git push origin vX.Y | ||
$ git push origin vX.Y.Z-rc.1 | ||
$ git fetch | ||
$ git checkout origin/main -b ${USER}/release/vX.Y.Z | ||
``` | ||
5. Bump the tag in the `internal/version/version.go` file in the main branch to the next minor pre-release version using the `-dev` pre-release suffix. | ||
|
||
### Create a release candidate after a bug fix | ||
|
||
**Note:** The fix must be merged to `main` and backported the release branch. | ||
|
||
1. Update the release branch `vX.Y` locally by pulling the bug fix merged upstream (`git fetch`, `git pull`) | ||
2. Modify the version string in `internal/version/version.go` to the release candidate version. | ||
3. Add a tag for the new release candidate: `git tag vX.Y.Z-rc.W`. | ||
4. Push the branch and tag. | ||
|
||
1. Edit [`internal/version/version.go`](/internal/version/version.go) to set the `Tag` constant to | ||
the new `vX.Y.Z` version | ||
1. Commit the resulting changes | ||
```console | ||
$ git push origin vX.Y | ||
$ git push origin vX.Y.Z-rc.W | ||
$ git commit -m "release: vX.Y.Z" internal/version/version.go | ||
``` | ||
|
||
### Release the final version | ||
|
||
1. Update the release branch `vX.Y` locally by pulling any bug fixes merged upstream (`git fetch`, `git pull`) | ||
2. Modify the version string in `internal/version/version.go` to the final version. | ||
3. Add a final release tag: `git tag vX.Y.Z`. | ||
4. Push the branch and tag. | ||
|
||
1. Open a pull request | ||
```console | ||
$ git push origin vX.Y | ||
$ git push origin vX.Y.Z-rc.W | ||
$ gh pr create --web | ||
``` | ||
|
||
5. Create a [GitHub release](https://github.com/DataDog/orchestrion/releases/new). | ||
- Choose the version tag `vX.Y.Z` | ||
- Set the release title to `vX.Y.Z` | ||
- Click on `Generate release notes` for automatic release notes generation | ||
- Click on `Publish release` | ||
1. Get the PR reviewed by a colleague, ensure all CI passes including the _Release_ validations | ||
1. Get the PR merged to `main` via the merge queue | ||
1. Once merged, a draft release will automatically be created on GitHub | ||
- Locate it on the [releases](https://github.com/DataDog/orchestrion/releases) page | ||
- Review the release notes, and edit them if necessary: | ||
+ Remove `chore:` entries | ||
+ Fix any typos you notice | ||
1. Once validated, publish the release on GitHub | ||
- This automatically creates the release tag, so you're done! |
This file contains 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
Oops, something went wrong.