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

Create draft release automation #261

Merged
merged 5 commits into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
32 changes: 32 additions & 0 deletions .github/workflows/draft-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Draft Release

on:
push:
# Build and publish artifacts when new tag is created for release
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Build Release Artifacts
run: make build-release-artifacts

- name: Publish Release
anusha94 marked this conversation as resolved.
Show resolved Hide resolved
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
generate_release_notes: true
files: |
_dist/byoh-hostagent-linux-amd64
_dist/cluster-template.yaml
_dist/infrastructure-components.yaml
_dist/metadata.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ bin
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Distribution related files
_dist

# Kubernetes Generated files - skip generated files, except for vendored files

!vendor/**/zz_generated.*
Expand Down
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ STAGING_REGISTRY ?= gcr.io/k8s-staging-cluster-api

IMAGE_NAME ?= cluster-api-byoh-controller
TAG ?= dev
RELEASE_DIR := _dist

# Image URL to use all building/pushing image targets
IMG ?= ${STAGING_REGISTRY}/${IMAGE_NAME}:${TAG}
Expand Down Expand Up @@ -168,6 +169,29 @@ host-agent-binary: $(RELEASE_DIR)
-o ./bin/$(notdir $(RELEASE_BINARY))-$(GOOS)-$(GOARCH) $(HOST_AGENT_DIR)


##@Release

$(RELEASE_DIR):
rm -rf $(RELEASE_DIR)
mkdir -p $(RELEASE_DIR)

build-release-artifacts: build-cluster-templates build-infra-yaml build-metadata-yaml build-host-agent-binary
shamsher31 marked this conversation as resolved.
Show resolved Hide resolved

build-cluster-templates: $(RELEASE_DIR) cluster-templates
cp $(BYOH_TEMPLATES)/v1beta1/cluster-template.yaml $(RELEASE_DIR)/cluster-template.yaml
sed -i -e 1,20d $(RELEASE_DIR)/cluster-template.yaml

build-infra-yaml:kustomize # Generate infrastructure-components.yaml for the provider
cd config/manager && $(KUSTOMIZE) edit set image gcr.io/k8s-staging-cluster-api/cluster-api-byoh-controller=${IMG}
$(KUSTOMIZE) build config/default > $(RELEASE_DIR)/infrastructure-components.yaml

build-metadata-yaml:
cp metadata.yaml $(RELEASE_DIR)/metadata.yaml

build-host-agent-binary: host-agent-binaries
cp bin/byoh-hostagent-linux-amd64 $(RELEASE_DIR)/byoh-hostagent-linux-amd64


# go-get-tool will 'go get' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
Expand Down