-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
nodify: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.16' | ||
- name: GoReleaser Action | ||
uses: goreleaser/[email protected] | ||
with: | ||
install-only: true | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ testbin/* | |
*.swp | ||
*.swo | ||
*~ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
checksum: | ||
name_template: '{{ .ProjectName }}_checksums.txt' | ||
dockers: | ||
- image_templates: | ||
- "juanlee/nodify-controller:{{ .Tag }}" | ||
- "juanlee/nodify-controller:latest" | ||
dockerfile: Dockerfile | ||
extra_files: | ||
- go.mod | ||
- go.sum | ||
- main.go | ||
- api | ||
- controllers | ||
- image_templates: | ||
- "juanlee/nodify-daemon:{{ .Tag }}" | ||
- "juanlee/nodify-daemon:latest" | ||
dockerfile: Dockerfile.daemon | ||
extra_files: | ||
- daemon/go.mod | ||
- daemon/go.sum | ||
- daemon/main.go | ||
docker_manifests: | ||
- name_template: "juanlee/nodify-daemon:{{ .Tag }}" | ||
image_templates: | ||
- "juanlee/nodify-daemon:{{ .Tag }}" | ||
- name_template: "juanlee/nodify-daemon:latest" | ||
image_templates: | ||
- "juanlee/nodify-daemon:{{ .Tag }}" | ||
archives: | ||
- replacements: | ||
linux: Linux | ||
amd64: x86_64 | ||
snapshot: | ||
name_template: "{{ .Tag }}-{{ .ShortCommit }}" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,6 +76,10 @@ docker-push: | |
docker push ${IMG} | ||
docker push ${DAEMON_IMG} | ||
|
||
# Release | ||
release: goreleaser | ||
$(GORELEASER) --snapshot --skip-publish --rm-dist | ||
|
||
# Download controller-gen locally if necessary | ||
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen | ||
controller-gen: | ||
|
@@ -91,6 +95,11 @@ GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint | |
golangci-lint: | ||
$(call go-get-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/[email protected]) | ||
|
||
# Download goreleaser locally if necessary | ||
GORELEASER = $(shell pwd)/bin/goreleaser | ||
goreleaser: | ||
$(call go-get-tool,$(GORELEASER),github.com/goreleaser/[email protected]) | ||
|
||
# go-get-tool will 'go get' any package $2 and install it to $1. | ||
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
define go-get-tool | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters