-
Notifications
You must be signed in to change notification settings - Fork 180
54 lines (49 loc) · 2.05 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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 }}