Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semantic versioning #249

Closed
43 changes: 24 additions & 19 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
name:
description: 'Release name'
description: "Release name, eg '1.0.1'"
default: ""
required: true

Expand All @@ -14,24 +14,29 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Verify that the current branch has a name that starts with 'release-'
run: |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$CURRENT_BRANCH" == release-* ]]; then
echo "Branch name starts with 'release-'."
else
echo "Branch name does not start with 'release-'."
exit 1
fi

- name: Verify, that an image with the target release version as a tag, does not exis
run: ./scripts/no_image_exists ${{ github.event.inputs.name }}

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check tag
run: ./scripts/check_release_tag.sh ${{ github.event.inputs.name }}
- name: Check that the image tag defined in the sec-scanner-config is the same as the release version (${{ github.event.inputs.name }})
run: ./scripts/check_image.sh ${{ github.event.inputs.name }}

- name: Check image
run: ./scripts/check_image.sh ${{ github.ref_name }}
- name: Run unit tests
run: make test

- name: Verify
run: ./scripts/verify-status.sh ${{ github.ref_name }}

# run-unit-tests:
# name: Unit tests
# needs: verify-head-status
# uses: "./.github/workflows/run-unit-tests.yaml"
- run: make build

create-draft:
name: Create draft release
Expand All @@ -57,19 +62,19 @@ jobs:
RELEASE_ID=$(./scripts/create_draft_release.sh ${{ github.event.inputs.name }})
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT

# This will trigger the prow release jobs. The value for github.event.inputs_name will be awailable as the env var PULL_BASE_REF.
- name: Create lightweight tag
run: |
git tag ${{ github.event.inputs.name }}
git push origin ${{ github.event.inputs.name }}

- name: Check if the release image was build and can be found in image registery
run: |
./scripts/image_exists.sh

outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}

# devOps-Insights:
# name: DevOps Insights
# needs: [verify-head-status, create-draft, run-unit-tests]
# uses: "./.github/workflows/metrics.yaml"

publish-release:
name: Publish release
needs: [verify-head-status, create-draft]
Expand Down
18 changes: 17 additions & 1 deletion internal/controller/nats/mocks/controller.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 69 additions & 1 deletion internal/controller/nats/mocks/manager.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion pkg/k8s/chart/mocks/renderer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading