Skip to content

ci: add version check to release #7

ci: add version check to release

ci: add version check to release #7

Workflow file for this run

# SPDX-FileCopyrightText: Copyright (c) 2025 Cisco and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
---
name: ci-release-image
on:
push:
tags:
- "v?[0-9]+.[0-9]+.[0-9]+"
- "v?[0-9]+.[0-9]+.[0-9]+-dev.[0-9]+"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
checkout-version-check:
name: checkout & version check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
- name: Version check
run: |
GIT_VERSION=${GITHUB_REF%-*}
PYTHON_VERSION=$(grep -m 1 version pyproject.toml | grep -e '\d.\d.\d' -o)
if [[ "$GIT_VERSION" == "$PYTHON_VERSION" ]]; then
echo "PYTHON_VERSION: $PYTHON_VERSION and GIT_VERSION: $GIT_VERSION are matched"
echo "Version check passed"
else
echo "Version check failed, PYTHON_VERSION: $PYTHON_VERSION and GIT_VERSION: $GIT_VERSION are mismatched"
exit 1
fi
build-push:
name: Build docker image - wfsrv
needs: [checkout-version-check]
uses: ./.github/workflows/reusable-docker-build-push.yaml
permissions:
contents: "read"
packages: "write"
attestations: "write"
with:
bake-target: workflowserver
image-name: wfsrv
image-tag: ${{ github.ref_name }}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}