Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Fix Release Workflow (#59)
Browse files Browse the repository at this point in the history
* remove gox dependency

Signed-off-by: Tarun Pothulapati <[email protected]>

* Install helmv2 in all cases

Signed-off-by: Tarun Pothulapati <[email protected]>

* Clean Up Release

Signed-off-by: Tarun Pothulapati <[email protected]>
  • Loading branch information
Pothulapati committed Mar 13, 2020
1 parent e59c7ce commit 6885cbc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/build.yml → .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 6885cbc

Please sign in to comment.