Prep for 0.4.0-rc2 (#206) #108
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
- "nightly" | |
jobs: | |
build: | |
name: Build | |
strategy: | |
matrix: | |
platform: | |
- windows-latest | |
- ubuntu-latest | |
- macos-latest | |
python: | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
runs-on: ${{ matrix.platform }} | |
permissions: | |
actions: write | |
env: | |
ZARR_V3_EXPERIMENTAL_API: 1 | |
ZARR_V3_SHARDING: 1 | |
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 acquire-common nightly | |
if: ${{github.ref_name == 'nightly'}} | |
run: | | |
git fetch --tags | |
git checkout nightly | |
git submodule update | |
working-directory: ${{github.workspace}}/acquire-common | |
- name: Set config to pull nightly drivers | |
if: ${{github.ref_name == 'nightly'}} | |
run: | | |
cat >drivers.json <<EOF | |
{ | |
"acquire-driver-zarr": "nightly", | |
"acquire-driver-egrabber": "nightly", | |
"acquire-driver-hdcam": "nightly", | |
"acquire-driver-spinnaker": "nightly", | |
"acquire-driver-pvcam": "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 python-dotenv | |
- 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 | |
python -m pytest -k test_zarr | |
- 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/[email protected] | |
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 |