Skip to content

CI

CI #2297

Workflow file for this run

name: CI
on:
push:
pull_request:
release:
types: [published]
schedule:
# Daily at 5:12
- cron: "12 5 * * *"
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"
jobs:
list:
runs-on: ubuntu-latest
outputs:
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
steps:
- uses: actions/checkout@v4
- name: Set up nox
uses: wntrblm/[email protected]
- id: noxenvs-matrix
run: |
echo >>$GITHUB_OUTPUT noxenvs=$(
nox --list-sessions --json | jq '[.[].session]'
)
ci:
needs: list
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: >
sudo apt-get update &&
sudo apt-get install -y libenchant-2-dev
if: runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs')
- name: Install dependencies
run: brew install enchant podman
if: runner.os == 'macOS'
- name: Set up nox
uses: wntrblm/[email protected]
- name: Run nox
run: nox -s "${{ matrix.noxenv }}"
packaging:
needs: ci
runs-on: ubuntu-latest
environment:
name: PyPI
url: https://pypi.org/p/bowtie-json-schema
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install build
- name: Create packages
run: python -m build .
- name: Set up nox
uses: wntrblm/[email protected]
- name: Create shiv
run: mkdir shiv/ && nox -s shiv -- shiv/bowtie && chmod +x shiv/bowtie
- name: Tar files
run: tar -cvf bowtie.tar dist shiv
- uses: actions/upload-artifact@v3
with:
name: packages
path: bowtie.tar
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create a Release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: softprops/action-gh-release@v2
with:
files: |
shiv/bowtie
dist/*
generate_release_notes: true