Skip to content

Commit

Permalink
enh: Add automated release routine
Browse files Browse the repository at this point in the history
  • Loading branch information
esavary committed Apr 24, 2024
1 parent 7f79390 commit 73a3683
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,61 @@ jobs:
command: |
export PATH="${ANTSPATH}:$PATH"
pytest -n auto --doctest-modules /tmp/src/eddymotion/src /tmp/src/eddymotion/test
build_and_test_package:
docker:
- image: nipreps/miniconda:py39_2403.0
auth:
username: $DOCKER_USER
password: $DOCKER_PAT

resource_class: xlarge

working_directory: /tmp/src/eddymotion
steps:
- checkout
- run:
name: Prepare environment & build
command: |
python -m venv /tmp/buildenv
source /tmp/buildenv/bin/activate
python3 -m pip install -U build hatch hatchling pip twine docutils
hatch build ./dist
twine check dist/eddymotion*
- store_artifacts:
path: /tmp/src/eddymotion/dist
- persist_to_workspace:
root: /tmp/src/eddymotion
paths: dist

- run:
name: Validate version
command: |
source /tmp/buildenv/bin/activate
THISVERSION=$(python -m hatch version | tail -n1 | xargs)
python -m pip install dist/*.whl
mkdir empty
cd empty
INSTALLED=$(python -c 'import eddymotion; print(eddymotion.__version__)')
test "${CIRCLE_TAG:-$THISVERSION}" == "$INSTALLED"
deploy:
docker:
- image: nipreps/miniconda:py39_2403.0
auth:
username: $DOCKER_USER
password: $DOCKER_PAT

working_directory: /tmp/src/eddymotion
steps:
- attach_workspace:
at: /tmp/src/eddymotion
- run:
name: Upload to Pypi
command: |
python -m pip install twine
python -m twine check dist/*
python -m twine upload dist/* --non-interactive
workflows:
version: 2
Expand All @@ -98,6 +153,24 @@ workflows:
tags:
only: /.*/

- build_and_test_package:
requires:
- tests
filters:
branches:
ignore: /.*/
tags:
only: /.*/

- deploy:
requires:
- build_and_test_package
filters:
branches:
ignore: /.*/
tags:
only: /.*/

nightly:
triggers:
- schedule:
Expand Down

0 comments on commit 73a3683

Please sign in to comment.