Skip to content

Commit

Permalink
chore: add go releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinkim committed Mar 7, 2023
1 parent ae94b70 commit ec185f2
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 58 deletions.
54 changes: 0 additions & 54 deletions .github/workflows/checks.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow runs all dockerfiles in this repo
name: checks

on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
GOFLAGS: -mod=readonly
GOPROXY: https://proxy.golang.org

jobs:
pull-request:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
- uses: actions/setup-go@v3
with:
cache: true
check-latest: true
go-version-file: 'go.mod'
- name: Run go mod tidy
run: |
go mod tidy
git diff --exit-code
- uses: golangci/golangci-lint-action@v3
- name: Run go test
run: |
go test -v ./...
35 changes: 35 additions & 0 deletions .github/workflows/releases.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Releases

on:
push:
tags:
- v*.*.*
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
GOFLAGS: -mod=readonly
GOPROXY: https://proxy.golang.org

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.1.0
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
cache: true
check-latest: true
go-version-file: 'go.mod'
- uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ Temporary Items
.vscode/

# End of https://www.toptal.com/developers/gitignore/api/jetbrains,go,visualstudiocode,macos

/tmp/
*.log
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
run:
go: "1.19"

linters-settings:
revive:
rules:
Expand Down
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
builds:
- skip: true
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ check: test lint
.PHONY: test
## Run tests
test:
gotestsum --format short-verbose ./...
gotestsum --format dots-v2 ./...

.PHONY: lint
## Run linter
Expand Down

0 comments on commit ec185f2

Please sign in to comment.