fix(deps): update module github.com/spf13/cobra to v1.8.1 #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- 'v*' | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- edited | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# checkout | |
- name: checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
# setup go | |
- name: go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.14 | |
- run: go version | |
- run: go env | |
# cache | |
- name: cache | |
uses: actions/cache@v1 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
# vendor | |
- name: vendor | |
run: | | |
make vendor | |
# build | |
- name: build | |
if: startsWith(github.ref, 'refs/tags/') == false | |
run: | | |
make snapshot | |
# get tag name | |
- name: tag_name | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: olegtarasov/get-tag@v2 | |
with: | |
tagRegex: "v?(.+)" | |
# publish | |
- name: publish | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REF: ${{ github.ref }} | |
run: | | |
make publish | |
# artifacts | |
- name: artifact_linux | |
uses: actions/upload-artifact@v2-preview | |
with: | |
name: build_linux | |
path: dist/*linux* | |
- name: artifact_darwin | |
uses: actions/upload-artifact@v2-preview | |
with: | |
name: build_darwin | |
path: dist/*darwin* |