Skip to content

Commit 2753f2b

Browse files
committed
Add GitHub actions release workflow
1 parent 91c72c6 commit 2753f2b

File tree

3 files changed

+48
-18
lines changed

3 files changed

+48
-18
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
environment:
11+
name: release
12+
url: https://pypi.org/p/django-stubs
13+
permissions:
14+
id-token: write
15+
steps:
16+
- name: Setup python to build package
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.12'
20+
- name: Install build
21+
run: python -m pip install build
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
- name: Build package
26+
run: python -m build
27+
- name: Publish to PyPI
28+
uses: pypa/[email protected]

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,23 @@ jobs:
133133
134134
- name: Run django-stubs-ext tests
135135
run: PYTHONPATH='.' pytest ext
136+
137+
build-and-check:
138+
runs-on: ubuntu-latest
139+
steps:
140+
- uses: actions/checkout@v4
141+
with:
142+
fetch-tags: true
143+
- uses: actions/setup-python@v5
144+
with:
145+
python-version: '3.12'
146+
- name: Install dependencies
147+
run: python3 -m pip install --upgrade build twine
148+
- name: Build
149+
run: |
150+
python3 -m build --sdist --wheel .
151+
python3 -m build --sdist --wheel ext/
152+
- name: Check package metadata
153+
run: |
154+
twine check --strict dist/*
155+
twine check --strict ext/dist/*

scripts/release.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)