Skip to content

Commit

Permalink
build: publish openedx-learning to pypi (#65)
Browse files Browse the repository at this point in the history
build: publish openedx-learning to pypi
  • Loading branch information
pomegranited authored Jul 24, 2023
1 parent 09a8fec commit 0b75bda
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
os: [ubuntu-latest] # Add macos-latest later?
python-version: ['3.8']
toxenv: ["py38-django32", "py38-django42"]
toxenv: ["py38-django32", "py38-django42", "package"]
# We're only testing against MySQL 8 right now because 5.7 is
# incompatible with Djagno 4.2. We'd have to make the tox.ini file more
# complicated than it's worth given the short expected shelf-life of
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish package to PyPI

on:
push:
tags:
- '*'

jobs:
push:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v3
- name: setup python
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Build package
run: python setup.py sdist bdist_wheel

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,11 @@ deps =
-r{toxinidir}/requirements/test.txt
commands =
code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage

[testenv:package]
deps =
build
twine
commands =
python -m build
twine check dist/*

0 comments on commit 0b75bda

Please sign in to comment.