Skip to content

Commit

Permalink
Update CI config to use trusted publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
RealOrangeOne committed Jun 18, 2024
1 parent fec2b9a commit e18c26e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 68 deletions.
59 changes: 34 additions & 25 deletions .github/workflows/test.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Test
name: CI

on: [push]
on:
pull_request:
push:
branches:
- main
tags:
- "*"

jobs:
lint:
Expand Down Expand Up @@ -216,28 +222,31 @@ jobs:
run: tox

build:
continue-on-error: true
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
runs-on: ubuntu-latest

needs:
- lint
- test
steps:
- uses: actions/checkout@v4

- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: 3

- name: Install dependencies
run: python -m pip install --upgrade setuptools wheel twine

- name: Build Python packages
run: python setup.py bdist_wheel sdist

- name: twine check
run: twine check dist/*

- name: Upload Python packages artifact
uses: actions/upload-artifact@v4
with:
name: Python Packages
path: dist
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: python -m pip install --upgrade pip build
- name: Build package
run: python -m build
- name: Save built package
uses: actions/upload-artifact@v3
with:
name: package
path: dist
- name: Publish to PyPi
if: ${{ github.ref_type == 'tag' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
print_hash: true
42 changes: 0 additions & 42 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
django-basic-auth-ip-whitelist
==============================

.. image:: https://github.com/torchbox/django-basic-auth-ip-whitelist/actions/workflows/test.yml/badge.svg
.. image:: https://github.com/torchbox/django-basic-auth-ip-whitelist/actions/workflows/ci.yml/badge.svg
:alt: GitHub actions CI status
:target: https://github.com/torchbox/django-basic-auth-ip-whitelist/actions/
.. image:: https://img.shields.io/pypi/v/django-basic-auth-ip-whitelist.svg
Expand Down

0 comments on commit e18c26e

Please sign in to comment.