Merge pull request #1679 from monopole/updateCloudbuildAgain

Improve the release process instructions
This commit is contained in:
Jeff Regan
2019-10-22 16:16:36 -07:00
committed by GitHub
2 changed files with 36 additions and 38 deletions

View File

@@ -132,6 +132,18 @@ module=kustomize # The kustomize executable
module=api # The API
```
### review tags to help determine new tag
Local:
```
git tag -l | grep $module
```
Remote:
```
git ls-remote --tags upstream | grep $module
```
### determine the version
Go's [semver]-compatible version tags take the form `v{major}.{minor}.{patch}`:
@@ -172,10 +184,17 @@ Create it:
git checkout -b $branch
```
### define the release tag
### remove API replacements from go.mod
```
tag="${module}/v${major}.${minor}.${patch}"
echo "tag=$tag"
```
Only do this if releasing one of the executables.
### pin the executable to a particular API version
Only do this if releasing one of the
executables (kustomize or pluginator).
In this repository, an executable in development
on the master branch typically depends on the API
@@ -193,22 +212,12 @@ requires.
```
# Update the following as needed, obviously.
if [ "$module" != "api" ]; then
# go mod edit -dropreplace=sigs.k8s.io/kustomize/api $module/go.mod
# go mod edit -require=sigs.k8s.io/kustomize/api@v?.0.1 $module/go.mod
# git commit -a -m "Drop API module replacement"
fi
```
### optionally build a release locally
Install [`cloud-build-local`], then run
# git checkout -b pinTheRelease
# go mod edit -dropreplace=sigs.k8s.io/kustomize/api $module/go.mod
# go mod edit -require=sigs.k8s.io/kustomize/api@v0.1.1 $module/go.mod
# git commit -a -m "Drop API module replacement"
```
./releasing/localbuild.sh $module
```
This should create release artifacts in a local directory.
### push the release branch
@@ -216,26 +225,6 @@ This should create release artifacts in a local directory.
git push -f upstream $branch
```
### optionally review tags
Local:
```
git tag -l
```
Remote:
```
git ls-remote --tags upstream
```
### define the release tag
```
tag="${module}/v${major}.${minor}.${patch}"
echo "tag=$tag"
```
### if replacing a release...
Must delete the tag before re-pushing it.
@@ -268,6 +257,16 @@ version.
git tag -a $tag -m "Release $tag on branch $branch"
```
### optionally build a release locally
Install [`cloud-build-local`], then run
```
./releasing/localbuild.sh $module
```
This should create release artifacts in a local directory.
### trigger the cloud build by pushing the tag
Push the tag:

View File

@@ -50,8 +50,7 @@ release:
owner: kubernetes-sigs
name: kustomize
builds:
- main: ./main.go
ldflags: >
- ldflags: >
-s
-X sigs.k8s.io/kustomize/api/provenance.version={{.Version}}
-X sigs.k8s.io/kustomize/api/provenance.gitCommit={{.Commit}}