Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Mar 19, 2024
1 parent 73961f4 commit 05508dd
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: build

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

jobs:
build:
# You must use a Linux environment when using service containers or container jobs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Lint check
run: make install-linter lint
- name: Vet check
run: make vet
- name: Tests
run: make test
release-please:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
outputs:
release_created: ${{ steps.release-please.outputs.release_created }}
tag_name: ${{ steps.release-please.outputs.tag_name }} # e.g. v1.0.0
version: ${{ steps.release-please.outputs.version }} # e.g. 1.0.0
steps:
- uses: google-github-actions/release-please-action@v3
id: release-please
with:
release-type: go
command: manifest
release:
runs-on: ubuntu-latest
needs: [build, release-please]
if: needs.release-please.outputs.release_created
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- uses: goreleaser/goreleaser-action@v5
with:
args: release --clean --skip-sign --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ test:
lint:
go list ./... | xargs staticcheck

# Run go fmt against code
.PHONY: fmt
fmt:
go fmt ./...

# Run go vet against code
.PHONY: vet
vet:
go vet ./...

.PHONY: install-linter
install-linter:
go install honnef.co/go/tools/cmd/staticcheck@latest

0 comments on commit 05508dd

Please sign in to comment.