Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: release workflow tags the correct commit #113

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,5 @@ jobs:
bodyFile: releases/CHANGELOG-${{ env.RELEASE_VERSION }}.md
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.RELEASE_VERSION }}
commit: release-${{ env.RELEASE_VERSION }}
prerelease: true
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ tools-install:
tools-clean:
make -C hack/tools/ clean

create-release-branch:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove create-release-branch make command?

@./scripts/gh-create-release-branch.sh

include versioning.mk
include test.mk
include packer.mk
93 changes: 86 additions & 7 deletions docs/community/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ Let's go through the process of creating a new release of the [aks-engine][] bin

We will use **v0.65.0** as an example herein. You should replace this with the new version you're releasing.

### Prepare a Release Branch
### Release Branch

For a minor release, we will release from master. For a patch, we will create a new branch at the `Azure/` git origin from the previous release branch and use `git cherry-pick` to apply specific commits.

Once your source branch is prepared for a release, we run the "Create Release Branch" GitHub Action to automatically validate and create the destination release branch:

- https://github.com/Azure/aks-engine-azurestack/actions/workflows/create-release-branch.yaml
- [Create Release Branch action](https://github.com/Azure/aks-engine-azurestack/actions/workflows/create-release-branch.yaml)

Use the full "v"-prefixed semver release string in the field with the description "Which version are we creating a release branch for?", for example `v0.65.0`.

Expand All @@ -68,17 +68,96 @@ Click "Run Workflow" to initiate the process of validating and creating our rele
- Run well-known "no egress" tests to validate that the base set of default components are pre-installed onto the default Linux and Windows VHDs.
- Create a new branch at the `Azure/` git origin named "release-<release version>", for example `release-v0.65.0` for the `v0.65.0` release.
- Generate automated release notes using the `git-chglog` tool.
- Create a PR with the generated release notes as a potential commit to the destination release branch.
- Create a branch with the generated release notes as a potential commit to the destination release branch.

### Review Release Notes
#### Minor Release Branch using GitHub CLI

If the "Create Release Branch" GitHub Action ran successfully, there will be a new PR in the `Azure/aks-engine-azurestack` queue named "release: <release version> CHANGELOG", for example `release: v0.65.0 CHANGELOG` for the `v0.65.0` release.
See example of how to prepare a minor branch:

At this time project maintainers should review the CHANGELOG PR for the following:
```bash
# New release version
RELEASE_VERSION=v0.76.0
# Find your Azure/aks-engine-azurestack remote using git remote -v`
GH_ORG_REPO=Azure/aks-engine-azurestack
REMOTE=$(git remote -v | grep ${GH_ORG_REPO} | head -n 1 | cut -f 1)

# Run create-release-action GH action
WORKFLOW_FROM_BRANCH=master \
RELEASE_REPOSITORY=${GH_ORG_REPO} \
RELEASE_VERSION=${RELEASE_VERSION} \
RELEASE_FROM_BRANCH=master \
make create-release-branch

# Wait for action to finish
gh run watch -R ${GH_ORG_REPO}

# Validate remote branches
git fetch ${REMOTE}
git log ${REMOTE}/CHANGELOG-${RELEASE_VERSION}
git log ${REMOTE}/release-${RELEASE_VERSION}
```

#### Patch Release Branch using GitHub CLI

See example of how to prepare a patch release branch:

```bash
# Base release version
PREVIOUS_VERSION=v0.76.0
# New release version
RELEASE_VERSION=v0.76.1
# Find your Azure/aks-engine-azurestack remote using git remote -v`
GH_ORG_REPO=Azure/aks-engine-azurestack
REMOTE=$(git remote -v | grep ${GH_ORG_REPO} | head -n 1 | cut -f 1)

# Create local work branch
git checkout -b patch-release-${RELEASE_VERSION}
# Move it to previous release
git reset --hard ${REMOTE}/release-${PREVIOUS_VERSION}
# Cherry-pick commits to include
git cherry-pick ${COMMIT_1} ${COMMIT_2} ...
# Push work branch to remote
git push ${REMOTE} patch-release-${RELEASE_VERSION}

# Run create-release-action GH action
WORKFLOW_FROM_BRANCH=master \
RELEASE_REPOSITORY=${GH_ORG_REPO} \
RELEASE_VERSION=${RELEASE_VERSION} \
RELEASE_FROM_BRANCH=patch-release-${RELEASE_VERSION} \
scripts/gh-create-release-branch.sh

# Wait for action to finish
gh run watch -R ${GH_ORG_REPO}

# Validate remote branches
git fetch ${REMOTE}
git log ${REMOTE}/CHANGELOG-${RELEASE_VERSION}
git log ${REMOTE}/release-${RELEASE_VERSION}
```

### Release Notes

If the "Create Release Branch" GitHub Action ran successfully, there will be a new branch in the `Azure/aks-engine-azurestack` repository named "CHANGELOG-${RELEASE_VERSION}", for example `CHANGELOG-v0.65.0` for the `v0.65.0` release.

At this time project maintainers should review file `releases/CHANGELOG-${RELEASE_VERSION}.md` for the following:

- Does the generated list of changes meet with the desired set of changes to include in this release?
- Is there anything that can be improved with manual, human changes to the CHANGELOG markdown?
- If so, edit the `.md` file in-place in the PR
- If so, edit the `.md` file and push a new commit to branch "CHANGELOG-${RELEASE_VERSION}"

After this, create a pull request for the changelog file:

```bash
gh pr create \
--base release-${RELEASE_VERSION} \
--head CHANGELOG-${RELEASE_VERSION} \
--title "release: ${RELEASE_VERSION} CHANGELOG" \
--body "Add CHANGELOG for upcoming ${RELEASE_VERSION} release" \
--repo Azure/aks-engine-azurestack

# Merge if you have admin permissions
gh pr merge <PR_ID> --admin --squash --repo ${GH_ORG_REPO}
```

Ensure that at least two maintainers lgtm the final proposed CHANGELOG. Once this PR is merged to the release branch, a GitHub Action will perform the actual release publication.

Expand Down