From 635c0af7fa6cb0ef02f8d28da288cd0e4d446a12 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Thu, 15 Oct 2026 18:41:20 +0530 Subject: [PATCH 01/39] upadte the all resusable workflows --- .github/python-packages.json | 5 ++ .github/workflows/CI.yml | 46 +++++++++++++ .github/workflows/PR.yml | 23 +++++++ .github/workflows/analyze_package.yml | 58 ++++++++++++++++ .github/workflows/check_package.yml | 31 +++++++++ .github/workflows/check_workflows.yml | 26 ++++++++ .github/workflows/get_package_info.yml | 66 ++++++++++++++++++ .github/workflows/get_package_names.yml | 35 ++++++++++ .github/workflows/publish-to-pypi.yml | 13 ++-- .github/workflows/report_test_results.yml | 34 ++++++++++ .github/workflows/test-python-package.yml | 27 -------- .github/workflows/test-wheel-build.yml | 26 -------- .github/workflows/test_package.yml | 81 +++++++++++++++++++++++ 13 files changed, 413 insertions(+), 58 deletions(-) create mode 100644 .github/python-packages.json create mode 100644 .github/workflows/CI.yml create mode 100644 .github/workflows/PR.yml create mode 100644 .github/workflows/analyze_package.yml create mode 100644 .github/workflows/check_package.yml create mode 100644 .github/workflows/check_workflows.yml create mode 100644 .github/workflows/get_package_info.yml create mode 100644 .github/workflows/get_package_names.yml create mode 100644 .github/workflows/report_test_results.yml delete mode 100644 .github/workflows/test-python-package.yml delete mode 100644 .github/workflows/test-wheel-build.yml create mode 100644 .github/workflows/test_package.yml diff --git a/.github/python-packages.json b/.github/python-packages.json new file mode 100644 index 0000000..7f4ca21 --- /dev/null +++ b/.github/python-packages.json @@ -0,0 +1,5 @@ +{ + "nisyscfg": { + "package-basepath": "." + } +} \ No newline at end of file diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..a780f5d --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,46 @@ +name: CI + +on: + push: + branches: + - main + workflow_call: + workflow_dispatch: + +permissions: + contents: read ## TODO: remove this when moving the repo to public + +jobs: + check_workflows: + name: Check workflows + uses: ./.github/workflows/check_workflows.yml + get_package_names: + name: Get package names + uses: ./.github/workflows/get_package_names.yml + check_packages: + name: Check ${{ matrix.package-name }} + needs: get_package_names + strategy: + matrix: + package-name: ${{ fromJson(needs.get_package_names.outputs.package-names) }} + uses: ./.github/workflows/check_package.yml + with: + package-name: ${{ matrix.package-name }} + test_packages: + name: Test ${{ matrix.package-name }} + needs: get_package_names + strategy: + matrix: + package-name: ${{ fromJson(needs.get_package_names.outputs.package-names) }} + uses: ./.github/workflows/test_package.yml + with: + package-name: ${{ matrix.package-name }} + report_test_results: + name: Report test results + if: ${{ always() }} + needs: test_packages + uses: ./.github/workflows/report_test_results.yml + permissions: + checks: write # needed to push the aggregated report + pull-requests: write # needed to post the report to the PR + contents: read # needed only if the repo is internal, remove this if public diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml new file mode 100644 index 0000000..9546812 --- /dev/null +++ b/.github/workflows/PR.yml @@ -0,0 +1,23 @@ +name: PR + +on: + pull_request: + branches: + - main + workflow_call: + workflow_dispatch: + +permissions: + contents: read +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + run_ci: + name: Run CI + uses: ./.github/workflows/CI.yml + permissions: + contents: read + checks: write + pull-requests: write \ No newline at end of file diff --git a/.github/workflows/analyze_package.yml b/.github/workflows/analyze_package.yml new file mode 100644 index 0000000..3e11105 --- /dev/null +++ b/.github/workflows/analyze_package.yml @@ -0,0 +1,58 @@ +name: Analyze package + +on: + workflow_call: + inputs: + package-name: + description: 'The name of the package folder to analyze.' + default: '' + required: true + type: string + package-basepath: + description: 'The base path of the package to analyze, relative to the repo root.' + default: '' + required: true + type: string + install-extras: + description: 'A space-separated list of package extras to install.' + default: '' + required: false + type: string + +permissions: {} + +jobs: + analyze_package: + name: Analyze package for ${{ inputs.package-name }} + permissions: + contents: read + strategy: + matrix: + os: [windows-latest, ubuntu-latest] # Temporarily disabled: macos-latest + python-version: ['3.9','3.13'] + runs-on: ${{ matrix.os }} + defaults: + run: + # Set the working-directory for all steps in this job. + working-directory: ${{ inputs.package-basepath }} + steps: + - name: Check out repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + submodules: true + - name: Set up Python + uses: ni/python-actions/setup-python@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + id: setup-python + with: + python-version: ${{ matrix.python-version }} + - name: Set up Poetry + uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + # - name: Analyze Python Project + # uses: ni/python-actions/analyze-project@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + # with: + # project-directory: ${{ inputs.package-basepath || '.' }} + # install-args: ${{ inputs.install-extras && format('--extras ''{0}''', inputs.install-extras) || '' }} + # - name: Bandit security checks + # working-directory: ${{ github.workspace }} + # run: poetry run bandit -c pyproject.toml -r src/ \ No newline at end of file diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml new file mode 100644 index 0000000..e5346ae --- /dev/null +++ b/.github/workflows/check_package.yml @@ -0,0 +1,31 @@ +name: Check package + +on: + workflow_call: + inputs: + package-name: + description: 'The name of the package folder to check.' + default: '' + required: true + type: string + +permissions: {} + +jobs: + get_package_info: + name: Get package info for ${{ inputs.package-name }} + uses: ./.github/workflows/get_package_info.yml + permissions: + contents: read + with: + package-name: ${{ inputs.package-name }} + analyze_package: + name: Analyze package for ${{ inputs.package-name }} + needs: get_package_info + uses: ./.github/workflows/analyze_package.yml + permissions: + contents: read + with: + package-name: ${{ inputs.package-name }} + package-basepath: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + install-extras: ${{ needs.get_package_info.outputs.install-extras }} \ No newline at end of file diff --git a/.github/workflows/check_workflows.yml b/.github/workflows/check_workflows.yml new file mode 100644 index 0000000..f736021 --- /dev/null +++ b/.github/workflows/check_workflows.yml @@ -0,0 +1,26 @@ +name: Check workflows + +on: + workflow_call: + workflow_dispatch: + +permissions: {} + +jobs: + zizmor: + name: Run zizmor + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Check out repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Run zizmor + uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7 + with: + advanced-security: false # TODO: use the default when we publish the repo + inputs: | + .github/workflows + \ No newline at end of file diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml new file mode 100644 index 0000000..d2177f9 --- /dev/null +++ b/.github/workflows/get_package_info.yml @@ -0,0 +1,66 @@ +name: Get package info + +on: + workflow_call: + inputs: + package-name: + description: 'The name of the package from .github/python-packages.json.' + default: '' + required: true + type: string + outputs: + package-basepath: + description: 'The package base path relative to the repo root.' + # NOTE: This is not the absolute path, because downstream actions are expected to be run on multiple platforms. + value: ${{ jobs.get_package_info.outputs.package-basepath }} + install-extras: + description: 'A space-separated list of package extras to install.' + value: ${{ jobs.get_package_info.outputs.install-extras }} +permissions: {} + +jobs: + get_package_info: + name: Get package info for ${{ inputs.package-name }} + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + package-basepath: ${{ steps.parse_json.outputs.package-basepath }} + install-extras: ${{ steps.parse_json.outputs.install-extras }} + should-check-docs: ${{ steps.parse_json.outputs.should-check-docs }} + steps: + - name: Check out repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Get package info from JSON + id: parse_json + env: + PACKAGE_NAME: ${{ inputs.package-name }} + # NOTE: jq only supports standard JSON, not JSONC or JSON5 + run: | + info=$(jq -c --arg name "$PACKAGE_NAME" '.[$name]' "./.github/python-packages.json") + if [ "$info" = "null" ]; then + echo "Error: Package '$PACKAGE_NAME' not found in .github/python-packages.json." >&2 + exit 1 + fi + + package_basepath=$(echo "$info" | jq -r '."package-basepath"') + install_extras=$(echo "$info" | jq -r '."install-extras"') + + should_check_docs=false + if [ -d "${package_basepath}/docs" ]; then + should_check_docs=true + fi + + if [ "${install_extras}" == "null" ]; then + install_extras="" + fi + echo "package-basepath=${package_basepath}" >> $GITHUB_OUTPUT + echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT + echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT + - name: Show package info + env: + STEP_OUTPUTS: ${{ toJSON(steps.parse_json.outputs) }} + run: | + echo "$STEP_OUTPUTS" \ No newline at end of file diff --git a/.github/workflows/get_package_names.yml b/.github/workflows/get_package_names.yml new file mode 100644 index 0000000..73fea9d --- /dev/null +++ b/.github/workflows/get_package_names.yml @@ -0,0 +1,35 @@ +name: Get package names + +on: + workflow_call: + outputs: + package-names: + description: "List of package names from .github/python-packages.json" + value: ${{ jobs.get_package_names.outputs.package-names }} + +permissions: {} + +jobs: + get_package_names: + name: Get package names + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + package-names: ${{ steps.parse_json.outputs.package-names }} + steps: + - name: Check out repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Get package info from JSON + id: parse_json + # NOTE: jq only supports standard JSON, not JSONC or JSON5 + run: | + info=$(jq -c 'keys' ./.github/python-packages.json) + if [ -z "$info" ] || [ "$info" = "[]" ]; then + echo "Error: No package names found in .github/python-packages.json" >&2 + exit 1 + fi + echo "Package names: $info" + echo "package-names=$info" >> $GITHUB_OUTPUT \ No newline at end of file diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index eb2cbe3..bc88461 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -6,13 +6,14 @@ on: - published jobs: - build-and-publish: + build-and-publish: # zizmor: ignore[excessive-permissions] Temporary: permissions hardening tracked in follow-up PR if: github.repository == 'ni/nisyscfg-python' runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - + with: + persist-credentials: false - name: Set up Python 3.9 uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 with: @@ -26,12 +27,14 @@ jobs: - name: Publish distribution to Test PyPI uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 + # zizmor: ignore[use-trusted-publishing] Temporary token authentication; migration tracked in follow-up PR with: - password: ${{ secrets.test_pypi_password }} - repository-url: https://test.pypi.org/legacy/ - continue-on-error: true + repository-url: https://test.pypi.org/legacy/ + password: ${{ secrets.test_pypi_password }} + continue-on-error: true - name: Publish distribution to PyPI uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 + # zizmor: ignore[use-trusted-publishing] Temporary token authentication; migration tracked in follow-up PR with: password: ${{ secrets.pypi_password }} \ No newline at end of file diff --git a/.github/workflows/report_test_results.yml b/.github/workflows/report_test_results.yml new file mode 100644 index 0000000..cf71c3e --- /dev/null +++ b/.github/workflows/report_test_results.yml @@ -0,0 +1,34 @@ +name: Report test results + +on: + workflow_call: + workflow_dispatch: + +permissions: {} + +jobs: + report_test_results: + name: Report test results + runs-on: ubuntu-latest + permissions: + contents: read + checks: write + pull-requests: write + steps: + - name: Check out repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Download test results + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + path: test_results + pattern: test_results_* + merge-multiple: true + - name: List downloaded files + run: ls -lR + - name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2.23.0 + with: + files: "test_results/**/*.xml" + if: always() \ No newline at end of file diff --git a/.github/workflows/test-python-package.yml b/.github/workflows/test-python-package.yml deleted file mode 100644 index 072f303..0000000 --- a/.github/workflows/test-python-package.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Test Python Package - -on: [push, pull_request] - -jobs: - test: - - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Set up Python ${{ matrix.python-version }} - uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 - with: - python-version: ${{ matrix.python-version }} - - name: Set up Poetry - uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - - name: Install locked dependencies - run: poetry install -v - - name: Lint with flake8 - run: poetry run flake8 - - name: Test with pytest - run: poetry run pytest \ No newline at end of file diff --git a/.github/workflows/test-wheel-build.yml b/.github/workflows/test-wheel-build.yml deleted file mode 100644 index 9a59080..0000000 --- a/.github/workflows/test-wheel-build.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Test Building Python Package - -on: [push, pull_request] - -jobs: - build-and-upload-artifact: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Set up Python 3.9 - uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 - with: - python-version: 3.9 - - - name: Set up Poetry - uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - - - name: Build packages - run: poetry build - - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - with: - name: build artifacts - path: dist/ diff --git a/.github/workflows/test_package.yml b/.github/workflows/test_package.yml new file mode 100644 index 0000000..a8b7838 --- /dev/null +++ b/.github/workflows/test_package.yml @@ -0,0 +1,81 @@ +name: Test package +on: + workflow_call: + inputs: + package-name: + description: 'The name of the package folder to test.' + default: '' + required: true + type: string + workflow_dispatch: + inputs: + package-name: + description: 'The name of the package folder to test.' + default: '' + required: true + type: string + +permissions: {} + +jobs: + get_package_info: + name: Get package info - ${{ inputs.package-name }} + uses: ./.github/workflows/get_package_info.yml + permissions: + contents: read + with: + package-name: ${{ inputs.package-name }} + + run_unit_tests: + strategy: + # Fail-fast skews the pass/fail ratio and seems to make pytest produce + # incomplete JUnit XML results. + fail-fast: false + matrix: + os: [windows-latest, ubuntu-latest] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + name: Run unit tests - ${{ inputs.package-name }} (${{ matrix.python-version }} - ${{ matrix.os }}) + needs: get_package_info + runs-on: ${{ matrix.os }} + permissions: + contents: read + steps: + - name: Check out repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + submodules: true + - name: Get OS version + run: echo "osVersion=$ImageOS" >> "$GITHUB_ENV" + shell: bash + - name: Set up Python + uses: ni/python-actions/setup-python@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + id: setup-python + with: + python-version: ${{ matrix.python-version }} + - name: Set up Poetry + uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + - name: Cache ${{ inputs.package-name }} virtualenv + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/.venv + key: ${{ inputs.package-name }}-${{ matrix.os }}-py${{ matrix.python-version }}-${{ needs.get_package_info.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + + - name: Install ${{ inputs.package-name }} + run: poetry install -v + working-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + shell: bash + - name: Run ${{ inputs.package-name }} unit tests and code coverage + env: + PACKAGE_NAME: ${{ inputs.package-name }} + MATRIX_OS: ${{ matrix.os }} + PYTHON_VERSION: ${{ steps.setup-python.outputs.python-version }} + run: poetry run pytest -v --cov="$PACKAGE_NAME" --junitxml="test_results/$PACKAGE_NAME-$MATRIX_OS-py$PYTHON_VERSION.xml" + working-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + shell: bash + - name: Upload ${{ inputs.package-name }} test results + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: test_results_unit_${{ inputs.package-name }}_${{ matrix.os }}_py${{ steps.setup-python.outputs.python-version }} + path: ${{ github.workspace }}/test_results/*.xml + if: always() From 17a32eaecd3bc3f4cd33d59256a7a3470c37e2b2 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Fri, 16 Oct 2026 10:44:41 +0530 Subject: [PATCH 02/39] PR workflow using a reusable CI workflow --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4c14371..b635fa1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,4 +68,4 @@ exclude = ["build", "docs", "tests", ".tox", "__pycache__", ".venv*"] ignore = ["H404", "H405", "H903", "E501", "W391", "W503", "W504"] [tool.black] -line-length = 100 +line-length = 100 \ No newline at end of file From cdcdeb4c6f0c02f189be432be048186854f5f71f Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Fri, 16 Oct 2026 15:25:07 +0530 Subject: [PATCH 03/39] fix: the packge-basepath issue in check_package.yml --- .github/workflows/check_package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml index e5346ae..f6fabd7 100644 --- a/.github/workflows/check_package.yml +++ b/.github/workflows/check_package.yml @@ -27,5 +27,5 @@ jobs: contents: read with: package-name: ${{ inputs.package-name }} - package-basepath: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + package-basepath: ${{ needs.get_package_info.outputs.package-basepath }} install-extras: ${{ needs.get_package_info.outputs.install-extras }} \ No newline at end of file From 1d1c8a303ad849708d86f26eb92af262f3a35739 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Fri, 16 Oct 2026 15:33:30 +0530 Subject: [PATCH 04/39] uncomment the analyze the python project --- .github/workflows/analyze_package.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/analyze_package.yml b/.github/workflows/analyze_package.yml index 3e11105..5b1fd6c 100644 --- a/.github/workflows/analyze_package.yml +++ b/.github/workflows/analyze_package.yml @@ -48,11 +48,11 @@ jobs: python-version: ${{ matrix.python-version }} - name: Set up Poetry uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - # - name: Analyze Python Project - # uses: ni/python-actions/analyze-project@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - # with: - # project-directory: ${{ inputs.package-basepath || '.' }} - # install-args: ${{ inputs.install-extras && format('--extras ''{0}''', inputs.install-extras) || '' }} + - name: Analyze Python Project + uses: ni/python-actions/analyze-project@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + with: + project-directory: ${{ inputs.package-basepath }} + install-args: ${{ inputs.install-extras && format('--extras ''{0}''', inputs.install-extras) || '' }} # - name: Bandit security checks # working-directory: ${{ github.workspace }} # run: poetry run bandit -c pyproject.toml -r src/ \ No newline at end of file From 0a3f244d6f013fcae5a13a55369b1a1e40a79274 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Fri, 16 Oct 2026 15:51:51 +0530 Subject: [PATCH 05/39] remove the analyze_package.yml --- .github/workflows/analyze_package.yml | 58 --------------------------- .github/workflows/check_package.yml | 12 +----- 2 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 .github/workflows/analyze_package.yml diff --git a/.github/workflows/analyze_package.yml b/.github/workflows/analyze_package.yml deleted file mode 100644 index 5b1fd6c..0000000 --- a/.github/workflows/analyze_package.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Analyze package - -on: - workflow_call: - inputs: - package-name: - description: 'The name of the package folder to analyze.' - default: '' - required: true - type: string - package-basepath: - description: 'The base path of the package to analyze, relative to the repo root.' - default: '' - required: true - type: string - install-extras: - description: 'A space-separated list of package extras to install.' - default: '' - required: false - type: string - -permissions: {} - -jobs: - analyze_package: - name: Analyze package for ${{ inputs.package-name }} - permissions: - contents: read - strategy: - matrix: - os: [windows-latest, ubuntu-latest] # Temporarily disabled: macos-latest - python-version: ['3.9','3.13'] - runs-on: ${{ matrix.os }} - defaults: - run: - # Set the working-directory for all steps in this job. - working-directory: ${{ inputs.package-basepath }} - steps: - - name: Check out repo - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - submodules: true - - name: Set up Python - uses: ni/python-actions/setup-python@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - id: setup-python - with: - python-version: ${{ matrix.python-version }} - - name: Set up Poetry - uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - - name: Analyze Python Project - uses: ni/python-actions/analyze-project@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - with: - project-directory: ${{ inputs.package-basepath }} - install-args: ${{ inputs.install-extras && format('--extras ''{0}''', inputs.install-extras) || '' }} - # - name: Bandit security checks - # working-directory: ${{ github.workspace }} - # run: poetry run bandit -c pyproject.toml -r src/ \ No newline at end of file diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml index f6fabd7..3c3571f 100644 --- a/.github/workflows/check_package.yml +++ b/.github/workflows/check_package.yml @@ -18,14 +18,4 @@ jobs: permissions: contents: read with: - package-name: ${{ inputs.package-name }} - analyze_package: - name: Analyze package for ${{ inputs.package-name }} - needs: get_package_info - uses: ./.github/workflows/analyze_package.yml - permissions: - contents: read - with: - package-name: ${{ inputs.package-name }} - package-basepath: ${{ needs.get_package_info.outputs.package-basepath }} - install-extras: ${{ needs.get_package_info.outputs.install-extras }} \ No newline at end of file + package-name: ${{ inputs.package-name }} \ No newline at end of file From ad5a2575c7d124f1bd182cb10264d079f615293b Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Fri, 16 Oct 2026 16:58:16 +0530 Subject: [PATCH 06/39] add the permissions in check_workflows.yml --- .github/workflows/check_workflows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check_workflows.yml b/.github/workflows/check_workflows.yml index f736021..3fda8bd 100644 --- a/.github/workflows/check_workflows.yml +++ b/.github/workflows/check_workflows.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read + security-events: write steps: - name: Check out repo uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 From 7cde22236729ae504da07fc486e3eeb505d8b672 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Fri, 16 Oct 2026 17:14:58 +0530 Subject: [PATCH 07/39] remove the security events --- .github/workflows/check_workflows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check_workflows.yml b/.github/workflows/check_workflows.yml index 3fda8bd..f736021 100644 --- a/.github/workflows/check_workflows.yml +++ b/.github/workflows/check_workflows.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - security-events: write steps: - name: Check out repo uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 From cb3bf6df9ff1bd0c088e61c708dd374562517ab5 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Fri, 16 Oct 2026 17:31:44 +0530 Subject: [PATCH 08/39] upadte the workflows --- .github/workflows/check_workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_workflows.yml b/.github/workflows/check_workflows.yml index f736021..6b89d26 100644 --- a/.github/workflows/check_workflows.yml +++ b/.github/workflows/check_workflows.yml @@ -20,7 +20,7 @@ jobs: - name: Run zizmor uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7 with: - advanced-security: false # TODO: use the default when we publish the repo + advanced-security: false inputs: | .github/workflows \ No newline at end of file From 3e326582877e4e0ffba43389051c2b4ee2fe160b Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Fri, 16 Oct 2026 17:41:03 +0530 Subject: [PATCH 09/39] Revert pyproject.toml changes --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b635fa1..4c14371 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,4 +68,4 @@ exclude = ["build", "docs", "tests", ".tox", "__pycache__", ".venv*"] ignore = ["H404", "H405", "H903", "E501", "W391", "W503", "W504"] [tool.black] -line-length = 100 \ No newline at end of file +line-length = 100 From 1119e2244a851d19e54ff28bd351e1d2de1a665f Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Fri, 16 Oct 2026 17:47:51 +0530 Subject: [PATCH 10/39] remove the comment in CI.yml --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a780f5d..44b7072 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: permissions: - contents: read ## TODO: remove this when moving the repo to public + contents: read jobs: check_workflows: From aa6f40a77a7fd9141ea0ba252168ba7875f4dbb3 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Sat, 17 Oct 2026 19:28:30 +0530 Subject: [PATCH 11/39] Fix the all comments in PR --- .github/workflows/CI.yml | 7 +++--- .github/workflows/PR.yml | 11 +++++----- .github/workflows/check_package.yml | 4 +--- .github/workflows/check_workflows.yml | 8 +++---- .github/workflows/get_package_info.yml | 4 +--- .github/workflows/get_package_names.yml | 4 +--- .github/workflows/publish-to-pypi.yml | 2 +- .github/workflows/report_test_results.yml | 3 +-- .github/workflows/test-wheel-build.yml | 26 +++++++++++++++++++++++ .github/workflows/test_package.yml | 9 ++++---- 10 files changed, 49 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/test-wheel-build.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 44b7072..9bee6ea 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,9 +7,8 @@ on: workflow_call: workflow_dispatch: -permissions: - contents: read - +permissions: {} + jobs: check_workflows: name: Check workflows @@ -41,6 +40,6 @@ jobs: needs: test_packages uses: ./.github/workflows/report_test_results.yml permissions: - checks: write # needed to push the aggregated report pull-requests: write # needed to post the report to the PR contents: read # needed only if the repo is internal, remove this if public + diff --git a/.github/workflows/PR.yml b/.github/workflows/PR.yml index 9546812..4841912 100644 --- a/.github/workflows/PR.yml +++ b/.github/workflows/PR.yml @@ -7,8 +7,7 @@ on: workflow_call: workflow_dispatch: -permissions: - contents: read +permissions: {} concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true @@ -18,6 +17,8 @@ jobs: name: Run CI uses: ./.github/workflows/CI.yml permissions: - contents: read - checks: write - pull-requests: write \ No newline at end of file + checks: write # needed to push the aggregated test results report + pull-requests: write # needed to post the test results report to the PR + + + diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml index 3c3571f..49cf4f4 100644 --- a/.github/workflows/check_package.yml +++ b/.github/workflows/check_package.yml @@ -15,7 +15,5 @@ jobs: get_package_info: name: Get package info for ${{ inputs.package-name }} uses: ./.github/workflows/get_package_info.yml - permissions: - contents: read with: - package-name: ${{ inputs.package-name }} \ No newline at end of file + package-name: ${{ inputs.package-name }} diff --git a/.github/workflows/check_workflows.yml b/.github/workflows/check_workflows.yml index 6b89d26..c3ad500 100644 --- a/.github/workflows/check_workflows.yml +++ b/.github/workflows/check_workflows.yml @@ -10,8 +10,6 @@ jobs: zizmor: name: Run zizmor runs-on: ubuntu-latest - permissions: - contents: read steps: - name: Check out repo uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -20,7 +18,9 @@ jobs: - name: Run zizmor uses: zizmorcore/zizmor-action@192e21d79ab29983730a13d1382995c2307fbcaa # v0.5.7 with: - advanced-security: false + advanced-security: false # TODO: use the default when we publish the repo inputs: | .github/workflows - \ No newline at end of file + + + diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index d2177f9..a911b8a 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -22,8 +22,6 @@ jobs: get_package_info: name: Get package info for ${{ inputs.package-name }} runs-on: ubuntu-latest - permissions: - contents: read outputs: package-basepath: ${{ steps.parse_json.outputs.package-basepath }} install-extras: ${{ steps.parse_json.outputs.install-extras }} @@ -63,4 +61,4 @@ jobs: env: STEP_OUTPUTS: ${{ toJSON(steps.parse_json.outputs) }} run: | - echo "$STEP_OUTPUTS" \ No newline at end of file + echo "$STEP_OUTPUTS" diff --git a/.github/workflows/get_package_names.yml b/.github/workflows/get_package_names.yml index 73fea9d..714a062 100644 --- a/.github/workflows/get_package_names.yml +++ b/.github/workflows/get_package_names.yml @@ -13,8 +13,6 @@ jobs: get_package_names: name: Get package names runs-on: ubuntu-latest - permissions: - contents: read outputs: package-names: ${{ steps.parse_json.outputs.package-names }} steps: @@ -32,4 +30,4 @@ jobs: exit 1 fi echo "Package names: $info" - echo "package-names=$info" >> $GITHUB_OUTPUT \ No newline at end of file + echo "package-names=$info" >> $GITHUB_OUTPUT diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index bc88461..a8b94a2 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -37,4 +37,4 @@ jobs: uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 # zizmor: ignore[use-trusted-publishing] Temporary token authentication; migration tracked in follow-up PR with: - password: ${{ secrets.pypi_password }} \ No newline at end of file + password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/report_test_results.yml b/.github/workflows/report_test_results.yml index cf71c3e..f144fd4 100644 --- a/.github/workflows/report_test_results.yml +++ b/.github/workflows/report_test_results.yml @@ -11,7 +11,6 @@ jobs: name: Report test results runs-on: ubuntu-latest permissions: - contents: read checks: write pull-requests: write steps: @@ -31,4 +30,4 @@ jobs: uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2.23.0 with: files: "test_results/**/*.xml" - if: always() \ No newline at end of file + if: always() diff --git a/.github/workflows/test-wheel-build.yml b/.github/workflows/test-wheel-build.yml new file mode 100644 index 0000000..9a59080 --- /dev/null +++ b/.github/workflows/test-wheel-build.yml @@ -0,0 +1,26 @@ +name: Test Building Python Package + +on: [push, pull_request] + +jobs: + build-and-upload-artifact: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Set up Python 3.9 + uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + with: + python-version: 3.9 + + - name: Set up Poetry + uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + + - name: Build packages + run: poetry build + + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: build artifacts + path: dist/ diff --git a/.github/workflows/test_package.yml b/.github/workflows/test_package.yml index a8b7838..ecb2055 100644 --- a/.github/workflows/test_package.yml +++ b/.github/workflows/test_package.yml @@ -21,8 +21,6 @@ jobs: get_package_info: name: Get package info - ${{ inputs.package-name }} uses: ./.github/workflows/get_package_info.yml - permissions: - contents: read with: package-name: ${{ inputs.package-name }} @@ -59,7 +57,7 @@ jobs: uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/.venv - key: ${{ inputs.package-name }}-${{ matrix.os }}-py${{ matrix.python-version }}-${{ needs.get_package_info.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} + key: ${{ inputs.package-name }}-${{ matrix.os }}-py${{ matrix.python-version }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', github.workspace, needs.get_package_info.outputs.package-basepath)) }} - name: Install ${{ inputs.package-name }} run: poetry install -v @@ -77,5 +75,8 @@ jobs: uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: test_results_unit_${{ inputs.package-name }}_${{ matrix.os }}_py${{ steps.setup-python.outputs.python-version }} - path: ${{ github.workspace }}/test_results/*.xml + path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/test_results/*.xml if: always() + + + From 0f717d9f2958b2fcc91627fb6d6de34f325cd61d Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Sat, 17 Oct 2026 19:38:55 +0530 Subject: [PATCH 12/39] fix the comments on PR --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9bee6ea..553a51d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -40,6 +40,6 @@ jobs: needs: test_packages uses: ./.github/workflows/report_test_results.yml permissions: + checks: write # needed to push the aggregated report pull-requests: write # needed to post the report to the PR - contents: read # needed only if the repo is internal, remove this if public From 6d10909e9aac35623b9c3c8f7216388e1a2a5fdb Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Sat, 17 Oct 2026 19:46:02 +0530 Subject: [PATCH 13/39] remove the contents:read pemissions in commented workflows --- .github/workflows/test_package.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test_package.yml b/.github/workflows/test_package.yml index ecb2055..bd8fb74 100644 --- a/.github/workflows/test_package.yml +++ b/.github/workflows/test_package.yml @@ -35,8 +35,6 @@ jobs: name: Run unit tests - ${{ inputs.package-name }} (${{ matrix.python-version }} - ${{ matrix.os }}) needs: get_package_info runs-on: ${{ matrix.os }} - permissions: - contents: read steps: - name: Check out repo uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -80,3 +78,4 @@ jobs: + From ccfc71300e5a25dc7881cfb961fb6bb47318a93d Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Sat, 17 Oct 2026 19:55:14 +0530 Subject: [PATCH 14/39] fixing the comments on PR and remove the contents:read from workflows --- .github/workflows/test-wheel-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-wheel-build.yml b/.github/workflows/test-wheel-build.yml index 9a59080..0116335 100644 --- a/.github/workflows/test-wheel-build.yml +++ b/.github/workflows/test-wheel-build.yml @@ -8,6 +8,8 @@ jobs: steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Set up Python 3.9 uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 From 01cb9de2f7406ed0dae3c3aa8edca59204f80543 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Sat, 17 Oct 2026 20:04:02 +0530 Subject: [PATCH 15/39] fixing the comments on PR and remove the contents:read from workflows --- .github/workflows/test-wheel-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-wheel-build.yml b/.github/workflows/test-wheel-build.yml index 0116335..ec43dc5 100644 --- a/.github/workflows/test-wheel-build.yml +++ b/.github/workflows/test-wheel-build.yml @@ -2,6 +2,8 @@ name: Test Building Python Package on: [push, pull_request] +permissions: {} + jobs: build-and-upload-artifact: runs-on: ubuntu-latest From 1edb9055f4bf9b40a452abc89222542b6f44a65d Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Sat, 17 Oct 2026 20:30:02 +0530 Subject: [PATCH 16/39] fixing the comments on PR and remove the contents:read from workflows --- .github/workflows/test_package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_package.yml b/.github/workflows/test_package.yml index bd8fb74..da23843 100644 --- a/.github/workflows/test_package.yml +++ b/.github/workflows/test_package.yml @@ -55,7 +55,7 @@ jobs: uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/.venv - key: ${{ inputs.package-name }}-${{ matrix.os }}-py${{ matrix.python-version }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', github.workspace, needs.get_package_info.outputs.package-basepath)) }} + key: ${{ inputs.package-name }}-${{ matrix.os }}-py${{ matrix.python-version }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install ${{ inputs.package-name }} run: poetry install -v @@ -75,7 +75,7 @@ jobs: name: test_results_unit_${{ inputs.package-name }}_${{ matrix.os }}_py${{ steps.setup-python.outputs.python-version }} path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/test_results/*.xml if: always() - + From 7e1559417ed4cd8e1a0eae5d077a59eb583d81d7 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Mon, 19 Oct 2026 15:00:41 +0530 Subject: [PATCH 17/39] Update test_package.yml --- .github/workflows/test_package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_package.yml b/.github/workflows/test_package.yml index da23843..83a84af 100644 --- a/.github/workflows/test_package.yml +++ b/.github/workflows/test_package.yml @@ -73,7 +73,7 @@ jobs: uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: test_results_unit_${{ inputs.package-name }}_${{ matrix.os }}_py${{ steps.setup-python.outputs.python-version }} - path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/test_results/*.xml + path: ${{ needs.get_package_info.outputs.package-basepath }}/test_results/*.xml if: always() From 4994e839d0764ee20dc5b3904ec25f30c65d47db Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Mon, 19 Oct 2026 15:05:49 +0530 Subject: [PATCH 18/39] Update CI.yml --- .github/workflows/CI.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 553a51d..16f684e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -34,6 +34,12 @@ jobs: uses: ./.github/workflows/test_package.yml with: package-name: ${{ matrix.package-name }} + + test_wheel_build: + name: Test wheel build + needs: check_packages + uses: ./.github/workflows/test_wheel_build.yml + report_test_results: name: Report test results if: ${{ always() }} From 6ff0af853a5b3a21fe35543510d76162f35ecaf4 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Mon, 19 Oct 2026 15:06:41 +0530 Subject: [PATCH 19/39] Update test-wheel-build.yml --- .github/workflows/test-wheel-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-wheel-build.yml b/.github/workflows/test-wheel-build.yml index ec43dc5..ad8e4bf 100644 --- a/.github/workflows/test-wheel-build.yml +++ b/.github/workflows/test-wheel-build.yml @@ -1,6 +1,8 @@ name: Test Building Python Package -on: [push, pull_request] +on: + workflow_call: + workflow_dispatch: permissions: {} From 94bc5c94a597e0c5d44f9a5fc668f19cbf5209e1 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Mon, 19 Oct 2026 15:28:30 +0530 Subject: [PATCH 20/39] Rename test-wheel-build.yml to test_wheel_build.yml --- .github/workflows/{test-wheel-build.yml => test_wheel_build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{test-wheel-build.yml => test_wheel_build.yml} (100%) diff --git a/.github/workflows/test-wheel-build.yml b/.github/workflows/test_wheel_build.yml similarity index 100% rename from .github/workflows/test-wheel-build.yml rename to .github/workflows/test_wheel_build.yml From a21e81829c3845766d1bcd5b924e4466ffa57f9d Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Mon, 19 Oct 2026 16:32:29 +0530 Subject: [PATCH 21/39] Delete .github/workflows/publish-to-pypi.yml --- .github/workflows/publish-to-pypi.yml | 40 --------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml deleted file mode 100644 index a8b94a2..0000000 --- a/.github/workflows/publish-to-pypi.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Publish Package to PyPI - -on: - release: - types: - - published - -jobs: - build-and-publish: # zizmor: ignore[excessive-permissions] Temporary: permissions hardening tracked in follow-up PR - if: github.repository == 'ni/nisyscfg-python' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Set up Python 3.9 - uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 - with: - python-version: 3.9 - - - name: Set up Poetry - uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - - - name: Build packages - run: poetry build - - - name: Publish distribution to Test PyPI - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 - # zizmor: ignore[use-trusted-publishing] Temporary token authentication; migration tracked in follow-up PR - with: - repository-url: https://test.pypi.org/legacy/ - password: ${{ secrets.test_pypi_password }} - continue-on-error: true - - - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 - # zizmor: ignore[use-trusted-publishing] Temporary token authentication; migration tracked in follow-up PR - with: - password: ${{ secrets.pypi_password }} From 27f44ab2c4ae0e7516246ebd51012f7a4a598e76 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Mon, 19 Oct 2026 16:33:07 +0530 Subject: [PATCH 22/39] update publish.yml file --- .github/workflows/publish.yml | 163 ++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d94bf45 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,163 @@ +name: Publish to PyPI + +on: + release: + types: [published] + workflow_dispatch: + inputs: + environment: + description: The environment to publish to. + default: 'none' + required: true + type: choice + options: + - none + - pypi + - testpypi + package-name: + description: The name of the package to publish. + default: 'none' + required: true + type: choice + options: + - none + - nisyscfg + +permissions: {} + +env: + environment: ${{ github.event_name == 'release' && 'pypi' || inputs.environment }} + environment-info: | + { + "pypi": { + "base-url": "https://pypi.org", + "upload-url": "https://upload.pypi.org/legacy/" + }, + "testpypi": { + "base-url": "https://test.pypi.org", + "upload-url": "https://test.pypi.org/legacy/" + } + } + +jobs: + get_publish_info: + name: Get publish info + runs-on: ubuntu-latest + permissions: {} + outputs: + package-name: ${{ steps.get_package_name_and_version.outputs.package-name }} + package-version: ${{ steps.get_package_name_and_version.outputs.package-version }} + steps: + - name: Get package name and package version + id: get_package_name_and_version + env: + EVENT_NAME: ${{ github.event_name }} + EVENT_TAG: ${{ github.event.release.tag_name }} + INPUT_PACKAGE_NAME: ${{ inputs.package-name }} + run: | + if [ "$EVENT_NAME" == "release" ]; then + if [[ ! "$EVENT_TAG" =~ ^[^/]+/[^/]+$ ]]; then + echo "::error::Invalid release tag '$EVENT_TAG'. Expected format: /" + exit 1 + fi + + PKG_NAME=$(echo "$EVENT_TAG" | cut -d / -f 1) + echo "package-name=$PKG_NAME" >> "$GITHUB_OUTPUT" + + PKG_VERSION=$(echo "$EVENT_TAG" | cut -d / -f 2) + echo "package-version=$PKG_VERSION" >> "$GITHUB_OUTPUT" + else + echo "package-name=$INPUT_PACKAGE_NAME" >> "$GITHUB_OUTPUT" + echo "package-version=unused" >> "$GITHUB_OUTPUT" + fi + get_package_info: + name: Get package info for ${{ needs.get_publish_info.outputs.package-name }} + if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} + uses: ./.github/workflows/get_package_info.yml + needs: get_publish_info + permissions: + contents: read + with: + package-name: ${{ needs.get_publish_info.outputs.package-name }} + # TODO: Call analyze package post including analyze package file which uses ni/python-actions/analyze-project + # TODO: Call check docs post including check docs file which generates docs. + build_package: + name: Build ${{ needs.get_publish_info.outputs.package-name }} + if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} + runs-on: ubuntu-latest + needs: [get_publish_info, get_package_info] # TODO: Add analyze package and check docs to needs + steps: + - name: Check out repo + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Set up Python + uses: ni/python-actions/setup-python@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + - name: Set up Poetry + uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + with: + use-cache: false + - name: Check project version + if: github.event_name == 'release' + uses: ni/python-actions/check-project-version@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + with: + project-directory: ${{ github.workspace }} + expected-version: ${{ needs.get_publish_info.outputs.package-version }} + - name: Build distribution packages + run: poetry build + working-directory: ${{ github.workspace }} + - name: Verify distribution packages + run: | + test -n "$(find dist -maxdepth 1 -type f -name '*.whl' -print -quit)" + test -n "$(find dist -maxdepth 1 -type f -name '*.tar.gz' -print -quit)" + ls -l dist + - name: Upload build artifacts + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: ${{ needs.get_publish_info.outputs.package-name }}-distribution-packages + path: dist/* + publish_to_pypi: + name: Publish ${{ needs.get_publish_info.outputs.package-name }} + if: ${{ github.event_name == 'release' || inputs.environment != 'none' }} + runs-on: ubuntu-latest + needs: [get_publish_info, get_package_info, build_package] + environment: + name: ${{ github.event_name == 'release' && 'pypi' || inputs.environment }} + url: ${{ fromJson(env.environment-info)[env.environment].base-url }}/p/${{ needs.get_publish_info.outputs.package-name }} + permissions: + id-token: write + steps: + - name: Download build artifacts + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + with: + name: ${{ needs.get_publish_info.outputs.package-name }}-distribution-packages + path: dist/ + - name: Display distribution packages + run: ls -lR dist/ + - name: Upload to ${{ env.environment }} + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + with: + repository-url: ${{ fromJson(env.environment-info)[env.environment].upload-url }} + packages-dir: dist/ + update_version: + name: Update ${{ needs.get_publish_info.outputs.package-name }} version + if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} + runs-on: ubuntu-latest + needs: [get_publish_info, get_package_info, build_package] + permissions: + contents: write + pull-requests: write + steps: + - name: Check out repo + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Set up Python + uses: ni/python-actions/setup-python@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + - name: Set up Poetry + uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + - name: Update project version + uses: ni/python-actions/update-project-version@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 + with: + project-directory: ${{ github.workspace }} + branch-prefix: users/build/${{ needs.get_publish_info.outputs.package-name }}- \ No newline at end of file From f30736dc60d349e4839e1f946d83a8a79e941eb5 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 10:39:21 +0530 Subject: [PATCH 23/39] Update test_package.yml --- .github/workflows/test_package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_package.yml b/.github/workflows/test_package.yml index 83a84af..da23843 100644 --- a/.github/workflows/test_package.yml +++ b/.github/workflows/test_package.yml @@ -73,7 +73,7 @@ jobs: uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: test_results_unit_${{ inputs.package-name }}_${{ matrix.os }}_py${{ steps.setup-python.outputs.python-version }} - path: ${{ needs.get_package_info.outputs.package-basepath }}/test_results/*.xml + path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/test_results/*.xml if: always() From c76fed55177dcccee5016c0f4f06b0d9eccae5ed Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 10:47:25 +0530 Subject: [PATCH 24/39] Update get_package_info.yml --- .github/workflows/get_package_info.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index a911b8a..bbc25d3 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -54,9 +54,15 @@ jobs: if [ "${install_extras}" == "null" ]; then install_extras="" fi - echo "package-basepath=${package_basepath}" >> $GITHUB_OUTPUT - echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT - echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT + # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment + output_basepath="${package_basepath#./}" + output_basepath="${output_basepath%/}" + if [ "$output_basepath" = "." ]; then + output_basepath="" + fi + echo "package-basepath=${output_basepath}" >> $GITHUB_OUTPUT + echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT + echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT - name: Show package info env: STEP_OUTPUTS: ${{ toJSON(steps.parse_json.outputs) }} From 9ce2b1d44032a93c73eb100a2ce88d4919d16eca Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 10:55:57 +0530 Subject: [PATCH 25/39] Update get_package_info.yml --- .github/workflows/get_package_info.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index bbc25d3..4c16a50 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -60,9 +60,9 @@ jobs: if [ "$output_basepath" = "." ]; then output_basepath="" fi - echo "package-basepath=${output_basepath}" >> $GITHUB_OUTPUT - echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT - echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT + echo "package-basepath=${output_basepath}" >> $GITHUB_OUTPUT + echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT + echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT - name: Show package info env: STEP_OUTPUTS: ${{ toJSON(steps.parse_json.outputs) }} From 6472c5e94bfdc818c54fdc317741201a2cf92a39 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 12:19:38 +0530 Subject: [PATCH 26/39] Update get_package_info.yml --- .github/workflows/get_package_info.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index 4c16a50..41f9107 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -55,12 +55,12 @@ jobs: install_extras="" fi # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment - output_basepath="${package_basepath#./}" - output_basepath="${output_basepath%/}" - if [ "$output_basepath" = "." ]; then - output_basepath="" + package_basepath="${package_basepath#./}" + package_basepath="${package_basepath%/}" + if [ "$package_basepath" = "." ]; then + package_basepath="" fi - echo "package-basepath=${output_basepath}" >> $GITHUB_OUTPUT + echo "package-basepath=${package_basepath}" >> $GITHUB_OUTPUT echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT - name: Show package info From 6d2cb16862b69aeb70bebd4d2082595093221bcc Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 12:26:32 +0530 Subject: [PATCH 27/39] Update get_package_info.yml --- .github/workflows/get_package_info.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index 41f9107..f3d2a18 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -54,12 +54,12 @@ jobs: if [ "${install_extras}" == "null" ]; then install_extras="" fi - # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment - package_basepath="${package_basepath#./}" - package_basepath="${package_basepath%/}" - if [ "$package_basepath" = "." ]; then - package_basepath="" - fi + # # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment + # package_basepath="${package_basepath#./}" + # package_basepath="${package_basepath%/}" + # if [ "$package_basepath" = "." ]; then + # package_basepath="" + # fi echo "package-basepath=${package_basepath}" >> $GITHUB_OUTPUT echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT From 6bfb8b4702ffee46a63868e0360bc50a8e591614 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 12:30:44 +0530 Subject: [PATCH 28/39] Update get_package_info.yml --- .github/workflows/get_package_info.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index f3d2a18..41f9107 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -54,12 +54,12 @@ jobs: if [ "${install_extras}" == "null" ]; then install_extras="" fi - # # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment - # package_basepath="${package_basepath#./}" - # package_basepath="${package_basepath%/}" - # if [ "$package_basepath" = "." ]; then - # package_basepath="" - # fi + # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment + package_basepath="${package_basepath#./}" + package_basepath="${package_basepath%/}" + if [ "$package_basepath" = "." ]; then + package_basepath="" + fi echo "package-basepath=${package_basepath}" >> $GITHUB_OUTPUT echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT From 00d167ed11a9d93f11de095e25798194434ea457 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 12:45:43 +0530 Subject: [PATCH 29/39] Update get_package_info.yml --- .github/workflows/get_package_info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index 41f9107..697827d 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -54,7 +54,7 @@ jobs: if [ "${install_extras}" == "null" ]; then install_extras="" fi - # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment + # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment package_basepath="${package_basepath#./}" package_basepath="${package_basepath%/}" if [ "$package_basepath" = "." ]; then From 1d6bb8719daaa9db04951035cff186b0677ad71b Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 14:24:58 +0530 Subject: [PATCH 30/39] Delete .github/workflows/publish.yml --- .github/workflows/publish.yml | 163 ---------------------------------- 1 file changed, 163 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index d94bf45..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,163 +0,0 @@ -name: Publish to PyPI - -on: - release: - types: [published] - workflow_dispatch: - inputs: - environment: - description: The environment to publish to. - default: 'none' - required: true - type: choice - options: - - none - - pypi - - testpypi - package-name: - description: The name of the package to publish. - default: 'none' - required: true - type: choice - options: - - none - - nisyscfg - -permissions: {} - -env: - environment: ${{ github.event_name == 'release' && 'pypi' || inputs.environment }} - environment-info: | - { - "pypi": { - "base-url": "https://pypi.org", - "upload-url": "https://upload.pypi.org/legacy/" - }, - "testpypi": { - "base-url": "https://test.pypi.org", - "upload-url": "https://test.pypi.org/legacy/" - } - } - -jobs: - get_publish_info: - name: Get publish info - runs-on: ubuntu-latest - permissions: {} - outputs: - package-name: ${{ steps.get_package_name_and_version.outputs.package-name }} - package-version: ${{ steps.get_package_name_and_version.outputs.package-version }} - steps: - - name: Get package name and package version - id: get_package_name_and_version - env: - EVENT_NAME: ${{ github.event_name }} - EVENT_TAG: ${{ github.event.release.tag_name }} - INPUT_PACKAGE_NAME: ${{ inputs.package-name }} - run: | - if [ "$EVENT_NAME" == "release" ]; then - if [[ ! "$EVENT_TAG" =~ ^[^/]+/[^/]+$ ]]; then - echo "::error::Invalid release tag '$EVENT_TAG'. Expected format: /" - exit 1 - fi - - PKG_NAME=$(echo "$EVENT_TAG" | cut -d / -f 1) - echo "package-name=$PKG_NAME" >> "$GITHUB_OUTPUT" - - PKG_VERSION=$(echo "$EVENT_TAG" | cut -d / -f 2) - echo "package-version=$PKG_VERSION" >> "$GITHUB_OUTPUT" - else - echo "package-name=$INPUT_PACKAGE_NAME" >> "$GITHUB_OUTPUT" - echo "package-version=unused" >> "$GITHUB_OUTPUT" - fi - get_package_info: - name: Get package info for ${{ needs.get_publish_info.outputs.package-name }} - if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} - uses: ./.github/workflows/get_package_info.yml - needs: get_publish_info - permissions: - contents: read - with: - package-name: ${{ needs.get_publish_info.outputs.package-name }} - # TODO: Call analyze package post including analyze package file which uses ni/python-actions/analyze-project - # TODO: Call check docs post including check docs file which generates docs. - build_package: - name: Build ${{ needs.get_publish_info.outputs.package-name }} - if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} - runs-on: ubuntu-latest - needs: [get_publish_info, get_package_info] # TODO: Add analyze package and check docs to needs - steps: - - name: Check out repo - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Set up Python - uses: ni/python-actions/setup-python@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - - name: Set up Poetry - uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - with: - use-cache: false - - name: Check project version - if: github.event_name == 'release' - uses: ni/python-actions/check-project-version@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - with: - project-directory: ${{ github.workspace }} - expected-version: ${{ needs.get_publish_info.outputs.package-version }} - - name: Build distribution packages - run: poetry build - working-directory: ${{ github.workspace }} - - name: Verify distribution packages - run: | - test -n "$(find dist -maxdepth 1 -type f -name '*.whl' -print -quit)" - test -n "$(find dist -maxdepth 1 -type f -name '*.tar.gz' -print -quit)" - ls -l dist - - name: Upload build artifacts - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: ${{ needs.get_publish_info.outputs.package-name }}-distribution-packages - path: dist/* - publish_to_pypi: - name: Publish ${{ needs.get_publish_info.outputs.package-name }} - if: ${{ github.event_name == 'release' || inputs.environment != 'none' }} - runs-on: ubuntu-latest - needs: [get_publish_info, get_package_info, build_package] - environment: - name: ${{ github.event_name == 'release' && 'pypi' || inputs.environment }} - url: ${{ fromJson(env.environment-info)[env.environment].base-url }}/p/${{ needs.get_publish_info.outputs.package-name }} - permissions: - id-token: write - steps: - - name: Download build artifacts - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 - with: - name: ${{ needs.get_publish_info.outputs.package-name }}-distribution-packages - path: dist/ - - name: Display distribution packages - run: ls -lR dist/ - - name: Upload to ${{ env.environment }} - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 - with: - repository-url: ${{ fromJson(env.environment-info)[env.environment].upload-url }} - packages-dir: dist/ - update_version: - name: Update ${{ needs.get_publish_info.outputs.package-name }} version - if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} - runs-on: ubuntu-latest - needs: [get_publish_info, get_package_info, build_package] - permissions: - contents: write - pull-requests: write - steps: - - name: Check out repo - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Set up Python - uses: ni/python-actions/setup-python@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - - name: Set up Poetry - uses: ni/python-actions/setup-poetry@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - - name: Update project version - uses: ni/python-actions/update-project-version@aa64e60612cb078b0c2ada666becbd70d4817d55 # v0.7.1 - with: - project-directory: ${{ github.workspace }} - branch-prefix: users/build/${{ needs.get_publish_info.outputs.package-name }}- \ No newline at end of file From f9a9a8c71fa6a6f26892b328be9170bb35ed4318 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 14:25:45 +0530 Subject: [PATCH 31/39] update the publish.yml --- .github/workflows/publish.yml | 160 ++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..326b7cf --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,160 @@ +name: Publish to PyPI + +on: + release: + types: [published] + workflow_dispatch: + inputs: + environment: + description: The environment to publish to. + default: 'none' + required: true + type: choice + options: + - none + - pypi + - testpypi + package-name: + description: The name of the package to publish. + default: 'none' + required: true + type: choice + options: + - none + - nisyscfg + +permissions: {} + +env: + environment: ${{ case(github.event_name == 'release', 'pypi', inputs.environment) }} + environment-info: | + { + "pypi": { + "base-url": "https://pypi.org", + "upload-url": "https://upload.pypi.org/legacy/" + }, + "testpypi": { + "base-url": "https://test.pypi.org", + "upload-url": "https://test.pypi.org/legacy/" + } + } + +jobs: + get_publish_info: + name: Get publish info + runs-on: ubuntu-latest + permissions: {} + outputs: + package-name: ${{ steps.get_package_name_and_version.outputs.package-name }} + package-version: ${{ steps.get_package_name_and_version.outputs.package-version }} + steps: + - name: Get package name and package version + id: get_package_name_and_version + env: + EVENT_NAME: ${{ github.event_name }} + EVENT_TAG: ${{ github.event.release.tag_name }} + INPUT_PACKAGE_NAME: ${{ inputs.package-name }} + run: | + if [ "$EVENT_NAME" = "release" ]; then + if [[ ! "$EVENT_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "::error::Invalid release tag '$EVENT_TAG'. Expected format: v.." + exit 1 + fi + + echo "package-name=nisyscfg" >> "$GITHUB_OUTPUT" + echo "package-version=${EVENT_TAG#v}" >> "$GITHUB_OUTPUT" + else + echo "package-name=$INPUT_PACKAGE_NAME" >> "$GITHUB_OUTPUT" + echo "package-version=unused" >> "$GITHUB_OUTPUT" + fi + get_package_info: + name: Get package info for ${{ needs.get_publish_info.outputs.package-name }} + if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} + uses: ./.github/workflows/get_package_info.yml + needs: get_publish_info + permissions: + contents: read + with: + package-name: ${{ needs.get_publish_info.outputs.package-name }} + # TODO: Call analyze package post including analyze package file which uses ni/python-actions/analyze-project + # TODO: Call check docs post including check docs file which generates docs. + build_package: + name: Build ${{ needs.get_publish_info.outputs.package-name }} + if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} + runs-on: ubuntu-latest + needs: [get_publish_info, get_package_info] # TODO: Add analyze package and check docs to needs + steps: + - name: Check out repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Python + uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + - name: Set up Poetry + uses: ni/python-actions/setup-poetry@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + with: + use-cache: false + - name: Check project version + if: github.event_name == 'release' + uses: ni/python-actions/check-project-version@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + with: + project-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + expected-version: ${{ needs.get_publish_info.outputs.package-version }} + - name: Build distribution packages + run: poetry build + working-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + - name: Verify distribution packages + run: | + test -n "$(find dist -maxdepth 1 -type f -name '*.whl' -print -quit)" + test -n "$(find dist -maxdepth 1 -type f -name '*.tar.gz' -print -quit)" + ls -l ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist + - name: Upload build artifacts + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: ${{ needs.get_publish_info.outputs.package-name }}-distribution-packages + path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/* + publish_to_pypi: + name: Publish ${{ needs.get_publish_info.outputs.package-name }} + if: ${{ github.event_name == 'release' || inputs.environment != 'none' }} + runs-on: ubuntu-latest + needs: [get_publish_info, get_package_info, build_package] + environment: + name: ${{ case(github.event_name == 'release', 'pypi', inputs.environment) }} + url: ${{ fromJson(env.environment-info)[env.environment].base-url }}/p/${{ needs.get_publish_info.outputs.package-name }} + permissions: + id-token: write + steps: + - name: Download build artifacts + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + with: + name: ${{ needs.get_publish_info.outputs.package-name }}-distribution-packages + path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/ + - name: Display distribution packages + run: ls -lR ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/ + - name: Upload to ${{ env.environment }} + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + with: + repository-url: ${{ fromJson(env.environment-info)[env.environment].upload-url }} + packages-dir: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/ + update_version: + name: Update ${{ needs.get_publish_info.outputs.package-name }} version + if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} + runs-on: ubuntu-latest + needs: [get_publish_info, get_package_info, build_package] + permissions: + contents: write + pull-requests: write + steps: + - name: Check out repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Python + uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + - name: Set up Poetry + uses: ni/python-actions/setup-poetry@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + - name: Update project version + uses: ni/python-actions/update-project-version@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + with: + project-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + branch-prefix: users/build/${{ needs.get_publish_info.outputs.package-name }}- \ No newline at end of file From 7e93091c8fe0975bfa5cfb5b7f4d256df7195376 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 15:29:38 +0530 Subject: [PATCH 32/39] Delete .github/workflows/publish.yml --- .github/workflows/publish.yml | 160 ---------------------------------- 1 file changed, 160 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 326b7cf..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,160 +0,0 @@ -name: Publish to PyPI - -on: - release: - types: [published] - workflow_dispatch: - inputs: - environment: - description: The environment to publish to. - default: 'none' - required: true - type: choice - options: - - none - - pypi - - testpypi - package-name: - description: The name of the package to publish. - default: 'none' - required: true - type: choice - options: - - none - - nisyscfg - -permissions: {} - -env: - environment: ${{ case(github.event_name == 'release', 'pypi', inputs.environment) }} - environment-info: | - { - "pypi": { - "base-url": "https://pypi.org", - "upload-url": "https://upload.pypi.org/legacy/" - }, - "testpypi": { - "base-url": "https://test.pypi.org", - "upload-url": "https://test.pypi.org/legacy/" - } - } - -jobs: - get_publish_info: - name: Get publish info - runs-on: ubuntu-latest - permissions: {} - outputs: - package-name: ${{ steps.get_package_name_and_version.outputs.package-name }} - package-version: ${{ steps.get_package_name_and_version.outputs.package-version }} - steps: - - name: Get package name and package version - id: get_package_name_and_version - env: - EVENT_NAME: ${{ github.event_name }} - EVENT_TAG: ${{ github.event.release.tag_name }} - INPUT_PACKAGE_NAME: ${{ inputs.package-name }} - run: | - if [ "$EVENT_NAME" = "release" ]; then - if [[ ! "$EVENT_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "::error::Invalid release tag '$EVENT_TAG'. Expected format: v.." - exit 1 - fi - - echo "package-name=nisyscfg" >> "$GITHUB_OUTPUT" - echo "package-version=${EVENT_TAG#v}" >> "$GITHUB_OUTPUT" - else - echo "package-name=$INPUT_PACKAGE_NAME" >> "$GITHUB_OUTPUT" - echo "package-version=unused" >> "$GITHUB_OUTPUT" - fi - get_package_info: - name: Get package info for ${{ needs.get_publish_info.outputs.package-name }} - if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} - uses: ./.github/workflows/get_package_info.yml - needs: get_publish_info - permissions: - contents: read - with: - package-name: ${{ needs.get_publish_info.outputs.package-name }} - # TODO: Call analyze package post including analyze package file which uses ni/python-actions/analyze-project - # TODO: Call check docs post including check docs file which generates docs. - build_package: - name: Build ${{ needs.get_publish_info.outputs.package-name }} - if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} - runs-on: ubuntu-latest - needs: [get_publish_info, get_package_info] # TODO: Add analyze package and check docs to needs - steps: - - name: Check out repo - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Set up Python - uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 - - name: Set up Poetry - uses: ni/python-actions/setup-poetry@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 - with: - use-cache: false - - name: Check project version - if: github.event_name == 'release' - uses: ni/python-actions/check-project-version@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 - with: - project-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} - expected-version: ${{ needs.get_publish_info.outputs.package-version }} - - name: Build distribution packages - run: poetry build - working-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} - - name: Verify distribution packages - run: | - test -n "$(find dist -maxdepth 1 -type f -name '*.whl' -print -quit)" - test -n "$(find dist -maxdepth 1 -type f -name '*.tar.gz' -print -quit)" - ls -l ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist - - name: Upload build artifacts - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 - with: - name: ${{ needs.get_publish_info.outputs.package-name }}-distribution-packages - path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/* - publish_to_pypi: - name: Publish ${{ needs.get_publish_info.outputs.package-name }} - if: ${{ github.event_name == 'release' || inputs.environment != 'none' }} - runs-on: ubuntu-latest - needs: [get_publish_info, get_package_info, build_package] - environment: - name: ${{ case(github.event_name == 'release', 'pypi', inputs.environment) }} - url: ${{ fromJson(env.environment-info)[env.environment].base-url }}/p/${{ needs.get_publish_info.outputs.package-name }} - permissions: - id-token: write - steps: - - name: Download build artifacts - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 - with: - name: ${{ needs.get_publish_info.outputs.package-name }}-distribution-packages - path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/ - - name: Display distribution packages - run: ls -lR ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/ - - name: Upload to ${{ env.environment }} - uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 - with: - repository-url: ${{ fromJson(env.environment-info)[env.environment].upload-url }} - packages-dir: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/ - update_version: - name: Update ${{ needs.get_publish_info.outputs.package-name }} version - if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} - runs-on: ubuntu-latest - needs: [get_publish_info, get_package_info, build_package] - permissions: - contents: write - pull-requests: write - steps: - - name: Check out repo - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - name: Set up Python - uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 - - name: Set up Poetry - uses: ni/python-actions/setup-poetry@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 - - name: Update project version - uses: ni/python-actions/update-project-version@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 - with: - project-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} - branch-prefix: users/build/${{ needs.get_publish_info.outputs.package-name }}- \ No newline at end of file From b0ff84b0ad783cb373672c041f5e6d5a23615da9 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Wed, 21 Oct 2026 15:30:20 +0530 Subject: [PATCH 33/39] upload new publish.yml file --- .github/workflows/publish.yml | 162 ++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..8438c1d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,162 @@ +name: Publish to PyPI + +on: + release: + types: [published] + workflow_dispatch: + inputs: + environment: + description: The environment to publish to. + default: 'none' + required: true + type: choice + options: + - none + - pypi + - testpypi + package-name: + description: The name of the package to publish. + default: 'none' + required: true + type: choice + options: + - none + - nisyscfg + +permissions: {} + +env: + environment: ${{ case(github.event_name == 'release', 'pypi', inputs.environment) }} + environment-info: | + { + "pypi": { + "base-url": "https://pypi.org", + "upload-url": "https://upload.pypi.org/legacy/" + }, + "testpypi": { + "base-url": "https://test.pypi.org", + "upload-url": "https://test.pypi.org/legacy/" + } + } + +jobs: + get_publish_info: + name: Get publish info + runs-on: ubuntu-latest + permissions: {} + outputs: + package-name: ${{ steps.get_package_name_and_version.outputs.package-name }} + package-version: ${{ steps.get_package_name_and_version.outputs.package-version }} + steps: + - name: Get package name and package version + id: get_package_name_and_version + env: + EVENT_NAME: ${{ github.event_name }} + EVENT_TAG: ${{ github.event.release.tag_name }} + INPUT_PACKAGE_NAME: ${{ inputs.package-name }} + run: | + if [ "$EVENT_NAME" = "release" ]; then + if [[ ! "$EVENT_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "::error::Invalid release tag '$EVENT_TAG'. Expected format: v.." + exit 1 + fi + + echo "package-name=nisyscfg" >> "$GITHUB_OUTPUT" + echo "package-version=${EVENT_TAG#v}" >> "$GITHUB_OUTPUT" + else + echo "package-name=$INPUT_PACKAGE_NAME" >> "$GITHUB_OUTPUT" + echo "package-version=unused" >> "$GITHUB_OUTPUT" + fi + get_package_info: + name: Get package info for ${{ needs.get_publish_info.outputs.package-name }} + if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} + uses: ./.github/workflows/get_package_info.yml + needs: get_publish_info + permissions: + contents: read + with: + package-name: ${{ needs.get_publish_info.outputs.package-name }} + # TODO: Call analyze package post including analyze package file which uses ni/python-actions/analyze-project + # TODO: Call check docs post including check docs file which generates docs. + build_package: + name: Build ${{ needs.get_publish_info.outputs.package-name }} + if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} + runs-on: ubuntu-latest + needs: [get_publish_info, get_package_info] # TODO: Add analyze package and check docs to needs + steps: + - name: Check out repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Python + uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + - name: Set up Poetry + uses: ni/python-actions/setup-poetry@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + with: + use-cache: false + - name: Check project version + if: github.event_name == 'release' + uses: ni/python-actions/check-project-version@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + with: + project-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + expected-version: ${{ needs.get_publish_info.outputs.package-version }} + - name: Build distribution packages + run: poetry build + working-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + - name: Verify distribution packages + run: | + test -n "$(find dist -maxdepth 1 -type f -name '*.whl' -print -quit)" + test -n "$(find dist -maxdepth 1 -type f -name '*.tar.gz' -print -quit)" + ls -l dist + working-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + - name: Upload build artifacts + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 + with: + name: ${{ needs.get_publish_info.outputs.package-name }}-distribution-packages + path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/* + publish_to_pypi: + name: Publish ${{ needs.get_publish_info.outputs.package-name }} + if: ${{ github.event_name == 'release' || inputs.environment != 'none' }} + runs-on: ubuntu-latest + needs: [get_publish_info, get_package_info, build_package] + environment: + name: ${{ case(github.event_name == 'release', 'pypi', inputs.environment) }} + url: ${{ fromJson(env.environment-info)[env.environment].base-url }}/p/${{ needs.get_publish_info.outputs.package-name }} + permissions: + id-token: write + steps: + - name: Download build artifacts + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 + with: + name: ${{ needs.get_publish_info.outputs.package-name }}-distribution-packages + path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/ + - name: Display distribution packages + run: ls -lR dist/ + working-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + - name: Upload to ${{ env.environment }} + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 + with: + repository-url: ${{ fromJson(env.environment-info)[env.environment].upload-url }} + packages-dir: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/dist/ + update_version: + name: Update ${{ needs.get_publish_info.outputs.package-name }} version + if: ${{ github.event_name == 'release' || inputs.package-name != 'none' }} + runs-on: ubuntu-latest + needs: [get_publish_info, get_package_info, build_package] + permissions: + contents: write + pull-requests: write + steps: + - name: Check out repo + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Python + uses: ni/python-actions/setup-python@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + - name: Set up Poetry + uses: ni/python-actions/setup-poetry@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + - name: Update project version + uses: ni/python-actions/update-project-version@dee640bba235ae28fdc6b7337c643bd06358ae90 # v0.9.0 + with: + project-directory: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + branch-prefix: users/build/${{ needs.get_publish_info.outputs.package-name }}- \ No newline at end of file From 0af1864fd4f74438eab232d030ea6d203d4b8284 Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Thu, 22 Oct 2026 09:46:31 +0530 Subject: [PATCH 34/39] Update python-packages.json --- .github/python-packages.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/python-packages.json b/.github/python-packages.json index 7f4ca21..6c7df7f 100644 --- a/.github/python-packages.json +++ b/.github/python-packages.json @@ -1,5 +1,5 @@ { "nisyscfg": { - "package-basepath": "." + "package-basepath": "" } -} \ No newline at end of file +} From 036c3945cc3eb8b35d5263c6304504e84d57aadb Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Thu, 22 Oct 2026 09:47:22 +0530 Subject: [PATCH 35/39] Update get_package_info.yml --- .github/workflows/get_package_info.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index 697827d..fed3e8e 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -54,12 +54,12 @@ jobs: if [ "${install_extras}" == "null" ]; then install_extras="" fi - # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment - package_basepath="${package_basepath#./}" - package_basepath="${package_basepath%/}" - if [ "$package_basepath" = "." ]; then - package_basepath="" - fi + # # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment + # package_basepath="${package_basepath#./}" + # package_basepath="${package_basepath%/}" + # if [ "$package_basepath" = "." ]; then + # package_basepath="" + # fi echo "package-basepath=${package_basepath}" >> $GITHUB_OUTPUT echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT From 8747fd49a8b21970f4416fe0c30161409cfd48eb Mon Sep 17 00:00:00 2001 From: Harikrishna-2016 Date: Thu, 22 Oct 2026 10:10:07 +0530 Subject: [PATCH 36/39] Update python-packages.json --- .github/python-packages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/python-packages.json b/.github/python-packages.json index 6c7df7f..63f5f65 100644 --- a/.github/python-packages.json +++ b/.github/python-packages.json @@ -1,5 +1,5 @@ { "nisyscfg": { - "package-basepath": "" + "package-basepath": "." } } From 422f47c482b80f0cdd8e7ff705d24f2313534813 Mon Sep 17 00:00:00 2001 From: sourabhutaniCG Date: Thu, 22 Oct 2026 11:21:14 +0530 Subject: [PATCH 37/39] changes --- .github/workflows/get_package_info.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index fed3e8e..a911b8a 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -54,12 +54,6 @@ jobs: if [ "${install_extras}" == "null" ]; then install_extras="" fi - # # Repo root ("." or "./") -> empty, so workspace//test_results has no "./" segment - # package_basepath="${package_basepath#./}" - # package_basepath="${package_basepath%/}" - # if [ "$package_basepath" = "." ]; then - # package_basepath="" - # fi echo "package-basepath=${package_basepath}" >> $GITHUB_OUTPUT echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT From 9134ce963ff6d385f9d09a1ac56d991546404f4b Mon Sep 17 00:00:00 2001 From: sourabhutaniCG Date: Thu, 22 Oct 2026 11:23:25 +0530 Subject: [PATCH 38/39] Update test_package.yml --- .github/workflows/test_package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_package.yml b/.github/workflows/test_package.yml index da23843..2d75f45 100644 --- a/.github/workflows/test_package.yml +++ b/.github/workflows/test_package.yml @@ -73,7 +73,7 @@ jobs: uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: test_results_unit_${{ inputs.package-name }}_${{ matrix.os }}_py${{ steps.setup-python.outputs.python-version }} - path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/test_results/*.xml + path: ${{ github.workspace }}${{ needs.get_package_info.outputs.package-basepath == '.' && '' || format('/{0}', needs.get_package_info.outputs.package-basepath) }}/test_results/*.xml if: always() From b1b6a71c986e04f06d1d67a3fe628162d01086f4 Mon Sep 17 00:00:00 2001 From: sourabhutaniCG Date: Thu, 22 Oct 2026 12:09:18 +0530 Subject: [PATCH 39/39] Update test_package.yml --- .github/workflows/test_package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_package.yml b/.github/workflows/test_package.yml index 2d75f45..32aa7a2 100644 --- a/.github/workflows/test_package.yml +++ b/.github/workflows/test_package.yml @@ -73,7 +73,7 @@ jobs: uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: test_results_unit_${{ inputs.package-name }}_${{ matrix.os }}_py${{ steps.setup-python.outputs.python-version }} - path: ${{ github.workspace }}${{ needs.get_package_info.outputs.package-basepath == '.' && '' || format('/{0}', needs.get_package_info.outputs.package-basepath) }}/test_results/*.xml + path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath == '.' && 'test_results/*.xml' || format('{0}/test_results/*.xml', needs.get_package_info.outputs.package-basepath) }} if: always()