Fixing dependency in the release process #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Release" | |
on: | |
push: | |
branches-ignore: | |
- "**" | |
tags: | |
- "v*" | |
jobs: | |
release: | |
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 |