Skip to content

Commit 0b75bda

Browse files
authored
build: publish openedx-learning to pypi (#65)
build: publish openedx-learning to pypi
1 parent 09a8fec commit 0b75bda

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
os: [ubuntu-latest] # Add macos-latest later?
1818
python-version: ['3.8']
19-
toxenv: ["py38-django32", "py38-django42"]
19+
toxenv: ["py38-django32", "py38-django42", "package"]
2020
# We're only testing against MySQL 8 right now because 5.7 is
2121
# incompatible with Djagno 4.2. We'd have to make the tox.ini file more
2222
# complicated than it's worth given the short expected shelf-life of

.github/workflows/pypi-publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish package to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
push:
10+
runs-on: ubuntu-20.04
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
- name: setup python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: 3.8
19+
20+
- name: Install pip
21+
run: pip install -r requirements/pip.txt
22+
23+
- name: Build package
24+
run: python setup.py sdist bdist_wheel
25+
26+
- name: Publish to PyPI
27+
uses: pypa/gh-action-pypi-publish@release/v1
28+
with:
29+
user: __token__
30+
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}

tox.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,11 @@ deps =
8888
-r{toxinidir}/requirements/test.txt
8989
commands =
9090
code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage
91+
92+
[testenv:package]
93+
deps =
94+
build
95+
twine
96+
commands =
97+
python -m build
98+
twine check dist/*

0 commit comments

Comments
 (0)