Skip to content

Commit

Permalink
Change CI to use goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
martialblog committed Feb 27, 2023
1 parent 4da5124 commit d87224f
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 39 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Go
on:
push:
branches: [ master ]
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.19

- name: Vet
run: go vet ./...

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

- name: Build
run: go build -v .

- 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 }}
39 changes: 0 additions & 39 deletions .github/workflows/go.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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_sentinelone
draft: true
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 d87224f

Please sign in to comment.