Skip to content

Commit

Permalink
feat: get go mod version for build
Browse files Browse the repository at this point in the history
  • Loading branch information
y-eight committed Nov 30, 2023
1 parent 8180e83 commit 2a67673
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}
- name: Get go mod version
id: go-version
run: go mod edit -json | jq -r .Go | { read value; echo "value=$value"; } >> "$GITHUB_OUTPUT"

- name: Build image
id: build
Expand All @@ -59,7 +63,9 @@ jobs:
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: VERSION=${{ github.ref_name }}
build-args: |
GO_VERSION=${{ steps.go-version.outputs.value }}
VERSION=${{ github.ref_name }}
- name: Set image ref
id: image-ref
Expand Down Expand Up @@ -96,5 +102,7 @@ jobs:
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: VERSION=${{ github.ref_name }}
build-args: |
GO_VERSION=${{ steps.go-version.outputs.value }}
VERSION=${{ github.ref_name }}
if: inputs.push

0 comments on commit 2a67673

Please sign in to comment.