Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,14 @@ jobs:
- name: Setup environment
id: environment
run: |
GOVERSION=$(make go-version)
echo "GOVERSION=${GOVERSION}" >> $GITHUB_ENV
echo "DOCKER_BUILDKIT=1" >> $GITHUB_ENV
echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV

- name: Set up Golang
uses: actions/setup-go@v5
id: go
with:
go-version: ${{ env.GOVERSION }}
go-version-file: .go-version

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -73,17 +71,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup environment
id: environment
run: |
GOVERSION=$(make go-version)
echo "GOVERSION=${GOVERSION}" >> $GITHUB_ENV

- name: Set up Golang
uses: actions/setup-go@v5
id: go
with:
go-version: ${{ env.GOVERSION }}
go-version-file: .go-version

- name: Install Tools and Dependencies
run: make deps
Expand Down Expand Up @@ -113,15 +105,13 @@ jobs:
- name: Setup environment
id: environment
run: |
GOVERSION=$(make go-version)
echo "GOVERSION=${GOVERSION}" >> $GITHUB_ENV
echo "PROMGITHUB_REDIS_ADDR=127.0.0.1:6379" >> $GITHUB_ENV

- name: Set up Golang
uses: actions/setup-go@v5
id: go
with:
go-version: ${{ env.GOVERSION }}
go-version-file: .go-version

- name: Install Tools and Dependencies
run: make deps
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@ jobs:
- name: Setup environment
id: environment
run: |
GOVERSION=$(make go-version)
echo "GOVERSION=${GOVERSION}" >> $GITHUB_ENV
echo "DOCKER_BUILDKIT=1" >> $GITHUB_ENV
echo "DOCKER_CLI_EXPERIMENTAL=enabled" >> $GITHUB_ENV

- name: Set up Golang
uses: actions/setup-go@v5
id: go
with:
go-version: ${{ env.GOVERSION }}
go-version-file: .go-version

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
1 change: 1 addition & 0 deletions .go-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.25.10
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Build stage
FROM golang:1.25.9 AS builder
ARG GO_VERSION=1.25.10
FROM golang:${GO_VERSION} AS builder

# Set non-root user for build
RUN useradd -u 10001 -m builder
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ COLOR_RED := \033[31m
USERNAME := darthfork
TARGET := promgithub
SRC := ./...
GO_VERSION := $(shell cat .go-version)
LDFLAGS := -X main.Version=$(VERSION) -s -w
LDFLAGS_DBG := -X main.enableDebug=true -X main.Version=$(VERSION)
BUILDDIR := build
Expand Down Expand Up @@ -70,7 +71,7 @@ install_tools: deps ## Install development tooling
@./utils/install_tools.sh

container: ## Build promgithub service container
@docker build --progress=plain -t $(CONTAINER_REGISTRY):$(VERSION) .
@docker build --progress=plain --build-arg GO_VERSION=$(GO_VERSION) -t $(CONTAINER_REGISTRY):$(VERSION) .

package-helm-chart: mkdir ## Package promgithub helm chart
@helm package $(CHART_SOURCE) -d $(BUILDDIR)
Expand All @@ -84,6 +85,7 @@ build-cross-platform-binaries: mkdir
build-cross-platform-container: ci-check
@docker buildx build \
--platform $(PLATFORMS)\
--build-arg GO_VERSION=$(GO_VERSION) \
-t $(CONTAINER_REGISTRY):$(VERSION) \
--cache-from type=gha,scope=$(TARGET) \
--cache-to type=gha,mode=max,scope=$(TARGET) \
Expand Down Expand Up @@ -126,7 +128,7 @@ setup-commit-hooks:
@cp .github/hooks/* .git/hooks/

go-version:
@grep '^go ' go.mod | awk '{print $$2}'
@cat .go-version

help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile\
Expand Down
Loading