Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub actions release workflow #660

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/djangorestframework-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/gh-action-pypi-publish@v1.10.1
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -92,3 +92,21 @@ jobs:
- name: Run stubtest
run: bash ./scripts/stubtest.sh

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 .
- name: Check package metadata
run: |
twine check --strict dist/*
18 changes: 0 additions & 18 deletions scripts/release.sh

This file was deleted.