From 6885cbc673a43a568ad6cb91ea5b046f26382bd0 Mon Sep 17 00:00:00 2001 From: Tarun Pothulapati Date: Sat, 14 Mar 2020 01:32:43 +0530 Subject: [PATCH] Fix Release Workflow (#59) * remove gox dependency Signed-off-by: Tarun Pothulapati * Install helmv2 in all cases Signed-off-by: Tarun Pothulapati * Clean Up Release Signed-off-by: Tarun Pothulapati --- .github/workflows/{build.yml => main.yml} | 23 +++++++++++++---------- Makefile | 12 ++---------- 2 files changed, 15 insertions(+), 20 deletions(-) rename .github/workflows/{build.yml => main.yml} (74%) diff --git a/.github/workflows/build.yml b/.github/workflows/main.yml similarity index 74% rename from .github/workflows/build.yml rename to .github/workflows/main.yml index 2c0f8a3..85efe34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/main.yml @@ -3,12 +3,11 @@ on: pull_request: {} push: tags: - - 'v*.*.*' + - 'v*.*.*' paths-ignore: - '*.md' - '**/*.md' - branches: - - master + jobs: go_build_test: name: Go Build and Test @@ -37,18 +36,22 @@ jobs: run: | make build release: - name: Docker Push and Release + name: Docker Push and Github Release needs: docker_build runs-on: ubuntu-latest - if: github.event_name == 'push' && startsWith(github.ref, 'v') steps: - - name: Set env - run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF/refs\/tags\//} + - name: Checkout code + uses: actions/checkout@master + - name: Setup Go + uses: actions/setup-go@v1 + with: + go-version: 1.13.8 - name: Docker Build and Push + if: github.event_name == 'push' run: | + export RELEASE_VERSION=${GITHUB_REF/refs\/tags\//} + export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} + export PATH=${PATH}:`go env GOPATH`/bin docker login -u ${{ secrets.DOCKER_USER}} -p ${{ secrets.DOCKER_PASS}} && \ make push - - name: Performing a Github release - run: | - export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} make release diff --git a/Makefile b/Makefile index 28e38c9..4cf889f 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,7 @@ ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) HAS_TILT := $(shell command -v tilt;) -HAS_GOX := $(shell command -v gox;) HAS_GHR := $(shell command -v ghr;) -HAS_HELM := $(shell command -v helm;) IMAGE_NAME ?= deislabs/smi-metrics @@ -18,19 +16,13 @@ endif .PHONY: release-bootstrap release-bootstrap: - @#Check for gox -ifndef HAS_GOX - @echo "Installing gox" - go get -u github.com/mitchellh/gox -endif + @echo "Installing Helm v2" + set -x; curl -L https://git.io/get_helm.sh | bash @#Check for ghr ifndef HAS_GHR @echo "Installing ghr" go get -u github.com/tcnksm/ghr endif -ifndef HAS_HELM - set -x; curl -L https://git.io/get_helm.sh | bash -endif .PHONY: bootstrap bootstrap: