From e4a9954c330089f17344ebfc892059366f4a0d2d Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani Date: Fri, 16 Dec 2022 21:10:25 +0000 Subject: [PATCH 1/2] ci: update release workflow to properly include the version Pass the tag and short-sha to VERSION_FULL in the Makefile during release build. Signed-off-by: Ramkumar Chinchani --- .github/workflows/build.yaml | 4 +++- Makefile | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 997ebfa6..e561a0a8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,6 +25,8 @@ jobs: name: "golang ${{ matrix.go-version }} privilege ${{ matrix.privilege-level }}" steps: - uses: actions/checkout@v3 + - uses: benjlevesque/short-sha@v2.1 + id: short-sha - name: Set up golang ${{ matrix.go-version }} uses: actions/setup-go@v3 with: @@ -48,7 +50,7 @@ jobs: - if: github.event_name == 'release' && github.event.action == 'published' name: Build and test released version run: | - make check VERSION=${{ github.event.release.tag_name }}-${{ github.sha }} PRIVILEGE_LEVEL=${{ matrix.privilege-level }} + make check VERSION_FULL=${{ github.event.release.tag_name }}-${{ steps.short-sha.outputs.sha }} PRIVILEGE_LEVEL=${{ matrix.privilege-level }} env: REGISTRY_URL: localhost:5000 - uses: actions/cache@v3 diff --git a/Makefile b/Makefile index d1190622..8959f889 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ GO_SRC=$(shell find . -path ./.build -prune -false -o -name \*.go) VERSION?=$(shell git describe --tags || git rev-parse HEAD) -VERSION_FULL=$(if $(shell git status --porcelain --untracked-files=no),$(VERSION)-dirty,$(VERSION)) +VERSION_FULL?=$(if $(shell git status --porcelain --untracked-files=no),$(VERSION)-dirty,$(VERSION)) LXC_VERSION?=$(shell pkg-config --modversion lxc) From 0b45a922bf891aa85379880ccdbe4d16146dd4bc Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani Date: Fri, 16 Dec 2022 21:20:02 +0000 Subject: [PATCH 2/2] docs: update README.md with CodeQL badge Signed-off-by: Ramkumar Chinchani --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9010f37d..306cb849 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

-# stacker [![Build Status](https://github.com/project-stacker/stacker/workflows/ci/badge.svg?branch=master)](https://github.com/project-stacker/stacker/actions) [![Go Reference](https://pkg.go.dev/badge/stackerbuild.io/stacker.svg)](https://pkg.go.dev/stackerbuild.io/stacker) +# stacker [![Build Status](https://github.com/project-stacker/stacker/workflows/ci/badge.svg?branch=main)](https://github.com/project-stacker/stacker/actions) [![CodeQL](https://github.com/project-stacker/stacker/workflows/CodeQL/badge.svg)](https://github.com/project-stacker/stacker/actions?query=workflow%3ACodeQL) [![Go Reference](https://pkg.go.dev/badge/stackerbuild.io/stacker.svg)](https://pkg.go.dev/stackerbuild.io/stacker) Stacker is a tool for building OCI images natively via a declarative yaml format.