diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml index 992d0aa..fc5aeff 100644 --- a/.github/workflows/bump_version.yml +++ b/.github/workflows/bump_version.yml @@ -55,6 +55,8 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + build-args: | + TOOLKIT_VERSION=${{ steps.tag_version.outputs.new_version }} - name: Create a GitHub release uses: ncipollo/release-action@v1 with: diff --git a/Dockerfile b/Dockerfile index bf9b0c4..dc6f0e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ -FROM python:3.11.6-slim as builder +ARG TOOLKIT_VERSION +FROM python:3.11.6-slim as builder WORKDIR /app RUN apt-get update && apt-get install -y build-essential libadmesh-dev @@ -14,7 +15,6 @@ COPY voron_toolkit/ /app/voron_toolkit RUN poetry install --only-root && rm ./pyproject.toml ./poetry.lock FROM python:3.11.6-slim as test - WORKDIR /app RUN pip install poetry==1.7.0 @@ -24,7 +24,8 @@ RUN poetry install --only dev RUN poetry run ruff voron_toolkit/ && poetry run ruff format --check voron_toolkit/ && poetry run mypy voron_toolkit FROM python:3.11.6-slim as final - +ARG TOOLKIT_VERSION +ENV VORON_TOOLKIT_VERSION=${TOOLKIT_VERSION} WORKDIR /github/workspace ADD https://github.com/unlimitedbacon/stl-thumb/releases/download/v0.5.0/stl-thumb_0.5.0_amd64.deb /tmp RUN apt-get update && \ diff --git a/entrypoint.sh b/entrypoint.sh index 42768f0..384e2a3 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -32,7 +32,7 @@ echo -e "\033[1;91m #############" echo -e "\033[1;91m #######" echo -e "\033[1;91m #" echo -e "\033[39m" -echo " Welcome to the VoronDesign Toolkit docker container!" +echo " Welcome to the VoronDesign Toolkit docker container (v${VORON_TOOLKIT_VERSION})!" echo " If you encounter any issues, please report them to the VoronDesign team!" echo "" diff --git a/voron_toolkit/constants.py b/voron_toolkit/constants.py index 983c67c..3b899ba 100644 --- a/voron_toolkit/constants.py +++ b/voron_toolkit/constants.py @@ -1,4 +1,5 @@ import json +import os from collections import defaultdict from dataclasses import dataclass from enum import Enum @@ -9,6 +10,7 @@ CI_ERROR_LABEL: str = "Warning: CI Error" READY_FOR_CI_LABEL: str = "Ready for CI" PR_COMMENT_TAG: str = "" +PR_COMMENT_TOOLKIT_VERSION: str = f"" ALL_CI_LABELS: list[str] = [CI_PASSED_LABEL, CI_FAILURE_LABEL, CI_ERROR_LABEL, READY_FOR_CI_LABEL] diff --git a/voron_toolkit/utils/github_action_helper.py b/voron_toolkit/utils/github_action_helper.py index 009fd15..df66a0f 100644 --- a/voron_toolkit/utils/github_action_helper.py +++ b/voron_toolkit/utils/github_action_helper.py @@ -11,7 +11,7 @@ from githubkit import GitHub, Response from loguru import logger -from voron_toolkit.constants import PR_COMMENT_TAG, ExtendedResultEnum, ToolResult +from voron_toolkit.constants import PR_COMMENT_TAG, PR_COMMENT_TOOLKIT_VERSION, ExtendedResultEnum, ToolResult STEP_SUMMARY_ENV_VAR = "GITHUB_STEP_SUMMARY" OUTPUT_ENV_VAR = "GITHUB_OUTPUT" @@ -178,7 +178,7 @@ def update_or_create_pr_comment(cls: type[Self], repo: str, pull_request_number: comment_id = int(existing_comment["id"]) break - full_comment = f"{comment_body}\n\n{PR_COMMENT_TAG}\n" + full_comment = f"{comment_body}\n\n{PR_COMMENT_TAG}\n\n{PR_COMMENT_TOOLKIT_VERSION}" if comment_id == -1: # Create a new comment