Skip to content

Commit

Permalink
Merge pull request #4 from reproio/feature/ci-job
Browse files Browse the repository at this point in the history
Add test and release on CI job
  • Loading branch information
yoshimura0725 authored Apr 13, 2022
2 parents ecf378a + 09e356e commit ef69c40
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.18
uses: actions/setup-go@v2
with:
go-version: 1.18
id: go

- name: Check out
uses: actions/checkout@v2

- name: Build
run: go build -o terraform-j2md cmd/terraform-j2md/main.go

- name: Test
run: go test ./...
31 changes: 31 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: goreleaser

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch all tags
run: git fetch --force --tags
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
project_name: terraform-j2md
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- main: ./cmd/terraform-j2md/main.go
binary: terraform-j2md
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Revision={{.ShortCommit}}
env:
- CGO_ENABLED=0
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
arm64: arm64
files:
- README.md
format_overrides:
- goos: Windows
format: zip
release:
prerelease: auto
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
terraform-j2md
===
![Go](https://github.com/reproio/terraform-j2md/workflows/Go/badge.svg)
![goreleaser](https://github.com/reproio/terraform-j2md/workflows/goreleaser/badge.svg)

Output human-readable markdown texts from Terraform plan JSON output.

## Synopsis
Expand Down

0 comments on commit ef69c40

Please sign in to comment.