Bump actions/checkout from 3.3.0 to 4.1.1 #300
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: Build, lint, test, package and publish | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ 3.7, 3.8, 3.9 ] | |
steps: | |
- uses: actions/[email protected] | |
- name: Determine version | |
id: get_version | |
run: | | |
if [ "${{ github.event_name }}" == "release" ]; then | |
version="${GITHUB_REF##*/}" | |
else | |
version="1.0.dev${{ github.run_id }}" | |
fi | |
echo "Setting version to $version" | |
echo "::set-output name=version::$version" | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install poetry | |
uses: abatilo/[email protected] | |
- name: Set version | |
run: | | |
poetry version ${{ steps.get_version.outputs.version }} | |
sed -i "s/\"1.0.dev0\"/\"${{ steps.get_version.outputs.version }}\"/g" clin/__init__.py | |
- name: Install dependencies | |
run: poetry install | |
- name: Run linter | |
run: poetry run black clin --check | |
- name: Build packages | |
run: poetry build | |
- name: Run tests | |
run: poetry run pytest | |
- name: Publish to PyPI | |
if: github.event_name == 'release' && matrix.python-version == '3.7' | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | |
run: poetry publish |