Skip to content

Release

Release #146

Workflow file for this run

---
# This workflow is triggered whenever we release a new version of Starboard
# by creating an annotated Git tag and pushing it to the upstream Git repository.
#
# git tag -a v0.0.1 -m 'Release v0.0.1'
# git push upstream v0.0.1
name: Release
on:
push:
tags:
- "v*"
env:
GO_VERSION: "1.23.1"
KIND_VERSION: "v0.11.1"
KIND_IMAGE: "kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6"
jobs:
# unit-tests:
# name: Run unit tests
# runs-on: ubuntu-20.04
# steps:
# - name: Setup Go
# uses: actions/setup-go@v3
# with:
# go-version: ${{ env.GO_VERSION }}
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Run unit tests
# run: make unit-tests
itest-starboard:
name: Run integration tests / Starboard CLI
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v3
# - name: Setup Kubernetes cluster (KIND)
# uses: engineerd/setup-kind@v0.5.0
# with:
# version: ${{ env.KIND_VERSION }}
# image: ${{ env.KIND_IMAGE }}
# - name: Test connection to Kubernetes cluster
# run: |
# kubectl cluster-info
# kubectl wait --for=condition=Ready nodes --all --timeout=300s
# kubectl describe node
# - name: Run integration tests
# run: |
# make itests-starboard
# env:
# KUBECONFIG: /home/runner/.kube/config
# STARBOARD_TEST_CLI_LOG_LEVEL: "0"
- name: Cleanup Docker and KIND resources
run: |
docker system prune -a --force
docker volume prune --force
# itest-starboard-operator:
# name: Run integration tests / Starboard Operator
# needs:
# - unit-tests
# runs-on: ubuntu-20.04
# timeout-minutes: 15
# steps:
# - name: Setup Go
# uses: actions/setup-go@v3
# with:
# go-version: ${{ env.GO_VERSION }}
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Setup Kubernetes cluster (KIND)
# uses: engineerd/setup-kind@v0.5.0
# with:
# version: ${{ env.KIND_VERSION }}
# image: ${{ env.KIND_IMAGE }}
# - name: Test connection to Kubernetes cluster
# run: |
# kubectl cluster-info
# kubectl wait --for=condition=Ready nodes --all --timeout=300s
# kubectl describe node
# - name: Run integration tests
# run: |
# kubectl apply -f deploy/crd/vulnerabilityreports.crd.yaml \
# -f deploy/crd/configauditreports.crd.yaml \
# -f deploy/crd/clusterconfigauditreports.crd.yaml \
# -f deploy/crd/clustercompliancereports.crd.yaml \
# -f deploy/crd/clustercompliancedetailreports.crd.yaml \
# -f deploy/crd/ciskubebenchreports.crd.yaml
# kubectl apply -f deploy/static/01-starboard-operator.ns.yaml \
# -f deploy/static/02-starboard-operator.rbac.yaml
# make itests-starboard-operator
# env:
# KUBECONFIG: /home/runner/.kube/config
# OPERATOR_NAMESPACE: starboard-system
# OPERATOR_TARGET_NAMESPACES: default
# - name: Cleanup Docker and KIND resources
# run: |
# docker system prune -a --force
# docker volume prune --force
# integration-operator-conftest:
# name: Integration / Operator / Conftest
# needs:
# - unit-tests
# runs-on: ubuntu-20.04
# timeout-minutes: 15
# steps:
# - name: Setup Go
# uses: actions/setup-go@v3
# with:
# go-version: ${{ env.GO_VERSION }}
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Setup Kubernetes cluster (KIND)
# uses: engineerd/setup-kind@v0.5.0
# with:
# version: ${{ env.KIND_VERSION }}
# image: ${{ env.KIND_IMAGE }}
# - name: Test connection to Kubernetes cluster
# run: |
# kubectl cluster-info
# kubectl wait --for=condition=Ready nodes --all --timeout=300s
# kubectl describe node
# - name: Run integration tests
# run: |
# kubectl apply -f deploy/crd/vulnerabilityreports.crd.yaml \
# -f deploy/crd/configauditreports.crd.yaml \
# -f deploy/crd/clusterconfigauditreports.crd.yaml \
# -f deploy/crd/clustercompliancereports.crd.yaml \
# -f deploy/crd/clustercompliancedetailreports.crd.yaml \
# -f deploy/crd/ciskubebenchreports.crd.yaml
# kubectl apply -f deploy/static/01-starboard-operator.ns.yaml \
# -f deploy/static/02-starboard-operator.rbac.yaml
# make integration-operator-conftest
# env:
# KUBECONFIG: /home/runner/.kube/config
# OPERATOR_NAMESPACE: starboard-system
# OPERATOR_TARGET_NAMESPACES: default
# - name: Cleanup Docker and KIND resources
# run: |
# docker system prune -a --force
# docker volume prune --force
release:
name: Release
runs-on: ubuntu-20.04
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
steps:
- name: Cleanup Docker and KIND resources (Pre-Release)
run: |
docker system prune -a --force
docker volume prune --force
- name: Check disk usage (Pre-Release)
run: df -h
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
# - name: Login to registries
# run: |
# docker logout docker.io
# docker logout ${{ secrets.AQUSEC_ACR_REGISTRY_NAME }}
# sudo apt-get update
# sudo apt-get install -y docker-credential-helpers
# echo '{"credsStore":"desktop","credHelpers":{"docker.io":"pass","${{ secrets.AQUSEC_ACR_REGISTRY_NAME }}":"pass"}}' > ~/.docker/config.json
# docker login --username ${{ secrets.DOCKERHUB_USER }} --password ${{ secrets.DOCKERHUB_TOKEN }} docker.io
# docker login --username ${{ secrets.AQUASEC_ACR_USERNAME }} --password ${{ secrets.AQUASEC_ACR_PASSWORD }} ${{ secrets.AQUSEC_ACR_REGISTRY_NAME }}
# - name: Login to docker.io registry
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USER }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: login to Aqua Container Registry
# uses: azure/docker-login@v2
# with:
# login-server: ${{ secrets.AQUSEC_ACR_REGISTRY_NAME }}
# username: ${{ secrets.AQUASEC_ACR_USERNAME }}
# password: ${{ secrets.AQUASEC_ACR_PASSWORD }}
# - name: Login to Docker Hub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USER }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Aquasec Container Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.AQUSEC_ACR_REGISTRY_NAME }}
username: ${{ secrets.AQUASEC_ACR_USERNAME }}
password: ${{ secrets.AQUASEC_ACR_PASSWORD }}
- name: Release
uses: goreleaser/goreleaser-action@v3
with:
version: v1.7.0
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AQUSEC_ACR_REGISTRY_NAME: ${{ secrets.AQUSEC_ACR_REGISTRY_NAME }}
# - name: Update new version for plugin 'starboard' in krew-index
# uses: rajatjindal/krew-release-bot@v0.0.43
- name: Cleanup Docker and KIND resources
run: |
docker system prune -a --force
docker volume prune --force
- name: Check disk usage
run: df -h