Skip to content

Commit

Permalink
add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostiam committed Sep 6, 2023
1 parent e35bf82 commit f107041
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: release binary

on:
push:
tags:
- "*"

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
go: [ '1.21' ]

steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
cache: true
- name: release
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: testing

on:
push:
branches:
- "main"
pull_request:
branches:
- "main"

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.19', '1.20', '1.21' ]

steps:
- name: Check out
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
cache: true
- name: Test
run: make test
24 changes: 24 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
before:
hooks:
- go mod tidy
builds:
- id: protogolint
main: ./cmd/protogolint
binary: protogolint
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^ci:'

0 comments on commit f107041

Please sign in to comment.