diff --git a/.ci/ansys-actions/pyproject.toml b/.ci/ansys-actions/pyproject.toml index d3ee31711..287c36905 100644 --- a/.ci/ansys-actions/pyproject.toml +++ b/.ci/ansys-actions/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] # Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections -name = "ansys-actions-core" +name = "ansys-actions" version = "10.1.dev0" description = "A demo library for testing Ansys actions" readme = "README.rst" @@ -24,7 +24,7 @@ classifiers = [ dependencies = ["importlib-metadata >=4.0"] [tool.flit.module] -name = "ansys.actions.core" +name = "ansys.actions" [project.urls] Source = "https://github.com/ansys/actions" diff --git a/.ci/ansys-actions/src/ansys/actions/core/__init__.py b/.ci/ansys-actions/src/ansys/actions/__init__.py similarity index 100% rename from .ci/ansys-actions/src/ansys/actions/core/__init__.py rename to .ci/ansys-actions/src/ansys/actions/__init__.py diff --git a/.github/workflows/ci_cd_night.yml b/.github/workflows/ci_cd_night.yml index affb6ea1e..0843f074c 100644 --- a/.github/workflows/ci_cd_night.yml +++ b/.github/workflows/ci_cd_night.yml @@ -42,9 +42,27 @@ jobs: bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} + wheelhouse: + name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" + runs-on: ${{ matrix.os }} + if: github.event.action != 'closed' + permissions: + id-token: write + contents: write + strategy: + fail-fast: false + matrix: + os: ['ubuntu-latest', 'windows-latest'] + python: ['3.10', '3.11', '3.12', '3.13'] + steps: + - uses: ansys/actions/build-wheelhouse@fix/unify-artifacts-file-names + with: + working-directory: .ci/ansys-actions + tests: name: "Tests" runs-on: ubuntu-latest + needs: wheelhouse permissions: id-token: write contents: write diff --git a/.github/workflows/ci_cd_pr.yml b/.github/workflows/ci_cd_pr.yml index 76b93f241..c7adede73 100644 --- a/.github/workflows/ci_cd_pr.yml +++ b/.github/workflows/ci_cd_pr.yml @@ -156,10 +156,43 @@ jobs: bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} maximum-pr-doc-deployments: 10 + wheelhouse: + name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" + runs-on: ${{ matrix.os }} + needs: code-style + if: github.event.action != 'closed' + permissions: + id-token: write + contents: write + strategy: + fail-fast: false + matrix: + os: ['ubuntu-latest', 'windows-latest'] + python: ['3.10', '3.11', '3.12', '3.13'] + steps: + - uses: ansys/actions/build-wheelhouse@fix/unify-artifacts-file-names + with: + library-name: ${{ env.LIBRARY_NAME }} + operating-system: ${{ matrix.os }} + python-version: ${{ matrix.python }} + working-directory: .ci/ansys-actions + + # package-library: + # name: "Package library" + # needs: wheelhouse + # runs-on: ubuntu-22.04 + # steps: + # - name: "Build library source and wheel artifacts" + # uses: ansys/actions/build-library@fix/unify-artifacts-file-names + # with: + # library-name: ${{ env.LIBRARY_NAME }} + # python-version: ${{ env.MAIN_PYTHON_VERSION }} + # working-directory: .ci/ansys-actions + tests: name: "Tests" runs-on: ubuntu-latest - needs: code-style + needs: wheelhouse if: github.event.action != 'closed' permissions: id-token: write diff --git a/.github/workflows/ci_cd_release.yml b/.github/workflows/ci_cd_release.yml index 089d3e410..70f20b8e7 100644 --- a/.github/workflows/ci_cd_release.yml +++ b/.github/workflows/ci_cd_release.yml @@ -142,6 +142,24 @@ jobs: use-python-cache: false needs-quarto: true + wheelhouse: + name: "Wheelhouse / ${{ matrix.os }} / ${{ matrix.python }}" + runs-on: ${{ matrix.os }} + needs: code-style + if: github.event.action != 'closed' + permissions: + id-token: write + contents: write + strategy: + fail-fast: false + matrix: + os: ['ubuntu-latest', 'windows-latest'] + python: ['3.10', '3.11', '3.12', '3.13'] + steps: + - uses: ansys/actions/build-wheelhouse@fix/unify-artifacts-file-names + with: + working-directory: .ci/ansys-actions + tests: name: "Tests" runs-on: ubuntu-latest diff --git a/build-library/action.yml b/build-library/action.yml index db5a9219b..5a49f062d 100644 --- a/build-library/action.yml +++ b/build-library/action.yml @@ -120,8 +120,9 @@ runs: shell: bash env: INSTALL_COMMAND: ${{ inputs.use-uv == 'true' && 'uv pip install --no-managed-python --system' || 'python -m pip install' }} + WORKING_DIRECTORY: ${{ inputs.working-directory }} run: | - $INSTALL_COMMAND . + $INSTALL_COMMAND $WORKING_DIRECTORY - name: "Ensure tag version matches metadata version when triggered by push of tags" if: github.event_name == 'push' && contains(github.ref, 'refs/tags') diff --git a/build-wheelhouse/action.yml b/build-wheelhouse/action.yml index 798c6d093..2d7a3367e 100644 --- a/build-wheelhouse/action.yml +++ b/build-wheelhouse/action.yml @@ -341,13 +341,13 @@ runs: ~/.local/bin/syft .venv --source-name "${LIBRARY_NAME}" --source-version "${LIBRARY_VERSION}" -o spdx > sbom.spdx echo "Renaming SBOM file..." - mv sbom.spdx "${LIBRARY_NAME}-v${LIBRARY_VERSION}-${WHEELHOUSE_TARGET}-${OPERATING_SYSTEM}-${PYTHON_VERSION}-sbom.spdx" + mv sbom.spdx "${LIBRARY_NAME}_v${LIBRARY_VERSION}_${WHEELHOUSE_TARGET}_${OPERATING_SYSTEM}_${PYTHON_VERSION}_sbom.spdx" - name: "Upload the SBOM file" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: - name: ${{ inputs.library-name }}-v${{ steps.library-version.outputs.library_version }}-${{ steps.specific-target-requested.outputs.wheelhouse_target }}-${{ inputs.operating-system }}-${{ inputs.python-version }}-sbom - path: ${{ inputs.library-name }}-v${{ steps.library-version.outputs.library_version }}-${{ steps.specific-target-requested.outputs.wheelhouse_target }}-${{ inputs.operating-system }}-${{ inputs.python-version }}-sbom.spdx + name: ${{ inputs.library-name }}_v${{ steps.library-version.outputs.library_version }}_${{ steps.specific-target-requested.outputs.wheelhouse_target }}_${{ inputs.operating-system }}_${{ inputs.python-version }}_sbom + path: ${{ inputs.library-name }}_v${{ steps.library-version.outputs.library_version }}_${{ steps.specific-target-requested.outputs.wheelhouse_target }}_${{ inputs.operating-system }}_${{ inputs.python-version }}_sbom.spdx retention-days: 7 - name: Generate build provenance attestation @@ -385,20 +385,20 @@ runs: uses: vimtor/action-zip@1379ea20d4c5705669ba81fd626dd01b1c738f26 # v1.2 with: files: wheelhouse - dest: ${{ inputs.library-name }}-v${{ steps.library-version.outputs.library_version }}-${{ steps.specific-target-requested.outputs.wheelhouse_target }}-${{ inputs.operating-system }}-${{ inputs.python-version }}.zip + dest: ${{ inputs.library-name }}_v${{ steps.library-version.outputs.library_version }}_${{ steps.specific-target-requested.outputs.wheelhouse_target }}_${{ inputs.operating-system }}_${{ inputs.python-version }}.zip - name: "Upload the compressed wheelhouse" uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: - name: ${{ inputs.library-name }}-v${{ steps.library-version.outputs.library_version }}-${{ steps.specific-target-requested.outputs.wheelhouse_target }}-${{ inputs.operating-system }}-${{ inputs.python-version }} - path: ${{ inputs.library-name }}-v${{ steps.library-version.outputs.library_version }}-${{ steps.specific-target-requested.outputs.wheelhouse_target }}-${{ inputs.operating-system }}-${{ inputs.python-version }}.zip + name: ${{ inputs.library-name }}_v${{ steps.library-version.outputs.library_version }}_${{ steps.specific-target-requested.outputs.wheelhouse_target }}_${{ inputs.operating-system }}_${{ inputs.python-version }} + path: ${{ inputs.library-name }}_v${{ steps.library-version.outputs.library_version }}_${{ steps.specific-target-requested.outputs.wheelhouse_target }}_${{ inputs.operating-system }}_${{ inputs.python-version }}.zip retention-days: 7 - name: Generate build provenance attestation if: inputs.attest-provenance == 'true' uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0 with: - subject-path: ${{ inputs.library-name }}-v${{ steps.library-version.outputs.library_version }}-${{ steps.specific-target-requested.outputs.wheelhouse_target }}-${{ inputs.operating-system }}-${{ inputs.python-version }}.zip + subject-path: ${{ inputs.library-name }}_v${{ steps.library-version.outputs.library_version }}_${{ steps.specific-target-requested.outputs.wheelhouse_target }}_${{ inputs.operating-system }}_${{ inputs.python-version }}.zip - name: Check library's dependencies license uses: ansys/actions/check-licenses@main diff --git a/doc/source/changelog/907.added.md b/doc/source/changelog/907.added.md new file mode 100644 index 000000000..66c189395 --- /dev/null +++ b/doc/source/changelog/907.added.md @@ -0,0 +1 @@ +Generate wheels package with underscores instead of dashes \ No newline at end of file