Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Dorschner committed Feb 1, 2022
1 parent 4c6529a commit dfb08d3
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Go
on:
push:
branches: [ main ]
tags:
- v*
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Test
run: go test -v ./...

- name: Build
run: go build -v .

- name: Run goreleaser in snapshot mode
if: success() && ! startsWith(github.ref, 'refs/tags/v')
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --snapshot

- name: Upload assets for snapshots
if: success() && ! startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v2
with:
name: check_cloud_gcp
path: dist/*

- name: Run goreleaser in release mode
if: success() && startsWith(github.ref, 'refs/tags/v')
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
17 changes: 17 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
run:
deadline: 1m

linters:
disable-all: false
enable:
- funlen
- dogsled
- dupl
# - lll
- whitespace
- wsl
presets:
- bugs
- unused
# - style
fast: false
39 changes: 39 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See documentation at https://goreleaser.com
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
goarch:
- amd64
goos:
- linux
- windows
- darwin
ldflags:
- >-
-s -w -X main.version={{.Version}}
-X main.commit={{.Commit}}
-X main.date={{.CommitDate}}
release:
github:
owner: NETWAYS
name: check_microsoft365
archives:
- format: binary
replacements:
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: '{{ .Tag }}-SNAPSHOT-{{.ShortCommit}}'
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

0 comments on commit dfb08d3

Please sign in to comment.