-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (41 loc) · 1.87 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
name: "Release"
on:
push:
branches-ignore:
- "**"
tags:
- "v*"
jobs:
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-v1/ > release/kubescape-validating-admission-policies-v1.yaml
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 v1 file to be used as the default policy release artifact
cp release/kubescape-validating-admission-policies-v1.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-v1.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