-
Notifications
You must be signed in to change notification settings - Fork 8
68 lines (61 loc) · 2.43 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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