Migrate to src layout #12
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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
# Adapted from: /~https://github.com/pypa/gh-action-pypi-publish#usage | |
pypi-publish: | |
name: Build, Lint, Test, Release to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
url: https://pypi.org/project/plover-platform-specific-translation/ | |
permissions: | |
id-token: write | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install Test, Coverage, Lint, Type Checking Dependencies | |
run: python -m pip install --editable ".[test]" | |
- name: Run Linter | |
run: pylint src | |
- name: Run Type Checker | |
run: mypy src | |
- name: Run Tests | |
run: pytest | |
- name: Run Coverage | |
run: | | |
coverage run --module pytest | |
coverage report --show-missing | |
- name: Install Build | |
run: python -m pip install --upgrade build | |
- name: Build | |
run: python -m build | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
github-release: | |
name: GitHub Release | |
runs-on: ubuntu-latest | |
needs: | |
- pypi-publish | |
if: always() && needs.pypi-publish.result == 'success' | |
permissions: | |
contents: write | |
steps: | |
- name: Create GitHub Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAG: ${{ github.ref_name }} | |
run: | | |
gh release create "$TAG" \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="$TAG" \ | |
--generate-notes |