Skip to content

Commit

Permalink
Repository maintenance (#30)
Browse files Browse the repository at this point in the history
* feat(diff): sort differences to make them stable.

* feat(values): allow non map values to be mapped.

* chore(go): Add darwin arm64 support.

* chore(go): update dependencies.

* chore(go): update tools.

* chore(api): regenerate proto api.

* chore(ci): update golangci-lint to 1.36

* chore(ci): disable ifshort linter.
  • Loading branch information
Zenithar authored Feb 6, 2021
1 parent 23c88dc commit dd6e2c2
Show file tree
Hide file tree
Showing 23 changed files with 291 additions and 204 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.35
version: v1.36

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ linters:
- gci
- exhaustivestruct
- wrapcheck
- ifshort

output:
format: colored-line-number
Expand Down
1 change: 1 addition & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tasks:
cmds:
- rm -rf dist && mkdir dist
- "tar cfJ dist/{{.ARTIFACT}}-darwin-amd64-$RELEASE.tar.xz -C bin {{.ARTIFACT}}-darwin-amd64"
- "tar cfJ dist/{{.ARTIFACT}}-darwin-arm64-$RELEASE.tar.xz -C bin {{.ARTIFACT}}-darwin-arm64"
- "tar cfJ dist/{{.ARTIFACT}}-linux-amd64-$RELEASE.tar.xz -C bin {{.ARTIFACT}}-linux-amd64"
- "tar cfJ dist/{{.ARTIFACT}}-linux-arm7-$RELEASE.tar.xz -C bin {{.ARTIFACT}}-linux-arm7"
- "tar cfJ dist/{{.ARTIFACT}}-linux-arm64-$RELEASE.tar.xz -C bin {{.ARTIFACT}}-linux-arm64"
Expand Down
2 changes: 1 addition & 1 deletion api/gen/go/cso/v1/secret.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/gen/go/cso/v1/validator_api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions api/gen/go/cso/v1/validator_api_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 24 additions & 24 deletions api/gen/go/harp/bundle/v1/bundle.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/gen/go/harp/bundle/v1/bundle_api.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions api/gen/go/harp/bundle/v1/bundle_api_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/gen/go/harp/bundle/v1/patch.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/gen/go/harp/bundle/v1/template.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/gen/go/harp/container/v1/container.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions build/mage/release/formula.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
)

var formulaTemplate = strings.TrimSpace(`# Code generated by Harp build tool
require_relative "./scripts/custom_download_strategies.rb"
class {{ .Formula }} < Formula
desc "{{ .Description }}"
homepage "https://{{ .Repository }}"
Expand All @@ -39,11 +38,14 @@ class {{ .Formula }} < Formula
# Stable build
stable do
if OS.mac?
url "https://{{ .Repository }}/releases/download/cmd%2F{{ .Bin }}%2F{{ .Release }}/{{ .Bin }}-darwin-amd64-{{ .Release }}.tar.xz", :using => EclDownloadStrategy
if OS.mac? && Hardware::CPU.arm?
url "https://{{ .Repository }}/releases/download/cmd%2F{{ .Bin }}%2F{{ .Release }}/{{ .Bin }}-darwin-arm64-{{ .Release }}.tar.xz"
sha256 "{{ sha256file (printf "dist/%s-darwin-arm64-%s.tar.xz" .Bin .Release) }}"
elsif OS.mac?
url "https://{{ .Repository }}/releases/download/cmd%2F{{ .Bin }}%2F{{ .Release }}/{{ .Bin }}-darwin-amd64-{{ .Release }}.tar.xz"
sha256 "{{ sha256file (printf "dist/%s-darwin-amd64-%s.tar.xz" .Bin .Release) }}"
elsif OS.linux?
url "https://{{ .Repository }}/releases/download/cmd%2F{{ .Bin }}%2F{{ .Release }}/{{ .Bin }}-linux-amd64-{{ .Release }}.tar.xz", :using => EclDownloadStrategy
url "https://{{ .Repository }}/releases/download/cmd%2F{{ .Bin }}%2F{{ .Release }}/{{ .Bin }}-linux-amd64-{{ .Release }}.tar.xz"
sha256 "{{ sha256file (printf "dist/%s-linux-amd64-%s.tar.xz" .Bin .Release) }}"
end
end
Expand All @@ -62,7 +64,9 @@ class {{ .Formula }} < Formula
unless build.head?
# Install binaries
if OS.mac?
if OS.mac? && Hardware::CPU.arm?
bin.install "{{ .Bin }}-darwin-arm64" => "{{ .Bin }}"
elsif OS.mac?
bin.install "{{ .Bin }}-darwin-amd64" => "{{ .Bin }}"
elsif OS.linux?
bin.install "{{ .Bin }}-linux-amd64" => "{{ .Bin }}"
Expand All @@ -84,7 +88,9 @@ class {{ .Formula }} < Formula
# Install builded command
cd "src/{{ .Repository }}/cmd/{{ .Bin }}/bin" do
# Install binaries
if OS.mac?
if OS.mac? && Hardware::CPU.arm?
bin.install "{{ .Bin }}-darwin-arm64" => "{{ .Bin }}"
elsif OS.mac?
bin.install "{{ .Bin }}-darwin-amd64" => "{{ .Bin }}"
elsif OS.linux?
bin.install "{{ .Bin }}-linux-amd64" => "{{ .Bin }}"
Expand Down
1 change: 1 addition & 0 deletions cmd/harp-server/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ tasks:
cmds:
- rm -rf dist && mkdir dist
- "tar cfJ dist/{{.ARTIFACT}}-darwin-amd64-$RELEASE.tar.xz -C bin {{.ARTIFACT}}-darwin-amd64"
- "tar cfJ dist/{{.ARTIFACT}}-darwin-arm64-$RELEASE.tar.xz -C bin {{.ARTIFACT}}-darwin-arm64"
- "tar cfJ dist/{{.ARTIFACT}}-linux-amd64-$RELEASE.tar.xz -C bin {{.ARTIFACT}}-linux-amd64"
- "tar cfJ dist/{{.ARTIFACT}}-linux-arm7-$RELEASE.tar.xz -C bin {{.ARTIFACT}}-linux-arm7"
- "tar cfJ dist/{{.ARTIFACT}}-linux-arm64-$RELEASE.tar.xz -C bin {{.ARTIFACT}}-linux-arm64"
Expand Down
4 changes: 2 additions & 2 deletions cmd/harp-server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ require (
github.com/elastic/harp v0.0.0-00010101000000-000000000000
github.com/fatih/color v1.10.0
github.com/go-chi/chi v1.5.1
github.com/google/wire v0.4.0
github.com/google/wire v0.5.0
github.com/gosimple/slug v1.9.0
github.com/magefile/mage v1.11.0
github.com/oklog/run v1.1.0
github.com/spf13/cobra v1.1.1
go.uber.org/zap v1.16.0
google.golang.org/grpc v1.34.1
google.golang.org/grpc v1.35.0
)
Loading

0 comments on commit dd6e2c2

Please sign in to comment.