Skip to content

Commit

Permalink
Add releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
qbart committed Nov 9, 2021
1 parent 36f2fbe commit f1ea992
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 21 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test and release

permissions:
contents: write

on: [push]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup go
uses: actions/setup-go@v1
with:
go-version: 1.17.1

- name: Run tests
run: |
go test -v ./...
release:
runs-on: ubuntu-latest
needs: test
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17.1
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
builds:
-
ldflags:
- -s -w
goarch:
- amd64
- arm64
goarm:
- 7
ignore:
- goos: linux
goarch: arm64

binary: selleo
1 change: 0 additions & 1 deletion IDEAS.md

This file was deleted.

8 changes: 1 addition & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
run:
go run main.go

test:
go test ./... -coverprofile=coverage.out -timeout=2m -parallel=4

coverage: test
go tool cover -html=coverage.out
go test ./... -timeout=2m -parallel=4
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,2 @@
# cli

## Install

```
asdf plugin-add golang https://github.com/kennyp/asdf-golang.git
```

## Run

```
make run
make test
make coverage # it will run tests first
```

0 comments on commit f1ea992

Please sign in to comment.