Skip to content

Commit

Permalink
ci: update release workflow to properly include the version (project-…
Browse files Browse the repository at this point in the history
…stacker#369)

* 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 <[email protected]>

* docs: update README.md with CodeQL badge

Signed-off-by: Ramkumar Chinchani <[email protected]>
  • Loading branch information
rchincha authored Dec 16, 2022
1 parent b5898bc commit 7e78740
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
name: "golang ${{ matrix.go-version }} privilege ${{ matrix.privilege-level }}"
steps:
- uses: actions/checkout@v3
- uses: benjlevesque/[email protected]
id: short-sha
- name: Set up golang ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</p>


# 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.

Expand Down

0 comments on commit 7e78740

Please sign in to comment.