Skip to content

Commit

Permalink
Add GitHub actions release workflow (#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
flaeppe authored Mar 19, 2024
1 parent 71f7ada commit 31df882
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 18 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
release:
types: [published]

jobs:
build-and-publish:
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/django-stubs
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 package
run: python -m build
- name: Publish to PyPI
uses: pypa/[email protected]
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,23 @@ jobs:
- name: Run django-stubs-ext tests
run: PYTHONPATH='.' pytest ext

build-and-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: python3 -m pip install --upgrade build twine
- name: Build
run: |
python3 -m build --sdist --wheel .
python3 -m build --sdist --wheel ext/
- name: Check package metadata
run: |
twine check --strict dist/*
twine check --strict ext/dist/*
18 changes: 0 additions & 18 deletions scripts/release.sh

This file was deleted.

0 comments on commit 31df882

Please sign in to comment.