feature: add multiarch
Signed-off-by: shaowenchen <mail@chenshaowen.com>
This commit is contained in:
parent
131721e948
commit
31b9cc63f4
|
@ -0,0 +1,39 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release*'
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.14
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.14
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
make build-multiarch
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: github.event_name == 'push'
|
||||
with:
|
||||
name: kubeye
|
||||
path: dist/*.zip
|
|
@ -36,3 +36,4 @@ Session.vim
|
|||
|
||||
# Generate by makefile
|
||||
bin
|
||||
dist
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
# Visit https://goreleaser.com for documentation on how to customize this
|
||||
# behavior.
|
||||
before:
|
||||
hooks:
|
||||
# this is just an example and not a requirement for provider building/publishing
|
||||
# - go mod tidy
|
||||
builds:
|
||||
- env:
|
||||
# goreleaser does not work with CGO, it could also complicate
|
||||
# usage by users in CI/CD systems like Terraform Cloud where
|
||||
# they are unable to install libraries.
|
||||
- CGO_ENABLED=0
|
||||
mod_timestamp: '{{ .CommitTimestamp }}'
|
||||
flags:
|
||||
- -trimpath
|
||||
ldflags:
|
||||
- '-s -w -X main.version={{.Version}}'
|
||||
goos:
|
||||
- freebsd
|
||||
- windows
|
||||
- linux
|
||||
- darwin
|
||||
goarch:
|
||||
- amd64
|
||||
- '386'
|
||||
- arm
|
||||
- arm64
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: '386'
|
||||
binary: '{{ .ProjectName }}'
|
||||
snapshot:
|
||||
name_template: ""
|
||||
archives:
|
||||
- format: zip
|
||||
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
|
||||
checksum:
|
||||
name_template: '{{ .ProjectName }}_checksum.txt'
|
||||
algorithm: sha256
|
||||
changelog:
|
||||
skip: true
|
8
Makefile
8
Makefile
|
@ -17,4 +17,10 @@ clean:
|
|||
|
||||
# uninstall kubeye from local computer
|
||||
uninstall:
|
||||
rm /usr/local/bin/${BINARY} 2> /dev/null
|
||||
rm /usr/local/bin/${BINARY} 2> /dev/null
|
||||
|
||||
install-goreleaser:
|
||||
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
|
||||
|
||||
build-multiarch: install-goreleaser
|
||||
./bin/goreleaser release --snapshot --skip-publish --rm-dist
|
Loading…
Reference in New Issue