Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/actions/max_disk_space/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Maximize disk space'
description: 'Maximize available disk space by removing unwanted software'

runs:
using: 'composite'
steps:
- name: Maximize available disk space
uses: AdityaGarg8/remove-unwanted-software@v5
with:
remove-android: 'true'
remove-dotnet: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
110 changes: 63 additions & 47 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:
inputs:
force-publish:
description: 'Force publish even if no version change detected'
description: 'Force publish even if no version change was detected'
required: false
type: choice
options:
Expand Down Expand Up @@ -41,6 +41,8 @@ jobs:
lookup-only: true
- uses: actions/checkout@v4
if: steps.look-up.outputs.cache-hit != 'true'
- uses: ./.github/actions/max_disk_space
if: steps.look-up.outputs.cache-hit != 'true'
- uses: actions/cache@v4
if: steps.look-up.outputs.cache-hit != 'true'
with:
Expand Down Expand Up @@ -84,6 +86,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/max_disk_space
- uses: actions/setup-python@v6
with:
python-version: ${{matrix.python-version}}
Expand Down Expand Up @@ -190,34 +193,6 @@ jobs:
env:
BIOIMAGEIO_CACHE_PATH: bioimageio_cache

docs:
needs: [coverage, test]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: coverage-summary
path: dist
- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -e .[dev,partners]
- name: Generate developer docs
run: ./scripts/pdoc/run.sh
- run: cp README.md ./dist/README.md
- name: copy rendered presentations
run: |
mkdir ./dist/presentations
cp -r ./presentations/*.html ./dist/presentations/
- name: Deploy to gh-pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist

build:
runs-on: ubuntu-latest
steps:
Expand All @@ -235,21 +210,36 @@ jobs:
path: dist/
name: dist

publish:
needs: [test, build, conda-build, docs]
docs:
needs: [build, conda-build, coverage, test]
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/project/bioimageio.core/
permissions:
contents: write # required for tag creation
id-token: write # required for pypi publish action
outputs:
new-version: ${{ steps.get-new-version.outputs.new-version }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 2
fetch-depth: 0
fetch-tags: true
- uses: ./.github/actions/max_disk_space
- uses: actions/download-artifact@v4
with:
name: coverage-summary
path: dist
- uses: actions/setup-python@v6
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -e .[dev,docs,partners]
- name: Check doc scripts
run: pyright scripts/generate_api_doc_pages.py
- name: Get branch name to deploy to
id: get_branch
shell: bash
run: |
if [[ -n '${{ github.event.pull_request.head.ref }}' ]]; then branch=gh-pages-${{ github.event.pull_request.head.ref }}; else branch=gh-pages; fi
echo "::set-output name=branch::$branch"
- name: Get parent commit
if: inputs.force-publish != 'true'
id: get-parent-commit
Expand All @@ -258,7 +248,6 @@ jobs:
- id: get-existing-tag
if: inputs.force-publish == 'true'
run: echo "existing-tag=$(git tag --points-at HEAD 'v[0-9]*.[0-9]*.[0-9]*')" >> $GITHUB_OUTPUT

- name: Detect new version from last commit and create tag
id: tag-version
if: github.ref == 'refs/heads/main' && steps.get-parent-commit.outputs.sha && inputs.force-publish != 'true'
Expand All @@ -273,8 +262,6 @@ jobs:
import os
from pathlib import Path



if "${{ inputs.force-publish }}" == "true":
existing_tag = "${{ steps.get-existing-tag.outputs.existing-tag }}"
valid = existing_tag.count("v") == 1 and existing_tag.count(".") == 2 and all(part.isdigit() for part in existing_tag.lstrip("v").split("."))
Expand All @@ -291,23 +278,52 @@ jobs:

with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
print(f"new-version={new_version}", file=f)
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Generate developer docs
run: mike deploy --push --branch ${{ steps.get_branch.outputs.branch }} --update-aliases ${{ steps.get-new-version.outputs.new-version || 'dev'}} ${{ steps.get-new-version.outputs.new-version && 'latest' || ' '}}
- name: copy rendered presentations
run: |
mkdir ./dist/presentations
cp -r ./presentations/*.html ./dist/presentations/
- name: Deploy to gh-pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
clean: true
clean-exclude: |
.nojekyll
index.html
versions.json
latest/
dev/
v0.*/

publish:
needs: [test, coverage, build, conda-build, docs]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && needs.docs.outputs.new-version
environment:
name: release
url: https://pypi.org/project/bioimageio.core/
permissions:
contents: write # required to create a github release (release drafter)
id-token: write # required for pypi publish action
steps:
- uses: actions/download-artifact@v4
if: github.ref == 'refs/heads/main' && steps.get-new-version.outputs.new-version
with:
name: dist
path: dist
- name: Publish package on PyPI
if: github.ref == 'refs/heads/main' && steps.get-new-version.outputs.new-version
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/

- name: Publish the release notes
if: github.ref == 'refs/heads/main'
uses: release-drafter/release-drafter@v6.0.0
with:
publish: "${{ steps.get-new-version.outputs.new-version != '' }}"
tag: '${{ steps.get-new-version.outputs.new-version }}'
tag: '${{ needs.docs.outputs.new-version }}'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ __pycache__/
*.egg-info/
*.pyc
**/tmp
bioimageio_cache/
bioimageio_unzipped_tf_weights/
build/
cache
coverage.xml
dist/
docs/
dogfood/
pkgs/
site/
typings/pooch/
bioimageio_cache/
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Changelog
---

--8<-- "changelog.md"
7 changes: 7 additions & 0 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Compatibility with bioimage.io resources

bioimageio.core is used on [bioimage.io](https://bioimage.io) to test resources during and after the upload process.
Results are reported as "Test reports" (bioimageio.core deployed in a generic Python environment)
as well as the bioimageio.core tool compatibility (testing a resource with bioimageio.core in a dedicated Python environment).

An overview of the latter is available [as part of the collection documentation](https://bioimage-io.github.io/collection/latest/reports_overview/).
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--8<-- "README.md"
Loading
Loading