Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #448 from simonswine/20221207_fix-release-target
Browse files Browse the repository at this point in the history
Goreleaser fixes
  • Loading branch information
simonswine authored Dec 7, 2022
2 parents 956424d + 87493d1 commit ee1103b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.18.7, 1.19.2]
go-version: [1.18.9, 1.19.4]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
lint:
strategy:
matrix:
go-version: [1.18.7, 1.19.2]
go-version: [1.18.9, 1.19.4]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Set up go
uses: actions/setup-go@v2
with:
go-version: 1.18.7
go-version: 1.19.4
- name: Build image Phlare
run: make docker-image/phlare/build "BUILDX_ARGS=--cache-from=type=gha --cache-to=type=gha"

Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
- name: Set up go
uses: actions/setup-go@v2
with:
go-version: 1.18.7
go-version: 1.19.4
- name: Login to GCR
uses: docker/login-action@v2
with:
Expand Down
7 changes: 4 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
project_name: phlare
# before:
# hooks:
# - make go/mod lint generate go/test
before:
hooks:
# This hook ensures that goreleaser uses the correct go version for a Phlare release
- sh -euc "go version | grep "go version go1.19.4 " || { echo "Unexpected go version"; exit 1; }"
builds:
- env:
- CGO_ENABLED=0
Expand Down
4 changes: 2 additions & 2 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins:
uri: https://github.com/trunk-io/plugins
runtimes:
enabled:
- go@1.19.3
- go@1.19.4
- node@16.14.2
- python@3.10.3
lint:
Expand All @@ -23,7 +23,7 @@ lint:
- flake8@5.0.4
- git-diff-check
- gitleaks@8.15.0
- gofmt@1.19.3
- gofmt@1.19.4
- golangci-lint@1.50.1
- goreleaser-check@1.12.3
- hadolint@2.10.0
Expand Down
24 changes: 16 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,32 @@ build: go/bin plugin/datasource/build ## Build all packages


.PHONY: release
release: ## Create a release
release/prereq: $(BIN)/goreleaser ## Ensure release pre requesites are met
# remove local git tags coming from helm chart release
git tag -d $(shell git tag -l "phlare-*")
# ensure there is a docker cli command
@which docker || { apt-get update && apt-get install -y docker.io; }
@docker info > /dev/null

.PHONY: release
release: release/prereq ## Create a release
$(GORELEASER_ENV) \
$(BIN)/goreleaser release -p=16 --rm-dist
$(BIN)/goreleaser release -p=$(shell nproc) --rm-dist

.PHONY: release/prepare
release/prepare: ## Prepare a release
release/prepare: release/prereq ## Prepare a release
$(GORELEASER_ENV) \
$(BIN)/goreleaser release -p=16 --rm-dist --snapshot
$(BIN)/goreleaser release -p=$(shell nproc) --rm-dist --snapshot

.PHONY: release/build/all
release/build/all: $(BIN)/goreleaser ## Build all release binaries
release/build/all: release/prereq ## Build all release binaries
$(GORELEASER_ENV) \
$(BIN)/goreleaser build -p 16 --snapshot --rm-dist
$(BIN)/goreleaser build -p=$(shell nproc) --rm-dist --snapshot

.PHONY: release/build
release/build: $(BIN)/goreleaser ## Build current platform release binaries
release/build: release/prereq ## Build current platform release binaries
$(GORELEASER_ENV) \
$(BIN)/goreleaser build -p 16 --snapshot --rm-dist --single-target
$(BIN)/goreleaser build -p=$(shell nproc) --rm-dist --snapshot --single-target

.PHONY: go/deps
go/deps:
Expand Down
2 changes: 1 addition & 1 deletion cmd/phlare/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.16.2
FROM alpine:3.16.3

RUN apk add --no-cache ca-certificates

Expand Down
2 changes: 1 addition & 1 deletion grafana/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ COPY grafana/flamegraph/src/ flamegraph/src/
RUN cd phlare-datasource && yarn build
RUN cd flamegraph && yarn build

FROM golang:1.19.2-alpine as go-builder
FROM golang:1.19.4-alpine as go-builder

WORKDIR /build
COPY grafana/phlare-datasource/go.mod grafana/phlare-datasource/go.sum grafana/phlare-datasource/Magefile.go grafana/phlare-datasource/
Expand Down

0 comments on commit ee1103b

Please sign in to comment.