Skip to content

Commit 747076e

Browse files
committed
fix: embed version in branch Docker images
1 parent 533d615 commit 747076e

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/docker.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ jobs:
4343
steps:
4444
- name: Checkout repository
4545
uses: actions/checkout@v7.0.1
46+
with:
47+
fetch-depth: 0
48+
49+
- name: Get version
50+
id: version
51+
run: echo "version=$(git describe --tags --always)" >> "$GITHUB_OUTPUT"
4652

4753
- name: Set up Docker Buildx
4854
uses: docker/setup-buildx-action@v4.3.0
@@ -76,6 +82,8 @@ jobs:
7682
push: true
7783
tags: ${{ steps.meta.outputs.tags }}
7884
labels: ${{ steps.meta.outputs.labels }}
85+
build-args: |
86+
VERSION=${{ steps.version.outputs.version }}
7987
cache-from: type=gha
8088
cache-to: type=gha,mode=max
8189
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7,linux/arm/v6

.github/workflows/test.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ jobs:
6060
- uses: actions/checkout@v7.0.1
6161

6262
- name: Build Docker image
63-
run: docker build -t neutrino-api:test ./neutrino_server
63+
run: docker build --build-arg VERSION=ci-test -t neutrino-api:test ./neutrino_server
64+
65+
- name: Test Docker image version
66+
run: |
67+
test "$(docker run --rm --entrypoint neutrinod neutrino-api:test -version)" = \
68+
"neutrinod ci-test"
6469
6570
- name: Test Docker image runs
6671
run: |

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Embed the Git tag or commit description in branch Docker images instead of
13+
reporting the fallback `dev` version.
14+
1015
## [1.7.0] - 2026-08-24
1116

1217
### Changed

0 commit comments

Comments
 (0)