diff --git a/.github/workflows/bazel_tests.yml b/.github/workflows/bazel_tests.yml index d9b2c705..ef385208 100644 --- a/.github/workflows/bazel_tests.yml +++ b/.github/workflows/bazel_tests.yml @@ -6,25 +6,25 @@ on: pull_request: types: [opened, synchronize, reopened] - jobs: BAZEL: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ['3.9'] + python-version: ["3.9"] os: [macos-latest, ubuntu-latest] steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: submodules: true - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: ${{ matrix.python-version }} - name: Run gtest timeout-minutes: 40 - run: bazel test --test_output=all --spawn_strategy=standalone --test_timeout=1500 //tests/cpp/... + run: + bazel test --test_output=all --spawn_strategy=standalone --test_timeout=1500 //tests/cpp/... # - name: Run SEALAPI tests # timeout-minutes: 30 # run: bazel test --test_output=all --spawn_strategy=standalone --test_timeout=1500 --jobs 1 //tests/python/sealapi/... diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 2136f8ac..a33fd737 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -1,26 +1,26 @@ name: Benchmarks on: push: - branches: [main] - + branches: [main] + jobs: benchmark: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.12] + python-version: ["3.13"] os: [macos-latest, ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: ${{ matrix.python-version }} - name: Prepare ENV run: | - echo "CC=clang" >> $GITHUB_ENV - echo "CXX=clang++" >> $GITHUB_ENV + echo "CC=clang" >> $GITHUB_ENV + echo "CXX=clang++" >> $GITHUB_ENV if: ${{ matrix.os == 'ubuntu-latest' }} - name: Install dependencies Ubuntu run: .github/workflows/scripts/install_req_ubuntu.sh @@ -44,7 +44,7 @@ jobs: run: | pytest tests/python/benchmarks/ --cov-fail-under 0 --benchmark-json pytest_benchmarks_output.json - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@4de1bed97a47495fc4c5404952da0499e31f5c29 # v1.20.3 + uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 # v1.20.4 with: name: Python-Benchmarks tool: "pytest" diff --git a/.github/workflows/ossar-analysis.yml b/.github/workflows/ossar-analysis.yml index b7685566..9a25d5cf 100644 --- a/.github/workflows/ossar-analysis.yml +++ b/.github/workflows/ossar-analysis.yml @@ -5,7 +5,7 @@ name: OSSAR on: push: - branches: [ main ] + branches: [main] jobs: OSSAR-Scan: @@ -14,16 +14,16 @@ jobs: runs-on: windows-latest steps: - - name: Checkout repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - # Run open source static analysis tools - - name: Run OSSAR - uses: github/ossar-action@4e96c4f6e591eb4b991abfd459e40b136a317aea # v2.0.0 - id: ossar + # Run open source static analysis tools + - name: Run OSSAR + uses: github/ossar-action@4e96c4f6e591eb4b991abfd459e40b136a317aea # v2.0.0 + id: ossar - # Upload results to the Security tab - - name: Upload OSSAR results - uses: github/codeql-action/upload-sarif@5618c9fc1e675841ca52c1c6b1304f5255a905a0 # v2.19.0 - with: - sarif_file: ${{ steps.ossar.outputs.sarifFile }} + # Upload results to the Security tab + - name: Upload OSSAR results + uses: github/codeql-action/upload-sarif@b8d3b6e8af63cde30bdc382c0bc28114f4346c88 # v2.28.1 + with: + sarif_file: ${{ steps.ossar.outputs.sarifFile }} diff --git a/.github/workflows/publish_wheels.yml b/.github/workflows/publish_wheels.yml new file mode 100644 index 00000000..3054394d --- /dev/null +++ b/.github/workflows/publish_wheels.yml @@ -0,0 +1,54 @@ +name: Build and Publish + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ${{ matrix.target[0] }} + strategy: + fail-fast: false + matrix: + target: + - [ubuntu-latest, manylinux_x86_64] + - [windows-latest, win_amd64] + - [macos-13, macosx_x86_64] + - [macos-14, macosx_arm64] + python: + - cp39 + - cp310 + - cp311 + - cp312 + - cp313 + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + submodules: true + + - name: Setup msbuild + uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2 + if: matrix.target[0] == 'windows-latest' + + - name: Build wheels using cibuildwheel + uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0 + env: + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.target[1] }} + CIBW_BUILD_VERBOSITY: 1 + with: + package-dir: . + output-dir: wheelhouse + + - name: Upload Artifacts + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 + with: + name: TenSEAL-${{ matrix.python }}-${{ matrix.target[0] }} + path: ./wheelhouse/*.whl + + - name: Publish wheels to PyPI + uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 + with: + packages-dir: ./wheelhouse/ + user: ${{ secrets.PYPI_USERNAME }} + password: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/pythonpublish-linux.yml b/.github/workflows/pythonpublish-linux.yml deleted file mode 100644 index 04d124bc..00000000 --- a/.github/workflows/pythonpublish-linux.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Linux Package - -on: - workflow_dispatch: - release: - types: [published] - -jobs: - deploy: - strategy: - matrix: - python-version: - - cp38-cp38 - - cp39-cp39 - - cp310-cp310 - - cp311-cp311 - - cp312-cp312 - - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - submodules: true - - name: Prepare ENV - run: | - echo "/opt/python/${{ matrix.python-version }}/bin" >> $GITHUB_PATH - - name: Install dependencies - run: .github/workflows/scripts/install_req_manylinux.sh - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: .github/workflows/scripts/release_manylinux.sh diff --git a/.github/workflows/pythonpublish-macos.yml b/.github/workflows/pythonpublish-macos.yml deleted file mode 100644 index f6c75a10..00000000 --- a/.github/workflows/pythonpublish-macos.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: MacOS Package - -on: - workflow_dispatch: - release: - types: [published] - -jobs: - deploy: - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - os: [macos-12, macos-13, macos-14] - - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - submodules: true - - name: Set up Python - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: .github/workflows/scripts/install_req_macos.sh - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: .github/workflows/scripts/release_macos.sh diff --git a/.github/workflows/pythonpublish-windows.yml b/.github/workflows/pythonpublish-windows.yml deleted file mode 100644 index 2333b897..00000000 --- a/.github/workflows/pythonpublish-windows.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Windows Package - -on: - workflow_dispatch: - release: - types: [published] - -jobs: - deploy: - runs-on: windows-latest - strategy: - matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - submodules: true - - name: Set up Python - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: .github/workflows/scripts/install_req_windows.bat - - name: Setup msbuild - uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2 - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - .github/workflows/scripts/build_windows.bat - .github/workflows/scripts/release_windows.bat diff --git a/.github/workflows/scripts/install_req_manylinux.sh b/.github/workflows/scripts/install_req_manylinux.sh deleted file mode 100755 index 38821c20..00000000 --- a/.github/workflows/scripts/install_req_manylinux.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# install python dependencies -python3 -m pip install --upgrade pip -python3 -m pip install setuptools wheel twine auditwheel diff --git a/.github/workflows/scripts/release_macos.sh b/.github/workflows/scripts/release_macos.sh deleted file mode 100755 index 0b37f26a..00000000 --- a/.github/workflows/scripts/release_macos.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -pip wheel . -w wheel/ -twine upload --skip-existing wheel/* diff --git a/.github/workflows/scripts/release_manylinux.sh b/.github/workflows/scripts/release_manylinux.sh deleted file mode 100755 index 69bae111..00000000 --- a/.github/workflows/scripts/release_manylinux.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -python3 -m pip wheel . -w dist/ --no-deps -auditwheel repair dist/*.whl --plat $AUDITWHEEL_PLAT -twine upload --skip-existing wheelhouse/* diff --git a/.github/workflows/scripts/release_windows.bat b/.github/workflows/scripts/release_windows.bat deleted file mode 100755 index 7f0bc4cb..00000000 --- a/.github/workflows/scripts/release_windows.bat +++ /dev/null @@ -1,4 +0,0 @@ -@echo off - -pip wheel . -w wheel/ -twine upload --skip-existing wheel/* diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f9152788..a902ad33 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,14 +11,14 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ['3.8', '3.12'] + python-version: ["3.13"] os: [ubuntu-latest] steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: submodules: true - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -34,25 +34,25 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] os: [macos-latest, ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: submodules: true - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: ${{ matrix.python-version }} - name: Check LongPathsEnabled run: | - git config --system core.longpaths true - (Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled + git config --system core.longpaths true + (Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled if: ${{ matrix.os == 'windows-latest' }} - name: Prepare ENV run: | - echo "CC=clang" >> $GITHUB_ENV - echo "CXX=clang++" >> $GITHUB_ENV + echo "CC=clang" >> $GITHUB_ENV + echo "CXX=clang++" >> $GITHUB_ENV if: ${{ matrix.os == 'ubuntu-latest' }} - name: Install dependencies Ubuntu run: .github/workflows/scripts/install_req_ubuntu.sh @@ -86,25 +86,25 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] os: [macos-latest, ubuntu-latest, windows-latest] steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: submodules: true - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: python-version: ${{ matrix.python-version }} - name: Prepare ENV run: | - echo "CC=clang" >> $GITHUB_ENV - echo "CXX=clang++" >> $GITHUB_ENV + echo "CC=clang" >> $GITHUB_ENV + echo "CXX=clang++" >> $GITHUB_ENV if: ${{ matrix.os == 'ubuntu-latest' }} - name: Check LongPathsEnabled run: | - git config --system core.longpaths true - (Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled + git config --system core.longpaths true + (Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled if: ${{ matrix.os == 'windows-latest' }} - name: Install dependencies Ubuntu run: .github/workflows/scripts/install_req_ubuntu.sh diff --git a/tenseal/version.py b/tenseal/version.py index 8966e1c9..39774cfa 100644 --- a/tenseal/version.py +++ b/tenseal/version.py @@ -1 +1 @@ -__version__ = "0.3.15" +__version__ = "0.3.16"