Skip to content

Update CI.yml

Update CI.yml #4

Workflow file for this run

name: Go Build and Release
on:
push:
branches:
- master
tags:
- '*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.x'
- name: Install Dependencies
run: sudo apt-get install -y rpm
- name: Build
run: |
go build -ldflags "-X main.version=${GITHUB_REF#refs/tags/}" .
release:
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Goreleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, no need to create one