-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (66 loc) · 1.79 KB
/
python-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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Full CI
on:
push:
branches: [main]
release:
types: [published]
workflow_dispatch:
inputs:
job:
description: 'Choose which job to run'
required: true
default: 'deploy'
type: choice
options:
- publish-module
- test-Django
- all
permissions:
contents: read
jobs:
publish-module:
if: github.event_name == 'release' || github.event.inputs.job == 'publish-module' || github.event.inputs.job == 'all'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: check for current folder
run: |
ls
- name: build package
run: |
python -m build
- name: Publish build
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
test-Django:
if: github.event.inputs.job == 'test-Django' || github.event.inputs.job == 'all' || github.event_name == 'release' || github.event_name == 'push'
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
cd ./test/app/
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ../../
- name: Run Tests
run: |
python manage.py test