From 25bf380a85f99349fd9e9a7509ba3f5172cc989e Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Sun, 13 Oct 2024 20:33:58 -0400 Subject: [PATCH] Add `cd` workflow for uploading new releases to PyPI --- .github/dependabot.yml | 10 ++++++++++ .github/release.yml | 5 +++++ .github/workflows/cd.yml | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/release.yml create mode 100644 .github/workflows/cd.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..b00bfd0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + groups: + actions: + patterns: + - "*" diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..9d1e098 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,5 @@ +changelog: + exclude: + authors: + - dependabot + - pre-commit-ci diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..11d7a54 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,37 @@ +# This workflow will build a Python Package and upload to pypi. See: +# https://docs.pypi.org/trusted-publishers/using-a-publisher/ +# https://github.com/marketplace/actions/pypi-publish +name: CD + +on: + workflow_dispatch: + release: + types: [created] + +jobs: + pypi-publish: + name: upload release to PyPI + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + steps: + # retrieve your distributions here + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install build dependencies and package + run: | + python -m pip install --upgrade pip setuptools_scm + pip install build + - name: Get version and Build + run: | + # Version added upon installing package + python -m pip install --no-deps . + python -m build --sdist --wheel + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1