Skip to content

Commit

Permalink
CI/config for releases (#16)
Browse files Browse the repository at this point in the history
* Local build target, CI/config for releases

* Removing makefile changes
  • Loading branch information
J0HNB0Y authored Dec 6, 2021
1 parent ccc1f1a commit 7bbfdbd
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2021 Hewlett Packard Enterprise Development LP
name: release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/[email protected]
-
name: Unshallow
run: git fetch --prune --unshallow
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
-
name: Build and Release
uses: goreleaser/[email protected]
with:
version: latest
args: release -f .goreleaser.yml --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
36 changes: 36 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2021 Hewlett Packard Enterprise Development LP
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
binary: '{{ .ProjectName }}_v{{ .Version }}'
archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
files:
- none*
checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256
changelog:
skip: false

0 comments on commit 7bbfdbd

Please sign in to comment.