From 3b4171e242d8a72e1433ffc5198a71f74b3f3a13 Mon Sep 17 00:00:00 2001 From: Jauder Ho Date: Tue, 18 Jan 2022 18:56:53 -0800 Subject: [PATCH 1/2] Update release.yml (#867) * Update release.yml This properly caches the build so that rebuilds run much faster. Also update to Go 1.17.6 * Update release.yml Fix formatting --- .github/workflows/release.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37d97752d..de3946dae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: env: - GO_VERSION: 1.17.5 + GO_VERSION: 1.17.6 jobs: release: @@ -31,7 +31,9 @@ jobs: - name: Cache Go modules uses: actions/cache@v2 with: - path: ~/go/pkg/mod + path: | + ~/.cache/go-build + ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- From 033067e49b5b1687c840a9dee7a1c05454b40e6d Mon Sep 17 00:00:00 2001 From: Jauder Ho Date: Tue, 18 Jan 2022 18:57:23 -0800 Subject: [PATCH 2/2] Update .goreleaser.yml (#866) * Update .goreleaser.yml Reorg and changes. - Move release section to the top - Switch to using dashes instead of underscores for naming and filenames - Set gomod proxy to true for reproducible builds - Add archives section to use zip for Windows builds, name Mac builds as macos instead of darwin and also have a top level directory for tar.gz - Add the ability to build .deb and .rpm as part of the release process * Update .goreleaser.yml Disable gomod for goreleaser for now. --- .goreleaser.yml | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index c38d85c15..98ccb918a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,19 @@ # .goreleaser.yml +release: + github: + owner: johnkerl + name: miller + +snapshot: + name_template: SNAPSHOT-{{ .Commit }} + +#gomod: +# proxy: true + before: hooks: - go mod tidy + builds: - env: - CGO_ENABLED=0 @@ -52,10 +64,32 @@ builds: #ldflags: # - -s -w +archives: + - format: tar.gz + wrap_in_directory: true + format_overrides: + - goos: windows + format: zip + replacements: + darwin: macos + name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + files: + - LICENSE + - README.md + +nfpms: + - + id: miller-nfpms + package_name: miller + file_name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + homepage: https://github.com/johnkerl/miller + maintainer: "John Kerl " + description: Miller is like awk, sed, cut, join, and sort for data formats such as CSV, TSV, tabular JSON etc + license: BSD + formats: + - deb + - rpm + checksum: algorithm: sha256 - -release: - github: - owner: johnkerl - name: miller + name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt'