Skip to content

Merge pull request #12 from probsys/20240225-fsaad-workflow #10

Merge pull request #12 from probsys/20240225-fsaad-workflow

Merge pull request #12 from probsys/20240225-fsaad-workflow #10

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Test src
run: |
python -m pip install --upgrade pip
pip install '.[tests]'
./check.sh
- name: Test Examples
run: |
cd examples
make
./example.out
./examplef.out
# Auto-publish when version is increased
publish:
# Only try to publish if:
# * Repo is self (prevents running from forks)
# * Branch is `main`
if: |
github.repository == 'probsys/fast-loaded-dice-roller'
&& github.ref == 'refs/heads/master'
needs: build # Only publish after tests are successful
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 30
steps:
- uses: etils-actions/pypi-auto-publish@v1
with:
pypi-token: ${{ secrets.PYPI_API_TOKEN }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
parse-changelog: false