Skip to content

ENH: Bump GitHub Actions versions #22

ENH: Bump GitHub Actions versions

ENH: Bump GitHub Actions versions #22

name: "build-test-publish"
on: [push, pull_request]
environment:

Check failure on line 5 in .github/workflows/build-test-publish.yml

View workflow run for this annotation

GitHub Actions / build-test-publish

Invalid workflow file

The workflow is not valid. .github/workflows/build-test-publish.yml (Line: 5, Col: 1): Unexpected value 'environment'
name: pypi
url: https://pypi.org/p/<your-pypi-project-name>
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
jobs:
build_wheel:
name: Build Python wheels
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: "Build pure Python wheels"
run: |
python -m pip wheel -w dist -e src/
- uses: actions/upload-artifact@v4
with:
name: wheel
path: ./dist/itk_dreg-*.whl
pytest:
name: "Test with PyTest"
runs-on: ubuntu-latest
needs:
- build_wheel
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Update pip
run: |
python -m pip install --upgrade pip
- name: "Install Dependencies"
shell: bash
run: |
python -m pip install flit
cd src
flit install --deps develop
- name: Download Python Wheel Artifact
uses: actions/download-artifact@v4
with:
name: wheel
- name: "Install itk_dreg from Wheel Artifact"
run: |
wheel_name_full=`(find . -name "itk_dreg-*.whl")`
python -m pip uninstall -y itk_dreg
python -m pip install ${wheel_name_full}
- name: "Run Tests"
shell: bash
run: |
pytest ./test -vvv -s -k "not localcluster and not serialize_pairwise_result"
publish:
needs:
- build_wheel
- pytest
runs-on: ubuntu-22.04
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- name: Download Python Wheel Artifact
uses: actions/download-artifact@v4
with:
name: wheel
path: dist
- name: "Publish Python wheel to the Python Package Index"
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
skip_existing: true