Skip to content

Commit 6b63d87

Browse files
committed
minor versions of workflow actions bumped and image build step fixed
- build args added to provide correct metadata for the build
1 parent c7657a6 commit 6b63d87

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

.github/workflows/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ The project uses two main workflows that work together to ensure code quality an
7878
- Checks out code
7979
- Installs [mdq](https://github.com/yshavit/mdq) tool for changelog parsing
8080
- Populates environment variables:
81+
- `BUILD_DATE` - Current UTC timestamp
8182
- `GIT_TAG` - Version extracted from CHANGELOG.md
8283
- `GIT_COMMIT` - Current commit SHA
84+
- `GO_VERSION` - Go version from go.mod
8385
- Validates environment variables:
8486
- Verifies version format matches `X.Y.Z` pattern
8587
- Checks that the git tag doesn't already exist
@@ -89,7 +91,7 @@ The project uses two main workflows that work together to ensure code quality an
8991
- version tag (e.g., `1.2.3`)
9092
- `release` tag
9193
- `latest` tag
92-
- Builds and pushes `linux/amd64` Docker image with build argument:
94+
- Builds and pushes `linux/amd64` Docker image with build arguments:
9395
- `BUILDER_VERSION` - Go builder image version
9496
- `GIT_COMMIT` - Current commit SHA
9597
- `GIT_TAG` - Version from changelog
@@ -191,12 +193,12 @@ The complete release process follows this flow:
191193
## Dependencies
192194

193195
- **Actions Used:**
194-
- `actions/checkout@v5.0.0` - Code checkout
195-
- `actions/setup-go@v6.0.0` - Go environment setup
196+
- `actions/checkout@v5.0.1` - Code checkout
197+
- `actions/setup-go@v6.2.0` - Go environment setup
196198
- `golangci/golangci-lint-action@v8.0.0` - Static analysis
197-
- `docker/login-action@v3.6.0` - Container registry authentication
198-
- `docker/metadata-action@v5.8.0` - Docker metadata generation
199-
- `docker/build-push-action@v6.18.0` - Container building and pushing
199+
- `docker/login-action@v3.7.0` - Container registry authentication
200+
- `docker/metadata-action@v5.10.0` - Docker metadata generation
201+
- `docker/build-push-action@v6.19.2` - Container building and pushing
200202
- `ncipollo/release-action@v1.20.0` - GitHub release creation
201203

202204
- **External Tools:**

.github/workflows/build-image.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
packages: 'write'
1414
steps:
1515
- name: 'checkout code'
16-
uses: 'actions/checkout@v5.0.0'
16+
uses: 'actions/checkout@v5.0.1'
1717
with:
1818
fetch-depth: 0
1919
- name: 'install mdq'
@@ -63,7 +63,7 @@ jobs:
6363
exit 1
6464
fi
6565
- name: 'setup go'
66-
uses: 'actions/setup-go@v6.0.0'
66+
uses: 'actions/setup-go@v6.2.0'
6767
with:
6868
go-version: "${{ env.GO_VERSION }}"
6969
- name: 'golangci-lint'
@@ -98,21 +98,21 @@ jobs:
9898
./check -c in -v | grep -q "${GIT_TAG}"
9999
./check -c out -v | grep -q "${GIT_TAG}"
100100
- name: 'container registry login'
101-
uses: 'docker/login-action@v3.6.0'
101+
uses: 'docker/login-action@v3.7.0'
102102
with:
103103
password: "${{ secrets.GITHUB_TOKEN }}"
104104
registry: 'ghcr.io'
105105
username: "${{ github.actor }}"
106106
- name: 'fetch metadata for the image build'
107107
id: 'meta'
108-
uses: 'docker/metadata-action@v5.8.0'
108+
uses: 'docker/metadata-action@v5.10.0'
109109
with:
110110
images: "ghcr.io/${{ github.repository }}"
111111
tags: |
112112
type=raw,value=${{ env.GIT_TAG }}
113113
type=raw,value=draft
114114
- name: 'build and push image'
115-
uses: 'docker/build-push-action@v6.18.0'
115+
uses: 'docker/build-push-action@v6.19.2'
116116
with:
117117
context: '.'
118118
build-args: |

.github/workflows/publish-release.yaml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
packages: 'write'
1414
steps:
1515
- name: 'checkout code'
16-
uses: 'actions/checkout@v5.0.0'
16+
uses: 'actions/checkout@v5.0.1'
1717
- name: 'install mdq'
1818
shell: 'bash'
1919
run: |
@@ -29,9 +29,11 @@ jobs:
2929
#!/usr/bin/env bash
3030
set -euo pipefail
3131
32+
BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
3233
GIT_TAG="$(./mdq -o json "#" CHANGELOG.md | jq -r .items[0].section.body[0].section.title)"
3334
GIT_COMMIT="$(git rev-parse HEAD)"
3435
GO_VERSION="$(go list -f {{.GoVersion}} -m)"
36+
echo "BUILD_DATE=${BUILD_DATE}" >> "$GITHUB_ENV"
3537
echo "GIT_TAG=${GIT_TAG}" >> "$GITHUB_ENV"
3638
echo "GIT_COMMIT=${GIT_COMMIT}" >> "$GITHUB_ENV"
3739
echo "GO_VERSION=${GO_VERSION}" >> "$GITHUB_ENV"
@@ -57,29 +59,33 @@ jobs:
5759
exit 1
5860
fi
5961
- name: 'setup go'
60-
uses: 'actions/setup-go@v6.0.0'
62+
uses: 'actions/setup-go@v6.2.0'
6163
with:
6264
go-version: "${{ env.GO_VERSION }}"
6365
- name: 'container registry login'
64-
uses: 'docker/login-action@v3.6.0'
66+
uses: 'docker/login-action@v3.7.0'
6567
with:
6668
password: "${{ secrets.GITHUB_TOKEN }}"
6769
registry: 'ghcr.io'
6870
username: "${{ github.actor }}"
6971
- name: 'fetch metadata for the image build'
7072
id: 'meta'
71-
uses: 'docker/metadata-action@v5.8.0'
73+
uses: 'docker/metadata-action@v5.10.0'
7274
with:
7375
images: "ghcr.io/${{ github.repository }}"
7476
tags: |
7577
type=raw,value=${{ env.GIT_TAG }}
7678
type=raw,value=release
7779
type=raw,value=latest
7880
- name: 'build and push image'
79-
uses: 'docker/build-push-action@v6.18.0'
81+
uses: 'docker/build-push-action@v6.19.2'
8082
with:
8183
context: '.'
82-
build-args: "BUILDER_VERSION=${{ env.GO_VERSION }}-bookworm"
84+
build-args: |
85+
BUILDER_VERSION=${{ env.GO_VERSION }}-bookworm
86+
GIT_COMMIT=${{ env.GIT_COMMIT }}
87+
GIT_TAG=${{ env.GIT_TAG }}
88+
BUILD_DATE=${{ env.BUILD_DATE }}
8389
labels: "${{ steps.meta.outputs.labels }}"
8490
tags: "${{ steps.meta.outputs.tags }}"
8591
platforms: 'linux/amd64'

0 commit comments

Comments
 (0)