Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

test: release #1366

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 31 additions & 129 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,125 +10,31 @@ permissions:
contents: write

jobs:
verification:
name: Verification
uses: ./.github/workflows/reusable-verification.yml
secrets: inherit

build_and_push:
needs:
- verification
- artifacts
- publish_helm
name: Build & Push
uses: ./.github/workflows/reusable-build-and-push.yml
with:
image_tag: ${{ github.ref_name }}
push: true
use_release_repository: true

publish_helm:
needs: verification
name: Publish Helm Chart
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Create Helm Chart package
env:
VERSION: ${{ github.ref_name }}
run: make dist-helm-chart

- name: Login to GitHub Container Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Package and Publish Helm Chart
env:
VERSION: ${{ github.ref_name }}
run: make publish-helm-chart

artifacts:
name: Create artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
# NOTE(chrisgacsal): Use actions/cache for caching Go dependency and build caches
# as if provides better flexibility like setting the cache key which reduces cache misses significantly.
cache: false
go-version-file: '.go-version'

- name: Setup Go caching
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ github.ref_name }}-
${{ runner.os }}-go-${{ github.event.repository.default_branch }}-

- name: Create vmclarity-cli manifest(s)
env:
VERSION: ${{ github.ref_name }}
run: make dist-vmclarity-cli

- name: Create Cloudformation manifest(s)
env:
VERSION: ${{ github.ref_name }}
run: make dist-cloudformation

- name: Create Azure Bicep manifest(s)
env:
VERSION: ${{ github.ref_name }}
run: make dist-bicep

- name: Create Docker Compose manifest(s)
env:
VERSION: ${{ github.ref_name }}
run: make dist-docker-compose

- name: Create Google Cloud Deployment manifest(s)
env:
VERSION: ${{ github.ref_name }}
run: make dist-gcp-deployment

- name: Upload
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: artifacts
path: |
dist/*.tar.gz
dist/*.tgz
dist/*.sha256sum
dist/bicep/vmclarity.json
dist/bicep/vmclarity-UI.json
if-no-files-found: error
compression-level: 0

main_release:
prerelease:
needs:
- verification
- build_and_push
- publish_helm
- artifacts
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Delete tag
# env:
# VERSION: ${{ github.ref_name }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git push origin :${{ github.ref_name }}

- name: Create and push module tags
# env:
# VERSION: ${{ github.ref_name }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make multimod-push-tags

- name: Download artifacts
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
Expand All @@ -142,34 +48,30 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make generate-release-notes

main_release:
needs:
- prerelease
name: Release
runs-on: ubuntu-latest
strategy:
matrix:
tags:
- "containerruntimediscovery/types"
- "containerruntimediscovery/server"
- "containerruntimediscovery/client"
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "dist/*.tar.gz,dist/*.sha256sum,dist/bicep/vmclarity.json,dist/bicep/vmclarity-UI.json"
bodyFile: "dist/CHANGELOG.md"
draft: true
name: "Release ${{ github.ref_name }}"
name: "Release ${{ matrix.tags }}"
updateOnlyUnreleased: true

# TODO(sambetts) We need to publish a tag in the format "api/<version>" tag
# so that go mod is able to import the api module without overriding. We need
# to work out how to do this cleanly from github actions on release so that
# we don't need to manage it manually. We could do something this which will
# create another release:
#
# api_release:
# needs: release
# name: Release API Module
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Release API
# uses: softprops/action-gh-release@v1
# with:
# name: VMClarity {{ github.ref }} API
# body: See main {{ github.ref }} release for release notes.
# tag_name: api/{{ github.ref }}
tag: ${{ matrix.tags }}/${{ github.ref_name }}
4 changes: 2 additions & 2 deletions .github/workflows/reusable-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
registry_name:
required: false
type: string
description: 'Registry name used for container image names. Default is `ghcr.io/openclarity`.'
default: ghcr.io/openclarity
description: 'Registry name used for container image names. Default is `ghcr.io/paralta`.'
default: ghcr.io/paralta
image_tag:
required: true
type: string
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable-end-to-end-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
registry_name:
required: false
type: string
description: 'Registry name used for container image names. Default is `ghcr.io/openclarity`.'
default: ghcr.io/openclarity
description: 'Registry name used for container image names. Default is `ghcr.io/paralta`.'
default: ghcr.io/paralta
use_release_repository:
required: false
type: boolean
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/reusable-verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make license-cache

- name: Check licenses
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make license-check

distributions:
runs-on: ubuntu-latest
steps:
Expand Down
77 changes: 0 additions & 77 deletions .github/workflows/semantic-pr.yml

This file was deleted.

20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SHELL = /usr/bin/env bash -o pipefail
####

VERSION ?= $(shell git rev-parse --short HEAD)
DOCKER_REGISTRY ?= ghcr.io/openclarity
DOCKER_REGISTRY ?= ghcr.io/paralta
DOCKER_PUSH ?= false
DOCKER_TAG ?= $(VERSION)
VMCLARITY_TOOLS_BASE ?=
Expand All @@ -29,7 +29,7 @@ BUILD_TIMESTAMP := $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
COMMIT_HASH := $(shell git rev-parse HEAD)
INSTALLATION_DIR := $(ROOT_DIR)/installation
HELM_CHART_DIR := $(INSTALLATION_DIR)/kubernetes/helm
HELM_OCI_REPOSITORY := ghcr.io/openclarity/charts
HELM_OCI_REPOSITORY := ghcr.io/paralta/charts
DIST_DIR ?= $(ROOT_DIR)/dist

####
Expand Down Expand Up @@ -491,3 +491,19 @@ endif

$(DIST_DIR)/CHANGELOG.md: $(ROOT_DIR)/cliff.toml bin/git-cliff | $(DIST_DIR)
$(GITCLIFF_BIN) --config $(ROOT_DIR)/cliff.toml --output $@ $(GITCLIFF_OPTS)

.PHONY: multimod-verify
multimod-verify: bin/multimod
@echo "Validating versions.yaml file"
$(MULTIMOD_BIN) verify

.PHONY: multimod-prerelease
multimod-prerelease: bin/multimod
$(MULTIMOD_BIN) prerelease --all-module-sets --skip-go-mod-tidy=true --commit-to-different-branch=false

.PHONY: multimod-push-tags
multimod-push-tags: bin/multimod
set -e; for tag in `$(MULTIMOD_BIN) tag --module-set-name vmclarity --commit-hash HEAD --print-tags | grep -v "Using" `; do \
echo "pushing tag $${tag}"; \
git push origin $${tag}; \
done;
Loading
Loading