Skip to content

Commit

Permalink
feat: add support for arm64 build (#87)
Browse files Browse the repository at this point in the history
* feat: add support for arm64 build

Signed-off-by: Martin Chodur <m.chodur@seznam.cz>

* fix: increase golangci lint timeout in CI

Signed-off-by: Martin Chodur <m.chodur@seznam.cz>

* feat: add also windows and darwin build

Signed-off-by: Martin Chodur <m.chodur@seznam.cz>

* fix: ignore darwin 386

Signed-off-by: Martin Chodur <m.chodur@seznam.cz>

* feat: add test release CI

Signed-off-by: Martin Chodur <m.chodur@seznam.cz>

* fix: test releas in ci

Signed-off-by: Martin Chodur <m.chodur@seznam.cz>

---------

Signed-off-by: Martin Chodur <m.chodur@seznam.cz>
  • Loading branch information
FUSAKLA authored Aug 16, 2024
1 parent 6cae0e1 commit 45f1684
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
pull_request:

jobs:

build:
runs-on: ubuntu-latest
steps:
Expand All @@ -23,6 +22,8 @@ jobs:

- name: Golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --timeout 5m0s

- name: Build
run: make build
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/test-release.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ vendor/

*_cache.json
promruval
dist/
tmp
9 changes: 7 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" "" }}

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -61,3 +61,6 @@ clean:
.PHONY: deps
deps:
go mod tidy && go mod verify

test-release:
goreleaser release --snapshot --clean
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 45f1684

Please sign in to comment.