Skip to content

Drop Python 3.8; add 3.12 to testing/support #67

Drop Python 3.8; add 3.12 to testing/support

Drop Python 3.8; add 3.12 to testing/support #67

Workflow file for this run

# This file is part of cjdk.
# Copyright 2022 Board of Regents of the University of Wisconsin System
# SPDX-License-Identifier: MIT
name: CI
on:
pull_request:
push:
branches:
- main
tags:
- v*
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.0
test:
strategy:
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
name: test-${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Full history needed for setuptools_scm
- uses: excitedleigh/setup-nox@v2.1.0
- run: nox
docs:
needs:
- lint
- test
concurrency:
group: publish-gh-pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Full history needed for setuptools_scm
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install tools
run: |
python -m pip install --user --upgrade pip setuptools nox
- name: Build docs
run: |
python -m nox -s docs
- name: Publish to gh-pages (latest)
if: >-
github.repository == 'cachedjdk/cjdk' &&
github.event_name == 'push' &&
github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
destination_dir: latest
commit_message: Deploy latest
- name: Get version from tag
id: get_version
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION="${GITHUB_REF##refs/tags/v}"
echo "::set-output name=version::${VERSION}"
- name: Publish to gh-pages (tag)
if: >-
github.repository == 'cachedjdk/cjdk' &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/v')
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
destination_dir: ${{ steps.get_version.outputs.version }}
commit_message: Deploy ${{ steps.get_version.outputs.version }}
publish:
needs:
- lint
- test
- docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Full history needed for setuptools_scm
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install tools
run: |
python -m pip install --user --upgrade pip setuptools build
- name: Build sdist and wheel
run: |
python -m build --sdist --wheel --outdir dist .
- name: Publish on PyPI
if: >-
github.repository == 'cachedjdk/cjdk' &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}