Skip to content

Commit

Permalink
Add GHA build
Browse files Browse the repository at this point in the history
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
  • Loading branch information
gliptak committed Dec 27, 2021
1 parent 7269b4f commit 783c8b6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: ci

on:
push:
branches:
- master
tags:
- 'v*'
pull_request:

env:
GO_LATEST: "1.17"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: ${{env.GO_LATEST}}
- uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref , 'refs/tags/v') == false
with:
args: build --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v2
if: startsWith(github.ref , 'refs/tags/v') == false
with:
name: hcl2json
path: dist/*
- uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref , 'refs/tags/v')
with:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
builds:
-
goos:
- windows
- darwin
- linux
goarch:
- amd64
- arm64
archives:
- format: binary

0 comments on commit 783c8b6

Please sign in to comment.