@@ -17,75 +17,52 @@ jobs:
17
17
uses : slashben/setup-minikube@master
18
18
with :
19
19
feature-gates : ' ValidatingAdmissionPolicy=true'
20
- extra-config : ' apiserver.runtime-config=admissionregistration.k8s.io/v1alpha1 '
21
- kubernetes-version : 1.27.0
20
+ extra-config : ' apiserver.runtime-config=admissionregistration.k8s.io/v1beta1 '
21
+ kubernetes-version : v1.28.0-rc.1
22
22
container-runtime : containerd
23
23
- uses : actions/setup-python@v4
24
24
with :
25
- python-version : ' 3.10'
25
+ python-version : ' 3.10'
26
26
- uses : azure/setup-kubectl@v3
27
27
- name : Running all control policy tests
28
28
run : |
29
29
kubectl version
30
30
pip install --upgrade pip
31
31
pip install -r requirements.txt
32
32
./scripts/run-all-control-tests.sh
33
-
33
+
34
34
release :
35
35
needs : test-all-policies
36
36
runs-on : ubuntu-latest
37
37
outputs :
38
38
upload_url : ${{ steps.create_release.outputs.upload_url }}
39
39
steps :
40
40
- uses : actions/checkout@v3
41
-
41
+
42
42
- name : Verify release tagged commit is on main
43
43
run : |
44
44
git fetch origin main
45
45
git merge-base --is-ancestor ${GITHUB_REF##*/} origin/main && echo "${GITHUB_REF##*/} is a commit on main!"
46
-
46
+
47
+ - uses : azure/setup-kubectl@v3
48
+
47
49
- name : Create release artifacts
48
50
run : |
49
51
mkdir release
50
- ./scripts/create-release-objects.sh release
51
-
52
+ kubectl kustomize apis/k8s-v1beta1/ > release/kubescape-validating-admission-policies-v1beta1.yaml
53
+ kubectl kustomize apis/x-k8s-v1alpha1/ > release/kubescape-validating-admission-policies-x-v1alpha1.yaml
54
+ kubectl kustomize apis/k8s-v1alpha1/ > release/kubescape-validating-admission-policies-v1alpha1.yaml
55
+ # Making a copy of the v1beta1 file to be used as the default policy release artifact
56
+ cp release/kubescape-validating-admission-policies-v1beta1.yaml release/kubescape-validating-admission-policies.yaml
57
+
52
58
- name : Create a GitHub release
53
- id : create_release
54
- uses : actions/create-release@v1
55
- env :
56
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57
- with :
58
- tag_name : " ${{ github.ref_name }}"
59
- release_name : " Release ${{ github.ref_name }}"
60
- draft : false
61
- prerelease : false
62
-
63
- - name : Publish policy object artifact
64
- uses : actions/upload-release-asset@v1
65
- env :
66
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
67
- with :
68
- upload_url : ${{ steps.create_release.outputs.upload_url }}
69
- asset_path : release/kubescape-validating-admission-policies.yaml
70
- asset_name : kubescape-validating-admission-policies.yaml
71
- asset_content_type : text/yaml
72
-
73
- - name : Publish policy configuration CRD artifact
74
- uses : actions/upload-release-asset@v1
75
- env :
76
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
77
- with :
78
- upload_url : ${{ steps.create_release.outputs.upload_url }}
79
- asset_path : configuration/policy-configuration-definition.yaml
80
- asset_name : policy-configuration-definition.yaml
81
- asset_content_type : text/yaml
82
-
83
- - name : Publish basic policy configuration
84
- uses : actions/upload-release-asset@v1
85
- env :
86
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
59
+ uses : softprops/action-gh-release@v1
60
+ if : startsWith(github.ref, 'refs/tags/')
87
61
with :
88
- upload_url : ${{ steps.create_release.outputs.upload_url }}
89
- asset_path : configuration/basic-control-configuration.yaml
90
- asset_name : basic-control-configuration.yaml
91
- asset_content_type : text/yaml
62
+ files : |
63
+ release/kubescape-validating-admission-policies.yaml
64
+ release/kubescape-validating-admission-policies-v1beta1.yaml
65
+ release/kubescape-validating-admission-policies-x-v1alpha1.yaml
66
+ release/kubescape-validating-admission-policies-v1alpha1.yaml
67
+ configuration/policy-configuration-definition.yaml
68
+ configuration/basic-control-configuration.yaml
0 commit comments