From e47fc63682bd1753f8ab7a7580793e036171f704 Mon Sep 17 00:00:00 2001 From: mstechly Date: Thu, 25 Apr 2024 16:53:05 -0400 Subject: [PATCH] update release workflows --- .github/workflows/quality_checks.yaml | 14 +++++++------- .github/workflows/release.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/quality_checks.yaml b/.github/workflows/quality_checks.yaml index 986f4a4..7045935 100644 --- a/.github/workflows/quality_checks.yaml +++ b/.github/workflows/quality_checks.yaml @@ -46,15 +46,15 @@ jobs: - uses: actions/checkout@v2 - name: Setup poetry uses: abatilo/actions-poetry@v2 - - name: + - name: Run quality checks run: | - poetry install - pip install pre-commit - pre-commit install - pre-commit run -a + poetry install + pip install pre-commit + pre-commit install + pre-commit run -a - name: Run mypy run: MYPYPATH=src poetry run mypy --install-types --non-interactive src - + test_docs_are_building: runs-on: ubuntu-latest steps: @@ -67,6 +67,6 @@ jobs: uses: abatilo/actions-poetry@v2 - name: Install package and deps run: | - poetry install --with docs + poetry install --with docs - name: Build docs run: poetry run mkdocs build diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..3ea0aee --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,26 @@ +name: Build and release + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/qref # TODO: test PyPI + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install pypa/build + run: python -m pip install build --user + - name: Build binary wheel and source tarball + run: python -m build --sdist --wheel --outdir dist/ + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1