Skip to content

Commit

Permalink
misc: refactoring of build process and resolve issue with copy sa cyc…
Browse files Browse the repository at this point in the history
…le (non live-rotate) (#41)

* build: use latest goreleaser

* feat: add dedupe command

* build: remove artifact cleanup action

* feat(sync): add daisy-chain parameter

* chore: module updates

* refactor: dep updates and forced 60sec wait in daisy chain sync mode

* build: no tgz artifacts

* build: dont build arm

* fix(uploader/copy): correctly determine non sa usage

* fix(pathutils): return error from filepath.Walk

Co-authored-by: Eric Nemchik <[email protected]>
  • Loading branch information
l3uddz and nemchik authored Mar 7, 2021
1 parent 9c98028 commit fa4b368
Show file tree
Hide file tree
Showing 15 changed files with 226 additions and 252 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
# dependencies
- name: dependencies
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b /usr/local/bin v1.24.0
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sudo sh -s -- -b /usr/local/bin
# checkout
Expand All @@ -33,15 +32,12 @@ jobs:
- name: go
uses: actions/setup-go@v1
with:
go-version: 1.15
go-version: 1.16

- name: go_version
run: go version

# test
# - name: test
# run: |
# make test
- name: go info
run: |
go version
go env
# cache
- name: cache
Expand All @@ -57,6 +53,10 @@ jobs:
run: |
make vendor
# git status
- name: git status
run: git status

# build
- name: build
if: startsWith(github.ref, 'refs/tags/') == false
Expand All @@ -76,16 +76,10 @@ jobs:
uses: actions/upload-artifact@v2-preview
with:
name: build_linux
path: dist/*linux*.tar.gz
path: dist/*linux*

- name: artifact_darwin
uses: actions/upload-artifact@v2-preview
with:
name: build_darwin
path: dist/*darwin*.tar.gz

# - name: artifact_windows
# uses: actions/upload-artifact@v2-preview
# with:
# name: build_windows
# path: dist/*windows*.zip
path: dist/*darwin*
27 changes: 0 additions & 27 deletions .github/workflows/lint.yml

This file was deleted.

10 changes: 4 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ builds:
goos:
- linux
- darwin
# - windows
goarch:
- amd64
- arm64
ldflags:
- -s -w
- -X "github.com/l3uddz/crop/runtime.Version={{ .Version }}"
Expand All @@ -21,11 +21,9 @@ builds:

# Archive
archives:
- name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: "tar.gz"
format_overrides:
- goos: windows
format: zip
-
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: "binary"

# Checksum
checksum:
Expand Down
22 changes: 4 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,14 @@ TIMESTAMP = $(shell date +%s)
VERSION ?= 0.0.0-dev

# Deps
.PHONY: check_golangci
check_golangci:
@command -v golangci-lint >/dev/null || (echo "golangci-lint is required."; exit 1)
.PHONY: check_goreleaser
check_goreleaser:
@command -v goreleaser >/dev/null || (echo "goreleaser is required."; exit 1)

.PHONY: all ## Run tests, linting and build
all: test lint build

.PHONY: test-all ## Run tests and linting
test-all: test lint

.PHONY: test
test: ## Run tests
@echo "*** go test ***"
go test -cover -v -race ${GO_PACKAGES}

.PHONY: lint
lint: check_golangci ## Run linting
@echo "*** golangci-lint ***"
golangci-lint run --timeout 10m
go test ./... -cover -v -race ${GO_PACKAGES}

.PHONY: vendor
vendor: ## Vendor files and tidy go.mod
Expand Down Expand Up @@ -73,15 +59,15 @@ fetch: ## Fetch vendor files
go mod vendor

.PHONY: release
release: check_goreleaser #fetch ## Generate a release, but don't publish
release: check_goreleaser ## Generate a release, but don't publish
goreleaser --skip-validate --skip-publish --rm-dist

.PHONY: publish
publish: check_goreleaser #fetch ## Generate a release, and publish
publish: check_goreleaser ## Generate a release, and publish
goreleaser --rm-dist

.PHONY: snapshot
snapshot: check_goreleaser #fetch ## Generate a snapshot release
snapshot: check_goreleaser ## Generate a snapshot release
goreleaser --snapshot --skip-validate --skip-publish --rm-dist

.PHONY: help
Expand Down
47 changes: 24 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
module github.com/l3uddz/crop

go 1.14
go 1.16

require (
github.com/DataDog/zstd v1.4.5 // indirect
github.com/ReneKroon/ttlcache v1.7.0
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/DataDog/zstd v1.4.8 // indirect
github.com/ReneKroon/ttlcache/v2 v2.3.0
github.com/StackExchange/wmi v0.0.0-20210224194228-fe8f1750fd46 // indirect
github.com/blang/semver v3.5.1+incompatible
github.com/dgraph-io/badger/v2 v2.2007.2 // indirect
github.com/dgraph-io/ristretto v0.0.3 // indirect
github.com/dustin/go-humanize v1.0.0
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-cmd/cmd v1.2.1
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/gofiber/fiber v1.14.6
github.com/gofiber/recover v0.1.2
github.com/golang/snappy v0.0.2 // indirect
github.com/gorilla/schema v1.2.0 // indirect
github.com/klauspost/compress v1.11.0 // indirect
github.com/go-cmd/cmd v1.3.0
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/gofiber/fiber/v2 v2.5.0
github.com/golang/protobuf v1.4.3 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/klauspost/compress v1.11.12 // indirect
github.com/magefile/mage v1.11.0 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/nightlyone/lockfile v1.0.0
github.com/onsi/ginkgo v1.12.0 // indirect
github.com/onsi/gomega v1.9.0 // indirect
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/pkg/errors v0.9.1
github.com/rhysd/go-github-selfupdate v1.2.2
github.com/shirou/gopsutil v2.20.8+incompatible
github.com/sirupsen/logrus v1.6.0
github.com/rhysd/go-github-selfupdate v1.2.3
github.com/shirou/gopsutil v3.21.2+incompatible
github.com/sirupsen/logrus v1.8.0
github.com/sony/sonyflake v1.0.0 // indirect
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5 // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/spf13/cobra v1.1.3
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/valyala/fasthttp v1.22.0 // indirect
github.com/x-cray/logrus-prefixed-formatter v0.5.2
github.com/yale8848/gorpool v0.1.0
github.com/zippoxer/bow v0.0.0-20200229231453-bf1012ae7ab9
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
golang.org/x/net v0.0.0-20200925080053-05aa5d4ee321 // indirect
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect
golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93 // indirect
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.3.0
gopkg.in/yaml.v2 v2.4.0
)
Loading

0 comments on commit fa4b368

Please sign in to comment.