Skip to content

Add spinnaker to drivers (#88) #45

Add spinnaker to drivers (#88)

Add spinnaker to drivers (#88) #45

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
- "nightly"
jobs:
build:
name: Build
strategy:
matrix:
platform:
- windows-latest
- ubuntu-latest
- macos-latest
python:
- "3.8"
- "3.9"
- "3.10"
runs-on: ${{ matrix.platform }}
permissions:
actions: write
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
with:
ref: main
submodules: true
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Checkout runtime nightly
if: ${{github.ref_name == 'nightly'}}
run: |
git fetch --tags
git checkout nightly
git submodule update
working-directory: ${{github.workspace}}/acquire-video-runtime
- name: Set config to pull nightly drivers
if: ${{github.ref_name == 'nightly'}}
run: |
cat >drivers.json <<EOF
{
"acquire-driver-common": "nightly",
"acquire-driver-zarr": "nightly",
"acquire-driver-egrabber": "nightly",
"acquire-driver-hdcam": "nightly"
}
EOF
shell: bash
- name: Build (macOS)
if: matrix.platform == 'macos-latest'
uses: messense/maturin-action@v1
with:
command: build
target: universal2-apple-darwin
args: --release -o dist
- name: Build (Windows, Linux)
if: matrix.platform != 'macos-latest'
uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov tifffile zarr dask ome-zarr
- name: Install Acquire (Windows)
if: matrix.platform == 'windows-latest'
run: |
$whl = ls | Select -First 1
python -m pip install $whl
shell: pwsh
working-directory: "${{ github.workspace }}/dist"
- name: Install Acquire (Linux, macOS)
if: matrix.platform != 'windows-latest'
run: python -m pip install *.whl
working-directory: "${{ github.workspace }}/dist"
- name: Test artifact
run: |
python -m pytest -k test_basic --color=yes --cov-report=xml --cov=acquire --maxfail=5 --log-cli-level=0
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: ${{matrix.platform}} wheels
path: dist
release:
needs: build
name: "Release"
runs-on: "ubuntu-latest"
environment:
name: pypi
url: https://pypi.org/p/acquire-imaging
permissions: write-all
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
id: download
with:
path: ${{ github.workspace }}/artifacts
- name: Collect wheels
run: |
mkdir -p dist
mv ${{steps.download.outputs.download-path}}/*/*.whl dist
- name: Tagged release
if: ${{ github.ref_name != 'nightly' }}
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ github.token }}
prerelease: false
files: |
dist/*.whl
- name: Nightly release
if: ${{ github.ref_name == 'nightly' }}
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.PAT }}
automatic_release_tag: "nightly"
prerelease: true
title: "Nightly Release"
files: |
dist/*.whl
- name: Publish wheels
if: ${{ github.ref_name != 'nightly' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true