From aa656722e3d700eb2939ffb0a7c96e1e40eb7ce6 Mon Sep 17 00:00:00 2001 From: Evan Wies Date: Tue, 4 Jun 2024 16:15:38 -0400 Subject: [PATCH] [ci] Add .goreleaser.yaml --- .github/workflows/go.yml | 4 +-- .github/workflows/release.yml | 46 +++++++++++++++++++++++++++ .gitignore | 3 +- .goreleaser.yaml | 59 +++++++++++++++++++++++++++++++++++ README.md | 4 +-- 5 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2dc47f1..14e2952 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,10 +14,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: '1.22' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4b2015b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: goreleaser + +on: + pull_request: + push: + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: '>=1.22.3' + + - name: Build with GoReleaser on main + uses: goreleaser/goreleaser-action@v5 + if: github.ref == 'refs/heads/main' + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: latest + args: build --clean --snapshot + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} + + - name: Publish with GoReleaser on tags + uses: goreleaser/goreleaser-action@v5 + if: startsWith(github.ref, 'refs/tags/') + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 25388f5..0bc5c17 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ .task .DS_Store -bin/ \ No newline at end of file +bin/ +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..4e1ceb6 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,59 @@ +# dbn-go .goreleaser.yml +# Make sure to check the documentation at https://goreleaser.com + +version: 1 + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" + +release: + github: + owner: NimbleMarkets + name: dbn-go + +brews: + - homepage: https://github.com/NimbleMarkets/dbn-go + description: "Golang tooling for DataBento's APIs and DBN format" + folder: Formula + tap: + owner: NimbleMarkets + name: homebrew-tap + branch: main + token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + commit_author: + name: goreleaserbot + email: goreleaserbot@nimble.markets + install: | + bin.install "./bin/dbn-go-hist" + bin.install "./bin/dbn-go-live" diff --git a/README.md b/README.md index 812aab7..a8cdd4c 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ Code Of Conduct

-**Golang bindings to Databento's DBN** +**Golang tooling for DataBento's APIs and DBN format** -This repository contains Golang bindings to [Databento's](https://databento.com) file format [Databento Binary Encoding (DBN)](https://databento.com/docs/knowledge-base/new-users/dbn-encoding). +This repository contains Golang bindings to [Databento's](https://databento.com) file format [Databento Binary Encoding (DBN)](https://databento.com/docs/knowledge-base/new-users/dbn-encoding), [Historical API](#historical-api), and [Live API](#live-api). It also includes tools to interact with these services. * [Library Usage](#library-usage) * [Reading DBN Files](#reading-dbn-files)