Skip to content

Commit 211acf4

Browse files
authored
Add release doc and script: (#164)
## Description This doc and helper script is used across other Tinkerbell repos. ## Why is this needed Fixes: # ## How Has This Been Tested? ## How are existing users impacted? What migration steps/scripts do we need? ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
2 parents 9d54933 + b4649ba commit 211acf4

File tree

3 files changed

+62
-3
lines changed

3 files changed

+62
-3
lines changed

RELEASING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Releasing
2+
3+
## Process
4+
5+
For version v0.x.y:
6+
7+
1. Create the annotated tag
8+
> NOTE: To use your GPG signature when pushing the tag, use `SIGN_TAG=1 ./contrib/tag-release.sh v0.x.y` instead)
9+
- `./contrib/tag-release.sh v0.x.y`
10+
1. Push the tag to the GitHub repository. This will automatically trigger a [Github Action](https://github.com/tinkerbell/hook/actions) to create a release.
11+
> NOTE: `origin` should be the name of the remote pointing to `github.com/tinkerbell/boots`
12+
- `git push origin v0.x.y`
13+
1. Review the release on GitHub.
14+
15+
### Permissions
16+
17+
Releasing requires a particular set of permissions.
18+
19+
- Tag push access to the GitHub repository

contrib/tag-release.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit -o nounset -o pipefail
4+
5+
if [ -z "${1-}" ]; then
6+
echo "Must specify new tag"
7+
exit 1
8+
fi
9+
10+
new_tag=${1-}
11+
[[ $new_tag =~ ^v[0-9]*\.[0-9]*\.[0-9]*$ ]] || (
12+
echo "Tag must be in the form of vX.Y.Z"
13+
exit 1
14+
)
15+
16+
if [[ $(git symbolic-ref HEAD) != refs/heads/main ]] && [[ -z ${ALLOW_NON_MAIN:-} ]]; then
17+
echo "Must be on main branch" >&2
18+
exit 1
19+
fi
20+
if [[ $(git describe --dirty) != $(git describe) ]]; then
21+
echo "Repo must be in a clean state" >&2
22+
exit 1
23+
fi
24+
25+
git fetch --all
26+
27+
last_tag=$(git describe --abbrev=0)
28+
last_tag_commit=$(git rev-list -n1 "$last_tag")
29+
last_specific_tag=$(git tag --contains="$last_tag_commit" | grep -E "^v[0-9]*\.[0-9]*\.[0-9]*$" | tail -n 1)
30+
last_specific_tag_commit=$(git rev-list -n1 "$last_specific_tag")
31+
if [[ $last_specific_tag_commit == $(git rev-list -n1 HEAD) ]]; then
32+
echo "No commits since last tag" >&2
33+
exit 1
34+
fi
35+
36+
if [[ -n ${SIGN_TAG-} ]]; then
37+
git tag -s -m "${new_tag}" "${new_tag}" &>/dev/null && echo "created signed tag ${new_tag}" >&2 && exit
38+
else
39+
git tag -a -m "${new_tag}" "${new_tag}" &>/dev/null && echo "created annotated tag ${new_tag}" >&2 && exit
40+
fi

hook-bootkit/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ type tinkConfig struct {
4040

4141
// tinkServerTLS is whether or not to use TLS for tink-server communication.
4242
tinkServerTLS string
43-
httpProxy string
44-
httpsProxy string
45-
noProxy string
43+
httpProxy string
44+
httpsProxy string
45+
noProxy string
4646
}
4747

4848
const maxRetryAttempts = 20

0 commit comments

Comments
 (0)