Skip to content

Merge pull request #50 from kubescape/hotfix/policy-name #8

Merge pull request #50 from kubescape/hotfix/policy-name

Merge pull request #50 from kubescape/hotfix/policy-name #8

Workflow file for this run

name: "Release"
on:
push:
branches-ignore:
- "**"
tags:
- "v*"
jobs:
test-all-policies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: start minikube
id: minikube
uses: slashben/setup-minikube@master
with:
feature-gates: 'ValidatingAdmissionPolicy=true'
extra-config: 'apiserver.runtime-config=admissionregistration.k8s.io/v1beta1'
kubernetes-version: v1.28.0-rc.1
container-runtime: containerd
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: azure/setup-kubectl@v3
- name: Running all control policy tests
run: |
kubectl version
pip install --upgrade pip
pip install -r requirements.txt
./scripts/run-all-control-tests.sh
release:
needs: test-all-policies
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v3
- name: Verify release tagged commit is on main
run: |
git fetch origin main
git merge-base --is-ancestor ${GITHUB_REF##*/} origin/main && echo "${GITHUB_REF##*/} is a commit on main!"
- uses: azure/setup-kubectl@v3
- name: Create release artifacts
run: |
mkdir release
kubectl kustomize apis/k8s-v1beta1/ > release/kubescape-validating-admission-policies-v1beta1.yaml
kubectl kustomize apis/x-k8s-v1alpha1/ > release/kubescape-validating-admission-policies-x-v1alpha1.yaml
kubectl kustomize apis/k8s-v1alpha1/ > release/kubescape-validating-admission-policies-v1alpha1.yaml
# Making a copy of the v1beta1 file to be used as the default policy release artifact
cp release/kubescape-validating-admission-policies-v1beta1.yaml release/kubescape-validating-admission-policies.yaml
- name: Create a GitHub release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release/kubescape-validating-admission-policies.yaml
release/kubescape-validating-admission-policies-v1beta1.yaml
release/kubescape-validating-admission-policies-x-v1alpha1.yaml
release/kubescape-validating-admission-policies-v1alpha1.yaml
configuration/policy-configuration-definition.yaml
configuration/basic-control-configuration.yaml