From 45f1684198460c906467c0b70138e34782d998d7 Mon Sep 17 00:00:00 2001 From: Martin Chodur Date: Fri, 16 Aug 2024 13:06:35 +0200 Subject: [PATCH] feat: add support for arm64 build (#87) * feat: add support for arm64 build Signed-off-by: Martin Chodur * fix: increase golangci lint timeout in CI Signed-off-by: Martin Chodur * feat: add also windows and darwin build Signed-off-by: Martin Chodur * fix: ignore darwin 386 Signed-off-by: Martin Chodur * feat: add test release CI Signed-off-by: Martin Chodur * fix: test releas in ci Signed-off-by: Martin Chodur --------- Signed-off-by: Martin Chodur --- .github/workflows/go.yaml | 3 ++- .github/workflows/test-release.yaml | 26 ++++++++++++++++++++++++++ .gitignore | 1 + .goreleaser.yml | 9 +++++++-- CHANGELOG.md | 3 +++ Makefile | 5 ++++- README.md | 5 +++++ 7 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test-release.yaml diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 195f830..14fd8ea 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -10,7 +10,6 @@ on: pull_request: jobs: - build: runs-on: ubuntu-latest steps: @@ -23,6 +22,8 @@ jobs: - name: Golangci-lint uses: golangci/golangci-lint-action@v6 + with: + args: --timeout 5m0s - name: Build run: make build diff --git a/.github/workflows/test-release.yaml b/.github/workflows/test-release.yaml new file mode 100644 index 0000000..50ec018 --- /dev/null +++ b/.github/workflows/test-release.yaml @@ -0,0 +1,26 @@ +name: Test release + +on: + push: + branches: + - master + - main + pull_request: + +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: "1.22" + + - name: Test + uses: goreleaser/goreleaser-action@v6 + with: + args: release --snapshot --clean diff --git a/.gitignore b/.gitignore index 5d7619c..7ae80e1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ vendor/ *_cache.json promruval +dist/ tmp diff --git a/.goreleaser.yml b/.goreleaser.yml index 54867de..843dab5 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -9,9 +9,15 @@ builds: - CGO_ENABLED=0 goos: - linux + - darwin + - windows goarch: - amd64 - - 386 + - arm64 + - "386" + ignore: + - goos: darwin + goarch: "386" source: enabled: true @@ -37,4 +43,3 @@ dockers: - --label=org.opencontainers.image.url={{.GitURL}} - --label=org.opencontainers.image.documentation={{.GitURL}} - --label=org.opencontainers.image.source={{replace .GitURL ".git" "" }} - diff --git a/CHANGELOG.md b/CHANGELOG.md index cf8160b..69baec8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.2.0] +- Added: Build of windows and darwin and support for arm architectures in CI + ## [3.1.0] - 2024-08-14 - Added: New validator `expressionUsesOnlyAllowedLabelsForMetricRegexp` to check if the expression uses only allowed labels for the metric. diff --git a/Makefile b/Makefile index e4a5603..54c6678 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ CACHE_FILE := .promruval_cache.json PROMRUVAL_BIN := ./promruval -all: clean deps lint build test e2e-test +all: clean deps lint build test e2e-test test-release $(TMP_DIR): mkdir -p $(TMP_DIR) @@ -61,3 +61,6 @@ clean: .PHONY: deps deps: go mod tidy && go mod verify + +test-release: + goreleaser release --snapshot --clean diff --git a/README.md b/README.md index f9802d8..d9e49d0 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,11 @@ or make build ``` +#### Supported platforms +Promruval is tested only on the linux amd64. It should work on other platforms as well, but it's not tested. +Each release contains the binaries for linux, darwin and windows and different architectures (amd64, arm64). +So please use them with caution and report any issues. + ### Usage ```bash