From c95917bcfdfad3ef7c2dfd758ccec2af21320e22 Mon Sep 17 00:00:00 2001 From: Alexander Temerev Date: Mon, 4 Mar 2024 16:55:44 +0100 Subject: [PATCH] Different steps on PR and pushing to tags --- .github/workflows/build_test_wheels.yml | 32 +++++++++++++++++++++++++ .github/workflows/publish_wheels.yml | 28 +++------------------- 2 files changed, 35 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/build_test_wheels.yml diff --git a/.github/workflows/build_test_wheels.yml b/.github/workflows/build_test_wheels.yml new file mode 100644 index 00000000..a31f2d08 --- /dev/null +++ b/.github/workflows/build_test_wheels.yml @@ -0,0 +1,32 @@ +name: Neurodamus Build / test wheels + +on: + pull_request: + +jobs: + build-wheel: + runs-on: ubuntu-22.04 + strategy: + matrix: + python_version: [3.11] + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python_version }} + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 500 + fetch-tags: true + - name: Build Wheel + run: | + cd $GITHUB_WORKSPACE + python${{ matrix.python_version }} -m pip install --upgrade build + # build wheel + python${{ matrix.python_version }} -m build . + - name: Test Wheel + run: | + cd $GITHUB_WORKSPACE + pip3 install tox + DIST_FILE=`ls dist/*whl` && tox --installpkg=$DIST_FILE -e ${{ matrix.python_version }} diff --git a/.github/workflows/publish_wheels.yml b/.github/workflows/publish_wheels.yml index fd3be8b1..d4af1446 100644 --- a/.github/workflows/publish_wheels.yml +++ b/.github/workflows/publish_wheels.yml @@ -7,33 +7,11 @@ on: workflow_dispatch: jobs: - wheel: - runs-on: ubuntu-22.04 - strategy: - matrix: - python_version: [3.11] + publish-wheel: steps: - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python_version }} - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 500 - fetch-tags: true - - name: Build Wheel - run: | - cd $GITHUB_WORKSPACE - python${{ matrix.python_version }} -m pip install --upgrade build - # build wheel - python${{ matrix.python_version }} -m build . - - name: Test Wheel - run: | - cd $GITHUB_WORKSPACE - pip3 install tox - DIST_FILE=`ls dist/*whl` && tox --installpkg=$DIST_FILE -e ${{ matrix.python_version }} - name: Upload Wheel + uses: BlueBrainProject/neurodamus/.github/workflows/build_test_wheels@v1 + needs: build-wheel env: PYPI_URL: ${{ secrets.PYPI_URL }} PYPI_USER: ${{ secrets.PYPI_USER }}