Add list-jdks and list-vendors commands #85
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 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/[email protected] | |
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/[email protected] | |
- 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 }} |