Skip to content

Update GitHub Actions workflow to use Node.js 20 #8

Update GitHub Actions workflow to use Node.js 20

Update GitHub Actions workflow to use Node.js 20 #8

Workflow file for this run

name: Build, Test, and Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build twine sphinx cibuildwheel anaconda-client
pip install -r requirements.txt
- name: Generate documentation with Sphinx
run: |
sphinx-apidoc -o docs src/waltlabtools
sphinx-build -b html docs docs/_build
- name: Build wheels
run: cibuildwheel --output-dir dist
- name: Check built distributions
run: twine check dist/*
- name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
- name: Upload to Anaconda
if: startsWith(github.ref, 'refs/tags/')
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
run: |
anaconda login --username tylerdougan --password $ANACONDA_API_TOKEN
anaconda upload dist/*.whl
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body: |
Release notes for version ${{ github.ref }}
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/
asset_name: $(basename $dist/*)
asset_content_type: application/zip