fixed version number #4
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
name: Python package | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
paths: | |
- 'fls/**' | |
- 'env/**' | |
- '.style.yapf' | |
pull_request: | |
paths: | |
- 'fls/**' | |
- 'env/**' | |
- '.style.yapf' | |
types: [opened, synchronize, reopened] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
- name: Run tests | |
run: | | |
python env/tests/run_tests.py | |
publish: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install flit | |
run: python -m pip install --upgrade pip flit | |
- name: Publish to PyPI | |
env: | |
FLIT_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
FLIT_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: flit publish |