134 update cli tools to use new xarray backend #111
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
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: segysak actions | |
on: | |
push: | |
branches: [main] | |
tags-ignore: | |
- v* | |
pull_request: | |
branches: [main] | |
release: | |
types: [released] | |
jobs: | |
build-test: | |
name: Build and test segysak | |
strategy: | |
max-parallel: 1 | |
fail-fast: true | |
matrix: | |
os: ["windows-latest", "ubuntu-latest", "macos-latest"] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
exclude: | |
- os: macos-latest | |
python-version: "3.9" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# required for `git describe --tags` to work | |
fetch-depth: 100 | |
# The GitHub token is preserved by default but this job doesn't need | |
# to be able to push to GitHub. | |
persist-credentials: false | |
# get zgy submodule | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
#cache: 'pip' | |
- name: Install package and deps | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[test] | |
- name: Run tests | |
run: | | |
pytest -v | |
- name: Build wheels | |
run: pip wheel . -w dist --no-deps | |
- name: Upload wheel as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }} Python ${{ matrix.python-version }} wheel | |
path: dist/* | |
publish: | |
if: needs.build-test.result == 'success' && !github.event.release.prerelease | |
name: Publish to test.PyPI and PyPI | |
runs-on: ubuntu-latest | |
needs: [build-test] | |
steps: | |
- name: Get wheels | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Move to dist/ | |
run: | | |
mkdir dist | |
find artifacts -name "*.whl" -exec mv '{}' dist/ \; | |
- name: Publish package to test.PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_PASSWORD }} | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} |