From 3d76d36476a73b0c714a15f1334e17df5ff844dc Mon Sep 17 00:00:00 2001 From: Dimitri RODARIE Date: Tue, 7 Jan 2025 17:36:15 +0100 Subject: [PATCH] fix: BSB version dependencies (#25) * fix: bump bsb-core and bsb-hdf5 version and fix GHA for PR * fix: add GHA test in case of no version bump --- .github/workflows/main.yml | 40 ++++++++++++++++++++++-------- .github/workflows/pull_request.yml | 2 +- README.md | 2 +- pyproject.toml | 4 +-- 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 422fc16..72eaf4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: build: uses: ./.github/workflows/build.yml - tag_release: + bump: needs: [isort, black, build] runs-on: ubuntu-latest outputs: @@ -40,6 +40,26 @@ jobs: with: token: ${{ steps.app-token.outputs.token }} branch: main + noVersionBumpBehavior: warn + + tag_release: + needs: [ bump ] + # Skip job in case no version bump is required + # in this case the variable tag will not be set by semver + if: ${{ needs.bump.outputs.tag != ''}} + runs-on: ubuntu-latest + steps: + - name: Create Github token + uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ vars.DBBS_APP_ID }} + private-key: ${{ secrets.DBBS_APP_PRIVATE_KEY }} + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ steps.app-token.outputs.token }} - name: Set up Python 3.11 uses: actions/setup-python@v5 @@ -49,8 +69,8 @@ jobs: - name: Bump version in Python project run: | pip install --upgrade pip bump-my-version - oldv="${{ steps.semver.outputs.current }}" - newv="${{steps.semver.outputs.next}}" + oldv="${{ needs.bump.outputs.old_tag }}" + newv="${{needs.bump.outputs.tag}}" # Bump the version, dropping the leading `v` with `${x:1}` bump-my-version replace --current-version=${oldv:1} --new-version=${newv:1} pyproject.toml @@ -58,17 +78,17 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v5 with: branch: main - commit_message: 'docs: bump version: ${{ steps.semver.outputs.current }} → ${{ steps.semver.outputs.next }} [skip ci]' + commit_message: 'docs: bump version: ${{ needs.bump.outputs.old_tag }} → ${{ needs.bump.outputs.tag }} [skip ci]' - name: Create tag uses: rickstaa/action-create-tag@v1 with: - tag: ${{ steps.semver.outputs.next }} + tag: ${{ needs.bump.outputs.tag }} github_token: ${{ steps.app-token.outputs.token }} release: runs-on: ubuntu-latest - needs: tag_release + needs: [bump, tag_release] steps: - name: Create Github token @@ -93,8 +113,8 @@ jobs: uses: requarks/changelog-action@v1 with: token: ${{ steps.app-token.outputs.token }} - fromTag: ${{ needs.tag_release.outputs.tag }} - toTag: ${{ needs.tag_release.outputs.old_tag }} + fromTag: ${{ needs.bump.outputs.tag }} + toTag: ${{ needs.bump.outputs.old_tag }} - name: Create Release uses: ncipollo/release-action@v1.12.0 @@ -102,8 +122,8 @@ jobs: allowUpdates: true draft: false makeLatest: true - tag: ${{ needs.tag_release.outputs.tag }} - name: ${{ needs.tag_release.outputs.tag }} + tag: ${{ needs.bump.outputs.tag }} + name: ${{ needs.bump.outputs.tag }} body: ${{ steps.changelog.outputs.changes }} token: ${{ steps.app-token.outputs.token }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2d3e58c..10e8076 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - name: PR Conventional Commit Validation - uses: ytanikin/PRConventionalCommits@1.2.0 + uses: ytanikin/PRConventionalCommits@1.3.0 with: task_types: '["feat","fix","docs","test","ci","refactor","perf","revert"]' diff --git a/README.md b/README.md index 38aa76e..c9e773c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # bsb-neuron -bsb-neuron is a pluggin of [BSB](https://github.com/dbbs-lab/bsb) (see also +bsb-neuron is a plugin of the [BSB](https://github.com/dbbs-lab/bsb) (see also [bsb-core](https://github.com/dbbs-lab/bsb-core)). It contains the interfaces and tools to simulate BSB circuit with the [neuron simulator](https://www.neuron.yale.edu/neuron/). diff --git a/pyproject.toml b/pyproject.toml index 082b773..459887d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ license = { file = "LICENSE" } classifiers = ["License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)"] dynamic = ["version", "description"] dependencies = [ - "bsb-core~=4.0", + "bsb-core~=5.0", "nrn-patch~=4.0", "arborize[neuron]~=4.1" ] @@ -27,7 +27,7 @@ test = [ "bsb-core[parallel]", "bsb-test~=4.0", "coverage~=7.0", - "bsb-hdf5~=4.0" + "bsb-hdf5~=5.0" ] dev = [ "bsb-neuron[test]",