Skip to content

Commit

Permalink
ci: add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
chroju committed Mar 12, 2022
1 parent 517b107 commit d6f0c30
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: release
on:
workflow_dispatch:
push:
tags:
- v*.*.*
jobs:
release:
name: Release awscccli
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: "1.17"
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v2
env:
GO111MODULE: on
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
version: latest
args: release --rm-dist
33 changes: 33 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: test
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
name: Test awscccli
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: "1.17.0"
- name: Test all
env:
GO111MODULE: on
run: |
make test-coverage
- name: Install goveralls
env:
GO111MODULE: off
run: go get github.com/mattn/goveralls
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: covprofile
43 changes: 43 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
env:
- GO111MODULE=on
before:
hooks:
- go mod tidy
builds:
- binary: acc
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- 386
- amd64
- arm64
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
files:
- none*
changelog:
skip: true
brews:
- name: awscccli
tap:
owner: chroju
name: homebrew-tap
token:
url_template: "https://github.com/chroju/awscccli/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
description: "Simple AWS CLI with Cloud Control API."
homepage: "https://github.com/chroju/awscccli"
license: "MIT"
test: |
system "#{bin}/acc --version"
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BINARY_NAME=acc

.PHONY: install test lint crossbuild clean

install:
go install

lint:
go mod tidy
gofmt -s -l .
golint ./...
go vet ./...

test: lint
go test -v ./...

crossbuild: test
gox -os="linux darwin windows" -arch="386 amd64" -output "bin/remo_{{.OS}}_{{.Arch}}/{{.Dir}}"

mod:
go mod download

clean:
go clean
rm -f $(BINARY_NAME)
rm -f bin/

test-coverage: mod
go test -race -covermode atomic -coverprofile=covprofile ./...
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
awscccli
========

`awscccli` is a command line tool for [AWS Cloud Control API](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/what-is-cloudcontrolapi.html). `awscccli` supports only read actions (list, get).
`awscccli` (AWS Cloud Control API CLI) is a simple style AWS command line tool with [AWS Cloud Control API](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/what-is-cloudcontrolapi.html). `awscccli` supports only read actions (list, get).

Install
-------
Expand Down

0 comments on commit d6f0c30

Please sign in to comment.