Merge pull request #78 from coveo/chore/codeowners #292
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
name: coveo-stew | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: | |
inputs: | |
publish: | |
description: "Publish to pypi.org?" | |
required: false | |
default: 'false' | |
permissions: | |
contents: read | |
jobs: | |
compatibility: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.x"] | |
poetry-version: ["==1.8.5", ""] # empty means latest | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 | |
with: | |
egress-policy: audit | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Run stew ci | |
uses: ./.github/workflows/actions/stew-ci | |
with: | |
python-version: ${{ matrix.python-version }} | |
poetry-version: ${{ matrix.poetry-version }} | |
publish: | |
name: Publish to pypi.org | |
runs-on: ubuntu-latest | |
needs: compatibility | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Setup global packages | |
shell: bash | |
run: python -m pip install --upgrade pip wheel setuptools "poetry<2.0.0" coveo-pypi-cli>=2.1.2 --user --no-warn-script-location | |
- name: Publish to pypi | |
uses: ./.github/workflows/actions/publish-to-pypi | |
with: | |
pypi-token: ${{ secrets.PYPI_TOKEN }} | |
pre-release: ${{ github.ref != 'refs/heads/main' }} | |
dry-run: ${{ github.ref != 'refs/heads/main' && github.event.inputs.publish != 'true' }} | |
test-action: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 | |
with: | |
egress-policy: audit | |
- uses: coveo/stew@main | |
with: | |
python-version: "3.10" | |
project-name: coveo-stew |