From 4e677a5efa0ec09d1d8fd278bbed0fd4fcd8eb17 Mon Sep 17 00:00:00 2001 From: Petter Friberg Date: Sun, 12 May 2024 20:10:21 +0200 Subject: [PATCH] Add GitHub actions release workflow for `django-stubs-ext` (#2150) --- .github/workflows/release.yml | 24 ++++++++++++++++++++++++ ext/release.sh | 17 ----------------- 2 files changed, 24 insertions(+), 17 deletions(-) delete mode 100644 ext/release.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3277343f..b790cd1fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,3 +26,27 @@ jobs: run: python -m build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 + + build-and-publish-ext: + runs-on: ubuntu-latest + environment: + name: release-ext + url: https://pypi.org/p/django-stubs-ext + permissions: + id-token: write + steps: + - name: Setup python to build package + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install build + run: python -m pip install build + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Build ext package + run: python -m build ext/ + - name: Publish ext to PyPI + uses: pypa/gh-action-pypi-publish@v1.8.14 + with: + packages-dir: ext/dist/ diff --git a/ext/release.sh b/ext/release.sh deleted file mode 100644 index 52810ef45..000000000 --- a/ext/release.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -ex - -if [[ -z $(git status -s) ]] -then - if [[ "$VIRTUAL_ENV" != "" ]] - then - pip install --upgrade setuptools wheel twine - python setup.py sdist bdist_wheel - twine upload dist/* - rm -rf dist/ build/ - else - echo "this script must be executed inside an active virtual env, aborting" - fi -else - echo "git working tree is not clean, aborting" -fi