Skip to content

Commit e700759

Browse files
committed
CI: Move release CI to github actions
The release job depends on the test jobs so we don't have to duplicate the test run code. We also remove the .circleci configuration and adapt .github/workflows/deploy_release.yml as required.
1 parent 4f711e7 commit e700759

File tree

2 files changed

+28
-164
lines changed

2 files changed

+28
-164
lines changed

.circleci/config.yml

Lines changed: 0 additions & 138 deletions
This file was deleted.
Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,56 @@
11
name: Deploy release
22
on:
33
push:
4-
tags: # run only on new tags that follow semver MAJOR.MINOR.PATCH
5-
- '[0-9]+.[0-9]+.[0-9]+'
4+
tags:
5+
- '^v\d+(\.\d+)*(\.[0-9A-Za-z]*)*'
66

77
jobs:
8+
common-actions:
9+
name: Run PR Workflow
10+
uses: ./.github/workflows/github-actions-ci.yml
11+
secrets: inherit
12+
813
deploy-release:
14+
needs:
15+
- common-actions
916
name: Deploy release from tag
1017
runs-on: ubuntu-latest
1118
steps:
12-
- name: Checkout repo with submodules
19+
- name: Checkout repo
1320
uses: actions/checkout@v4
1421
with:
15-
submodules: 'recursive'
16-
fetch-depth: 0 # tags are required for versioneer to determine the version
22+
fetch-depth: 0
1723

1824
- name: Set up Python
1925
uses: actions/setup-python@v5
2026
with:
21-
python-version: '3.13'
27+
# this should be the lowest supported version
28+
python-version: '3.10'
2229

2330
- name: Install build dependencies
2431
run: |
25-
python -m pip install --upgrade pip
26-
python -m pip install tox
27-
python -m pip list
28-
29-
- name: Run tox tests
30-
run: |
31-
tox -e py312-upgraded
32+
pip install --upgrade pip
33+
pip install hatch
34+
pip list
3235
3336
- name: Build wheel and source distribution
3437
run: |
35-
tox -e build-py312-upgraded
38+
hatch build
3639
ls -1 dist
3740
38-
- name: Test installation from a wheel
39-
run: |
40-
tox -e wheelinstall --recreate --installpkg dist/*-none-any.whl
41-
4241
- name: Upload wheel and source distributions to PyPI
4342
run: |
4443
pip install twine
4544
ls -1 dist
46-
# twine upload --repository-url https://test.pypi.org/legacy/ -u ${{ secrets.BOT_PYPI_USER }} -p ${{ secrets.BOT_PYPI_PASSWORD }} --skip-existing dist/*
47-
twine upload -u ${{ secrets.BOT_PYPI_USER }} -p ${{ secrets.BOT_PYPI_PASSWORD }} --skip-existing dist/*
45+
# our current token does not work on testpypi
46+
# twine upload -r testpypi -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing dist/*
47+
twine upload -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing dist/*
4848
49-
- name: Publish wheel and source distributions as a GitHub release
50-
run: |
51-
python -m pip install "githubrelease>=1.5.9"
52-
githubrelease --github-token ${{ secrets.BOT_GITHUB_TOKEN }} release NeurodataWithoutBorders/pynwb \
53-
create ${{ github.ref_name }} --name ${{ github.ref_name }} \
54-
--publish dist/*
49+
- name: Keep packages
50+
uses: actions/upload-artifact@v4
51+
if: ${{ failure() }}
52+
with:
53+
name: pypi-wheel-and-sdist
54+
path: |
55+
dist/*
56+
if-no-files-found: error

0 commit comments

Comments
 (0)