Skip to content

use find_namespace_packages to fix build error #140

use find_namespace_packages to fix build error

use find_namespace_packages to fix build error #140

Workflow file for this run

name: Publish django-admin-sortable2
on:
push:
branches:
- master
tags:
- '*'
jobs:
publish:
name: "Publish release"
runs-on: "ubuntu-latest"
environment:
name: deploy
strategy:
matrix:
python-version: ["3.11"]
node-version: ["18.x"]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install Dependencies
run: |
npm ci --include=dev
python -m pip install build --user
- name: Build Client
run: |
npm run build
npm run build -- --debug
- name: Patch templates
run: |
mkdir -p adminsortable2/templates/adminsortable2/edit_inline
DJANGO_VERSIONS=("4.2" "5.0" "5.1")
for django_version in ${DJANGO_VERSIONS[@]}; do
echo $django_version
curl --silent --output adminsortable2/templates/adminsortable2/edit_inline/stacked-django-$django_version.html https://raw.githubusercontent.com/django/django/stable/$django_version.x/django/contrib/admin/templates/admin/edit_inline/stacked.html
curl --silent --output adminsortable2/templates/adminsortable2/edit_inline/tabular-django-$django_version.html https://raw.githubusercontent.com/django/django/stable/$django_version.x/django/contrib/admin/templates/admin/edit_inline/tabular.html
patch -p0 adminsortable2/templates/adminsortable2/edit_inline/stacked-django-$django_version.html patches/stacked-django-4.0.patch
patch -p0 adminsortable2/templates/adminsortable2/edit_inline/tabular-django-$django_version.html patches/tabular-django-4.0.patch
done
- name: Build 🐍 Python 📦 Package
run: python -m build --sdist --wheel --outdir dist/
- name: Publish 🐍 Python 📦 Package to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN_SORTABLE2 }}