Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #114 from chuckha/manual-release
Browse files Browse the repository at this point in the history
Manual release of container images
  • Loading branch information
k8s-ci-robot authored Jul 25, 2019
2 parents a496ad7 + 801d777 commit 629815f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 34 deletions.
35 changes: 1 addition & 34 deletions .github/main.workflow
Original file line number Diff line number Diff line change
@@ -1,49 +1,16 @@
workflow "Release" {
on = "push"
resolves = ["push images"]
}

action "Setup Google Cloud" {
uses = "actions/gcloud/auth@master"
secrets = ["GCLOUD_AUTH"]
resolves = ["goreleaser"]
}

action "is-tag" {
uses = "actions/bin/filter@master"
args = "tag"
}

action "Set Credential Helper for Docker" {
needs = ["Setup Google Cloud"]
uses = "actions/gcloud/cli@master"
args = ["auth", "configure-docker", "--quiet"]
}

action "goreleaser" {
uses = "docker://goreleaser/goreleaser"
secrets = ["GORELEASER_GITHUB_TOKEN"]
args = "release"
needs = ["is-tag"]
}

action "docker build" {
uses = "actions/docker/cli@master"
args = "build -t capd-manager ."
needs = ["goreleaser"]
}

action "tag images" {
uses = "actions/docker/tag@master"
args = "capd-manager gcr.io/kubernetes1-226021/capd-manager"
needs = ["docker build"]
}

action "push images" {
uses = "actions/docker/cli@master"
runs = "sh -c"
env = {
IMAGE_NAME = "gcr.io/kubernetes1-226021/capd-manager"
}
args = ["source $HOME/.profile && docker push $IMAGE_NAME:latest && docker push $IMAGE_NAME:$IMAGE_REF && docker push $IMAGE_NAME:$IMAGE_SHA && docker push $IMAGE_NAME:$IMAGE_VERSION"]
needs = ["tag images", "Set Credential Helper for Docker"]
}
14 changes: 14 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,17 @@ checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
dockers:
- goos: linux
goarch: amd64
skip_push: true
binaries:
- capd-manager
image_templates:
- "gcr.io/kubernetes1-226021/capd-manager:{{.Version}}"
- "gcr.io/kubernetes1-226021/capd-manager:{{.Major}}.{{.Minor}}"
- "gcr.io/kubernetes1-226021/capd-manager:latest"
changelog:
filters:
exclude:
- '^Merge pull request'
30 changes: 30 additions & 0 deletions docs/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Creating a release

Tag the repository with the version you want

`git tag -a v0.1.2 -m 'a patch release'`

then push the tag

`git push origin refs/tags/v0.1.2`

Github actions will take care of the rest.

Please edit the generated change log.

## Container Images

Container images must be pushed from your local machine.

### via Goreleaser

If you have [goreleaser](https://goreleaser.com/) installed you can run
`goreleaser --skip-publish` and push the generated images.

### manually

Manually build the Dockerfile using `docker build`. The tag pattern is:

* `:latest` - This is the latest release
* `:<major>.<minor>` - This is the latest minor release in the series
* `:<major>.<minor>.<patch>` - This is the specific version

0 comments on commit 629815f

Please sign in to comment.