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

Automated cherry pick of #388: Tag releases automatically #396: Fetch all history when tagging releases #402

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/tag-release.yml
@@ -0,0 +1,25 @@
name: tag-release

on:
push:
branches:
- master
- 'release-*'
paths:
- version.txt

jobs:
tag-release:
if: ${{ github.repository == 'kubernetes/cloud-provider-aws' }}
runs-on: ubuntu-20.04

permissions:
contents: write

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: /usr/bin/git config --global user.email actions@github.com
- run: /usr/bin/git config --global user.name 'GitHub Actions Release Tagger'
- run: hack/tag-release.sh
7 changes: 4 additions & 3 deletions docs/RELEASE.md
Expand Up @@ -18,11 +18,12 @@ In the case that we are backporting a fix to the 1.22 compatible controller:

If you just need to create a release for the latest Kubernetes version that the project currently supports, you can skip creating the release branch. Instead, your steps would be:

1. Create the release commit.
2. Create a PR to merge the release commit, and get it reviewed and merged.
3. Create the release and tag.
1. Edit the `version.txt` file and update the release version.
2. Create the release commit.
3. Create a PR to merge the release commit, and get it reviewed and merged. This will trigger a github action which will automatically create the release tag.
4. Once the image builds in staging, create a PR to promote it to prod.
5. Create the commit to update helm charts and example config with the new prod image tag.
6. Create the release.

## Choosing the Release Version

Expand Down
30 changes: 30 additions & 0 deletions hack/tag-release.sh
@@ -0,0 +1,30 @@
#!/bin/bash -xe

# Copyright 2022 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

VERSION=$(cat version.txt)

if [[ ! "${VERSION}" =~ ^([0-9]+[.][0-9]+)[.]([0-9]+)(-(alpha|beta)[.]([0-9]+))?$ ]]; then
echo "Version ${VERSION} must be 'X.Y.Z', 'X.Y.Z-alpha.N', or 'X.Y.Z-beta.N'"
exit 1
fi

if [ "$(git tag -l "v${VERSION}")" ]; then
echo "Tag v${VERSION} already exists"
exit 0
fi

git tag -a -m "Release ${VERSION}" "v${VERSION}"
git push origin "v${VERSION}"
1 change: 1 addition & 0 deletions version.txt
@@ -0,0 +1 @@
1.24.0