diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17bb0cc..8f97360 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,65 +1,70 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: Build febid for win and mac +name: Build febid for win, mac, linux and publish on PyPi on: - push: - branches: [ $default-branch ] - pull_request: - branches: [ $default-branch ] workflow_dispatch: jobs: - build: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ["3.9", "3.10", "3.11"] - include: - - arch: arm64 - os: macos-latest - pypthon-version: "3.9-3.11" + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + include: + - arch: arm64 + os: macos-latest + pypthon-version: "3.9-3.11" - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - pip install build twine -# - name: Build package for linux -# if: ${{ matrix.os == 'ubuntu-latest' }} -# uses: RalfG/python-wheels-manylinux-build@v0.7.1-manylinux2014_x86_64 -# with: -# python-versions: ${{ matrix.python-version }} -# build-requirements: 'setuptools cython numpy' -# pre-build-command: python -m pip install --upgrade pip setuptools wheel - - name: Build package for mac and windows - if: ${{ matrix.os == 'windows-latest' }} || ${{ matrix.os == 'macos-latest' }} - run: | - python -m build --outdir dist + steps: + - uses: actions/checkout@v4 - - name: Save wheels as artifacts - uses: actions/upload-artifact@v3 - with: - path: dist/* - - name: Publish wheels to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} - run: | - twine upload dist/*.whl - - name: Publish sdist to PyPi - if: ${{ matrix.os == 'windows-latest' }} && {{ matrix.python-version == '3.11' }} - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} - run: | - twine upload --repository testpypi dist/*.tar.gz + - name: Build wheels + uses: pypa/cibuildwheel@v2.19.2 + env: + CIBW_BUILD: cp39-* cp310-* cp311-* + CIBW_SKIP: "*_i686" + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist_test + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/febid/ + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + # repository-url: https://test.pypi.org/legacy/ + password: ${{ secrets.TEST_PYPI_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/build_orig.yml b/.github/workflows/build_orig.yml deleted file mode 100644 index 7733de9..0000000 --- a/.github/workflows/build_orig.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: build - -on: - workflow_dispatch: - inputs: - logLevel: - description: 'Log level' - required: true - default: 'warning' - type: choice - options: - - info - - warning - - debug - -env: -# CIBW_BEFORE_BUILD: pip install setuptools oldest-supported-numpy - CIBW_BUILD_VERBOSITY: 3 - # CIBW_TEST_REQUIRES: pytest -# CIBW_TEST_COMMAND: python -c "import sys, numexpr_mod; sys.exit(0 if numexpr_mod.test().wasSuccessful() else 1)" - CIBW_TEST_SKIP: "*macosx*arm64*" - CIBW_SKIP: "*musllinux*" - -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} for ${{ matrix.arch }} - ${{ matrix.p_ver }} - runs-on: ${{ matrix.os }} - env: - CIBW_BUILD: ${{ matrix.cibw_build }} - CIBW_ARCHS_LINUX: ${{ matrix.arch }} - CIBW_ARCHS_MACOS: ${{ matrix.arch }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - arch: [auto64] - cibw_build: ["cp3{7,8,9,10,11}-*"] - p_ver: ["3.7-3.11"] - include: - - arch: arm64 - os: macos-latest - cibw_build: "cp3{7,8,9,10,11}-*" - p_ver: "3.7-3.11" - - arch: aarch64 - os: ubuntu-latest - cibw_build: "cp37*" - p_ver: "3.7" - - arch: aarch64 - os: ubuntu-latest - cibw_build: "cp38*" - p_ver: "3.8" - - arch: aarch64 - os: ubuntu-latest - cibw_build: "cp39*" - p_ver: "3.9" - - arch: aarch64 - os: ubuntu-latest - cibw_build: "cp310*" - p_ver: "3.10" - - arch: aarch64 - os: ubuntu-latest - cibw_build: "cp311*" - p_ver: "3.11" - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - name: Install Python - with: - python-version: '3.x' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - pip install build twine - - - name: Install cibuildwheel - run: | - python -m pip install cibuildwheel - - - uses: docker/setup-qemu-action@v3 - if: ${{ matrix.arch == 'aarch64' }} - name: Set up QEMU - - - name: Build wheels for Python - run: | - python -m cibuildwheel --output-dir dist - - - name: Make sdist - if: ${{ matrix.os == 'windows-latest' }} - run: | - python -m pip install build - python -m build --sdist --outdir dist . - - - name: Publish wheels to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} - run: | - twine upload ./dist/* -# - name: Publish sdist to PyPi -# if: ${{ matrix.os == 'windows-latest' }} -# env: -# TWINE_USERNAME: __token__ -# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} -# run: | -# twine upload --repository testpypi dist/*.tar.gz \ No newline at end of file diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml new file mode 100644 index 0000000..d7542a7 --- /dev/null +++ b/.github/workflows/build_test.yml @@ -0,0 +1,70 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Build febid for win, mac, linux and test publishing on Test.Pypi + +on: + workflow_dispatch: + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + include: + - arch: arm64 + os: macos-latest + pypthon-version: "3.9-3.11" + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.19.2 + env: + CIBW_BUILD: cp39-* cp310-* cp311-* + CIBW_SKIP: "*_i686" + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist_test + path: dist/*.tar.gz + + upload_pypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/project/febid/ + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + # unpacks all CIBW artifacts into dist/ + pattern: cibw-* + path: dist + merge-multiple: true + + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + password: ${{ secrets.TEST_PYPI_PASSWORD }} diff --git a/setup.py b/setup.py index 591036b..a0d17ed 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ requirements = f.read().splitlines() setuptools.setup( name='febid', - version='0.9.2', + version='0.9.3', author='Alexander Kuprava, Michael Huth', author_email='sandro1742@gmail.com', description='FEBID process simulator',