diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8b2c190 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: goreleaser + +on: + push: + tags: + - "v*" + +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@v5 + with: + go-version: stable + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: "~> v2" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_PAT: ${{ secrets.GH_PAT }} + diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..600507c --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,61 @@ +version: 2 + +before: + hooks: + - go mod tidy + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + main: ./main.go + binary: ws + ldflags: + - -s -w -X main.version={{.Version}} + +archives: + - format: tar.gz + 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 }} + format_overrides: + - goos: windows + format: zip + +brews: + - repository: + owner: zmoog + name: homebrew-ws + token: "{{ .Env.GH_PAT }}" + directory: Casks + homepage: "https://github.com/zmoog/ws" + description: "CLI tool and Go library to interact with Wavin Sentio floor heating systems" + license: "MIT" + install: | + bin.install "ws" + test: | + system "#{bin}/ws", "--version" + +checksum: + name_template: 'checksums.txt' + +snapshot: + version_template: "{{ incpatch .Version }}-next" + +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + diff --git a/README.md b/README.md index bc0342f..38f8f54 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,14 @@ CLI tool and Go library to interact with Wavin Sentio floor heating systems. ## Installation +### Homebrew (macOS and Linux) + +```sh +brew install zmoog/ws/ws +``` + +### Go Install + ```sh go install github.com/zmoog/ws/v2@latest ```